How To
Summary
Because a new sendmail version is implemented in AIX 7.2 TL 5 the approach to implement masquerading and genericstable changed.
Environment
Applies to AIX 7.2 TL 5 and later versions that implement the new sendmail version.
Steps
How to set up masquerading
To enable the masquerading, it is necessary to build a submit.cf implementing this feature with the following procedure:
cd /usr/samples/tcpip/sendmail/cf
cp submit.mc submit-masquerade.mc
vi submit-masquerade.mc
At the end of the file, the following line needs to be added:
MASQUERADE_AS(`masquerade.domain.com')
The special syntax of the single quotation marks needs to be observed. After the file is saved, it can be compiled:
m4 ../m4/cf.m4 submit-masquerade.mc > /tmp/submit.cf
If there are no errors, the submit.cf file can be installed:
cd /etc/mail
mv submit.cf submit.cf.org
cp /tmp/submit.cf .
How to enable the genericstable
To enable the genericstable, it is also necessary to build a submit.cf containing this feature, by using the following procedure:
cd /usr/samples/tcpip/sendmail/cf
cp submit.mc submit-generics.mc
vi submit-generics.mc
The following line:
FEATURE(genericstable)dnl
needs to be added preceding the line that contains "dnl" only. After the file is saved, it is compiled with
m4 ../m4/cf.m4 submit-generics.mc > /tmp/submit.cf
If this command runs without error, the submit.cf file is installed the same way with:
cd /etc/mail
mv submit.cf submit.cf.org
cp /tmp/submit.cf .
The procedure to create the genericstable is the same as for earlier sendmail versions.
The file "/etc/mail/genericstable" can be created to list the local users sending mail and the intended replacement address in the form
user1 replaced_user1@changeddomain1.com
user2 replaced_user2@changeddomain2.com
...
Then, the generics database is built by using these commands
cd /etc/mail
makemap hash genericstable < genericstable
chmod a+r genericstable.db
How to apply the change to the envelope as well
The mail contains the sender address in two different instances: in the "mail header" being the information the mail frontend presents to the receiver, and in the "envelope" being used in the SMTP dialog. By default either form of masquerading is applied only to the "mail header". If it is wanted to apply it to the "envelope" as well (which might be a requirement for some mail relays), the following statement
FEATURE(masquerade_envelope)dnl
can be added (either after the "MASQUERADE_AS" or the "FEATURE(genericstable)" line) to the respective submit-???.mc file when the submit.cf file is built.