Wednesday 9 March 2011

How to configure send Mail or smtp in AIX

In this post I am going to explain how to configure a mail server in AIX because several times we need to receive mails from a server on completion of some script or for mailing regular reports about health of server to our mailbox.However I am gonna assume here that your mailbox is allowed to receive mail from the mail server and there is no issue of firewall and all.In such a case it's very simple.
1)Ping the mail server first of all to check there is no connectivity issue in between and the mail server and our server can talk to each other i.e if you want to configure mail server abc or smtp on server named xyz then first of all issue ping abc from server xyz aftrer loging into it to check for proper connectivity between two.
2)If step goes successful then we can move forward else you need to check with your networking team.Now open file /etc/sendmail.cf i.e vi /etc/sendmail.cf
3)In this file go to escape mode and search for pattern DS by pressing escape key and then enter /DS and again followed by enter.
4)Now After hitting enter once above press n to move to next occurrence in the file for the pattern.You will find something like DS only as written there.
5)Now put the name of the mail server after this DS like if our mail server here is abc then insert the entry like DSabc and save and exit.
6)Now we need to refresh the send mail daemon(thread).
7)So First check for the current condition of sendmail thread by
lssrc -s sendmail,it should display the state for the thread as active.
8)Refresh the daemon by
refresh -s sendmail
9)This completes your mail server installation,so now check by dropping a dummy mail to your mailbox.
10)You can send a dummy mail by following command.
mail -s "SYSTEM REPORT" -r abc.com mymailbox@asd.com < /etc/motd
where system report denotes subject of mail,abc.com denotes name of sender, mymailbox@asd.com denotes name of recipient and /etc/motd denotes matter of email.Refresh your mailbox to receive it.

This is a standard method to configure mail server in a company environment when mail server and our server are in customized domain.

No comments:

Post a Comment