This guide serve as a record on how i configured sendmail in AIX 7.1 to relay mails to my company's exchange.
Get sendmail running first
# lssrc -s sendmail # ps -aef | grep sendmail # startsrc -s sendmail -a "-bd -q30m" # ps -aef | grep sendmailYou should see the following output
root 5704 1 0 11:08:42 - 0:00 sendmail: accepting connections on port 25Ensure sendmail runs after a reboot. Edit the '/etc/rc.tcpip' file
# vi /etc/rc.tcpipuncomment the following startup line in ‘/etc/rc.tcpip’
start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"Get sendmail to use local hosts for name resolution instead of DNS (default) Edit ‘/etc/netsvc.conf’ file
# vi /etc/netsvc.confAdd the following:
hosts=localFor security purpose, change the permissions on the ‘/etc/netsvc.conf’ file to lock down root only access:
# chmod 600 /etc/netsvc.confAdd into the ‘/etc/hosts’ file the IP address and hostname of the Exchange server. use telnet to verify network.
# telnetAdd the IP and hostname into ‘/etc/hosts’25
# vi /etc/hostsThe email daemon requires FQDN, so say your host is "myserver", append "myserver." to your hostname in /etc/hosts. Backup the original ‘/etc/sendmail.cf’ file and edit.
# cp /etc/sendmail.cf /etc/sendmail.cf.Make the following changes:
# vi /etc/sendmail.cfFor AIX 6.1, i changed the Dw as well. Don't need it in AIX 7.1. Change from:
#DwYourHostNameTo:
DwChange from:
# "Smart" relay host (may be null) # Relay host to forward outgoing mail not in the local domain to. # To forward ALL mail to this relay host, uncomment the appropriate # rule in ruleset 0, as indicated by the ruleset's comments. #DSmailer:relayhostname DSTo:
# "Smart" relay host (may be null) # Relay host to forward outgoing mail not in the local domain to. # To forward ALL mail to this relay host, uncomment the appropriate # rule in ruleset 0, as indicated by the ruleset's comments. #DSmailer:relayhostname DSNow refresh the ‘sendmail’ daemon with the new changes
# refresh –s sendmailIt will take a few minutes for the ‘ps’ process to return:
root 5704 1 0 11:08:42 - 0:00 sendmail: accepting connections on port 25In the interim period the following will be displayed via ‘ps’:
root 5704 1 0 11:08:42 - 0:00 /usr/lib/sendmail –bd –q30Test sendmail now.
# echo “test” |sendmail –v yourname@myinbox.comEnable mail log by adding the following line in syslog.conf.
mail.debug /var/log/maillog rotate files 6 time 30d compressNow, create the log file and refresh syslogd.
# touch /var/log/maillog # refresh -s syslogd
No comments:
Post a Comment