This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aix:sendmail [2021/01/01 21:21] 127.0.0.1 external edit |
aix:sendmail [2022/12/19 23:50] (current) manu |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Sendmail on AIX ===== | ===== Sendmail on AIX ===== | ||
+ | |||
+ | https://www.ibm.com/support/pages/configuring-masquerading-aix-sendmail-using-generics-table | ||
+ | |||
+ | https://www.ibm.com/support/pages/how-disable-recipient-domain-lookup-sendmail | ||
+ | |||
+ | |||
+ | 2 ways to deploy sendmail: | ||
+ | * using **submit.cf** file, for AIX 7.2TL4 and later | ||
+ | * using **sendmail.cf** | ||
+ | |||
+ | ===== submit.cf ===== | ||
+ | |||
+ | A workaround to prevent using submit file, is to crate a symbolic link between **/etc/mail/sendmail.cf** and **/etc/mail/submit.cf** (check section [[aix:sendmail#sendmail_configuration|sendmail.cf]]) | ||
+ | |||
+ | https://www.ibm.com/support/pages/how-run-two-sendmails-one-mtamail-transfer-agent-and-another-msamail-submission-agent | ||
+ | |||
+ | How to run two sendmails, one for MTA(Mail Transfer Agent) and another for MSA(Mail Submission Agent). | ||
+ | |||
+ | |||
+ | ===== sendmail.cf ===== | ||
+ | | ||
For more secure sendmail in AIX 7.2 TL4 | For more secure sendmail in AIX 7.2 TL4 | ||
https://www.ibm.com/support/knowledgecenter/ssw_aix_72/s_commands/sendmail.dita | https://www.ibm.com/support/knowledgecenter/ssw_aix_72/s_commands/sendmail.dita | ||
+ | |||
+ | https://www.ibm.com/support/pages/node/6378270?myns=aix&mynp=OCSG11S&mync=E&cm_sp=aix-_-OCSG11S-_-E | ||
+ | |||
+ | <cli> | ||
+ | Sendmail was updated in newer AIX versions and it works differently | ||
+ | now, it requires sendmail running to send and receive emails | ||
+ | |||
+ | "AIX® version AIX 7 with 7200-03 and earlier used sendmail.cf | ||
+ | configuration file for the sendmail command. Starting with AIX | ||
+ | version AIX 7 with 7200-04 two configuration files sendmail.cf | ||
+ | and submit.cf are installed. The sendmail command uses the | ||
+ | submit.cf configuration file by default. The sendmail.cf file | ||
+ | exists for compatibility with earlier versions of the sendmail | ||
+ | command. The following | ||
+ | information is valid for both sendmail.cf and submit.cf | ||
+ | configuration files." | ||
+ | </cli> | ||
+ | <cli> | ||
+ | You can read more about this here: https://www.ibm.com/docs/en/aix/7.2?topic=files-sendmailcf-submitcf-file | ||
+ | </cli> | ||
==== Sendmail configuration ==== | ==== Sendmail configuration ==== | ||
Line 60: | Line 101: | ||
* Listening on port 25/tcp for incoming messages from outside of the machine | * Listening on port 25/tcp for incoming messages from outside of the machine | ||
* Flushing the local queue of unsent messages on a periodic basis | * Flushing the local queue of unsent messages on a periodic basis | ||
+ | |||
+ | ===== aliases ===== | ||
+ | |||
+ | alias configuration for sendmail in MSP mode (applicable only beyond AIX version 7200-04-02). | ||
+ | |||
+ | To configure the aliasing in sendmail, which runs in mail submission program mode (MSP). | ||
+ | Mail aliasing in sendmail, which is being run in mail submission program mode. | ||
+ | |||
+ | Steps | ||
+ | |||
+ | To configure the alias while sending a mail with sendmail in Mail Submission Program mode. Mailer flag in /etc/mail/submit.cf file should be modified to add alias flag "A" as part of F attribute. | ||
+ | |||
+ | Sample change to mailer flag in "/etc/mail/submit.cf" : | ||
+ | |||
+ | Mlocal, F=lmDFMuXkw5 | ||
+ | to | ||
+ | Mlocal, F=lmDFMAuXkw5 | ||
+ | |||
+ | Alias flag "A" is added to mailer as part of F attribute as shown above. | ||
+ | |||
+ | When adding a new alias into /etc/mail/aliases | ||
+ | |||
+ | Ex: | ||
+ | TEST: user@machine | ||
+ | testalias: TEST | ||
+ | | ||
+ | The /etc/mail/aliases file is a raw data file. The sendmail command uses a database version of this file. You must build a new alias database by running the sendmail -bi command or the newaliases command before any changes made to the /etc/mail/aliases file become effective. | ||
+ | |||
Line 118: | Line 187: | ||
Test the communication with your mail server: | Test the communication with your mail server: | ||
+ | |||
+ | An easy way to test by using | ||
+ | stoprsc -s sendmail | ||
+ | /usr/lib/sendmail -v -q30s -X /tmp/sendmail.debug | ||
**telnet mail.test.com 25** | **telnet mail.test.com 25** | ||
Line 225: | Line 298: | ||
T=DNS/RFC822/SMTP, | T=DNS/RFC822/SMTP, | ||
A=TCP $h | A=TCP $h | ||
+ | </cli> | ||
+ | |||
+ | ===== Debug / trace ===== | ||
+ | |||
+ | <cli prompt="#"> | ||
+ | # startsrc –s iptrace –a "-b 2000000000 –p 25,53 /tmp/iptrace.log" | ||
+ | |||
+ | # echo "test" | mail –v "test email" email@test.com > /tmp/mail_test.log | ||
+ | |||
+ | # stopsrc -s iptrace | ||
</cli> | </cli> | ||