Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Thursday 7 November 2013

work with sendmail in AIX


Sendmail has been included with the AIX operating system for many years now.
Despite its reputation for being difficult to administer, it is very powerful and can perform some interesting tricks. It's helped me overcome some challenges over the years.
This article shares two interesting tricks that I discovered with Sendmail on AIX.
 

To start the Sendmail daemon, use the startsrc command. For example:

# startsrc -s sendmail -a "-bd -q30m"

The –s flag specifies the subsystem to start, and the –a flag instructs startsrc to execute the subsystem with the specified arguments.
The -bd flag starts Sendmail as a daemon (running in the background) as a Simple Mail Transfer Protocol (SMTP) mail router. The –q flag specifies the interval at which the Sendmail daemon processes saved messages in the mail queue. In this example, Sendmail will process the mail queue every 30 minutes.

To start the Sendmail daemon automatically on a reboot, uncomment the following line in the /etc/rc.tcpip file:
# vi /etc/rc.tcpip
start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"

Execute the following command to display the status of the Sendmail daemon:
# lssrc -s sendmail

To stop Sendmail, use stopsrc:
# stopsrc -s sendmail

The Sendmail configuration file is located in the /etc/mail/sendmail.cf file, and the Sendmail mail alias file is located in /etc/mail/aliases.
If you add an alias to the /etc/mail/aliases file, remember to rebuild the aliases database and run the sendmailcommand with the -bi flag or the /usr/sbin/newaliases command. This forces the Sendmail daemon to re-read the aliases file.
# sendmail -bi

To add a mail relay server (smart host) to the Sendmail configuration file, edit the /etc/mail/sendmail.cf file, modify the DS line, and refresh the daemon:
# vi /etc/mail/sendmail.cf
DSsmtpgateway.xyz.com.au
# refresh -s sendmail

To log Sendmail activity, place the following entry in the /etc/syslog.conf file, create the log file, and refresh the syslog daemon:
# grep mail /etc/syslog.conf
mail.debug  /var/log/maillog rotate time 7d files 4 compress
# touch /var/log/maillog
# refresh –s syslogd

No comments:

Post a Comment