IBM Support

Configuring email forwarder for multiple domains using virtual user table in AIX Sendmail

How To


Summary

This article describes steps by step configuration of an email forwarder in AIX Sendmail by using virtual user table.

Objective

Configuring email forwarder for multiple domains.

Steps

Step 1 - Create the mapping in the /etc/mail/virtusertable
Example : <virtual/real domain>     <whom to forward>

/etc/mail/virtusertable file for reference :
--------------------------------------
# support for multiple domains
# create virtusertable.db file as follows:
# makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
test@testdomain.com host@domain.com
test@testdomain.com root@domain2.com
testu@service.com mayank@domainx.com
@service.com mayank@domainx.com
-------------------------------------------------
Step 2 - create "virtusertable.db"
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

Step 3 - Create a /etc/mail/local-host-names file, include all those domains for which forwarding is required (can be virtual domains also)
-------------------------------------------------
testdomain.com
service.com
-------------------------------------------------

Step 4 - Make the following changes in the "submit.cf" file:
Add the following lines above "# arithmetic map"
Fw/etc/mail/local-host-names

# Virtual user table (maps incoming users)
Kvirtuser hash /etc/mail/virtusertable

Add the below stanza just above the line "# short circuit local delivery so forwarded email works"
or carefully merge this stanza from /etc/mail/sendmail.cf
------------------------------------------------------------------------------
# handle virtual users
R$+			$: <!> $1		Mark for lookup
R<!> $+ < @ $={VirtHost} . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<!> $+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<@> $+ + $+ < @ $* . >
			$: < $(virtuser $1 + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $* . >
			$: < $(virtuser $1 + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $* . >
			$: < $(virtuser $1 @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $+ < @ $+ . >	$: < $(virtuser + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $+ . >	$: < $(virtuser + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $+ . >	$: < $(virtuser @ $3 $@ $1 $@ $2 $@ +$2 $: ! $) > $1 + $2 < @ $3 . >
R<@> $+ < @ $+ . >	$: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<@> $+			$: $1
R<!> $+			$: $1
R< error : $-.$-.$- : $+ > $* 	$#error $@ $1.$2.$3 $: $4
R< error : $- $+ > $* 	$#error $@ $(dequote $1 $) $: $2
R< $+ > $+ < @ $+ >	$: $>Recurse $1

------------------------------------------------------------------------------
Note: line "Fw/etc/mail/local-host-names" must be uncommented if we are setting up for another domain.
Note: If you are unable to follow step 4, merge those changes by using the attached sample submit.cf file.

Additional Information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author: Mayank Sonakiya
Operating System: AIX and VIOS
Hardware: Power
Feedback: aix_feedback@wwpdl.vnet.ibm.com, msonakiy@in.ibm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cvxaAAA","label":"Communication Applications-\u003ESENDMAIL\/MAIL"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"7.2.0;7.3.0"}]

Document Information

More support for:
AIX

Component:
Communication Applications->SENDMAIL/MAIL

Software version:
7.2.0, 7.3.0

Operating system(s):
AIX

Document number:
6613579

Modified date:
16 August 2023

UID

ibm16613579

Manage My Notification Subscriptions