In this post we are going to discuses about Sendmail Configuration and Troubleshoot method, as this sendmail service very much necessary for every system admin. This is the one of the most reliable simple mail system in UNIX. Mail service will run as two mode, either is Mail-Submission Mode or Daemon Mode. We used to add only Mail Relay on the mail configuration files. Let we can see the details of Configuration files.
|Mail Configuration files||Descriptions|
|/etc/mail||Contains all mail service configuration files|
|/etc/mail/submit.cf||Configuration file of mail when its running Mail-submission program mode. Doesn't required root privillage|
|/var/spool/clientmqueue||Contains messages that were not delivered to the sendmail daemon|
|/etc/mail/sendmail.cf||Configuration file of mail when its running daemon mode. Required root privillage|
|/var/spool/mqueue||sendmail.cf runs the main queue, /var/spool/mqueue.|
|/etc/mail/aliases||Configuration file of Mailbox aliases|
|/etc/default/sendmail||Sendmail Configuration file where we can set our required variables|
[root@unixrock ~]# ps -ef|grep -i sendmail|grep -v grep root 11209 7451 0 Nov 06 ? 0:16 /usr/lib/sendmail -bl -q15m smmsp 11208 7451 0 Nov 06 ? 0:02 /usr/lib/sendmail -Ac -q15m [root@unixrock ~]#
- -bd option is intended to set the daemon to listen on port 25 and dequeue every 15m with -q15m
- -Ac Uses submit.cf even if the operation mode does not indicate an initial mail submission.
[root@unixrock ~]# mailx -s "test messages from unixrock" email@example.com this is the test messages from unixrock EOT [root@unixrock ~]#If you not get this test mail on your inbox, please check the following. Check /var/adm/messages which relay host is pointing to. Below output shows that mail has delivered through mailhost relay server.
Nov 12 12:32:54 unixrock sendmail: [ID 801593 mail.info] rACHWsxK016004: firstname.lastname@example.org, ctladdr=root (0/0),xdelay=00:00:00, mailer=relay, pri=30142, relay=mailhost [10.223.255.45], dsn=2.0.0, stat=Sent (rACHWsK12571 Message accepted for delivery) [root@unixrock ~]#Check mail relay server in /etc/mail/submit.cf
[root@unixrock ~]# grep DS /etc/mail/submit.cf DSmailhost # Return-Receipt-To: header implies DSN request # DHParameters (only required if DSA/DH is used) [root@unixrock ~]#
[root@unixrock ~]# telnet mailhost 25 Trying 10.223.255.45... Connected to mailhost. Escape character is '^]'. 220 mailout.cwshs.com ESMTP Sendmail 8.11.6/8.11.6; Tue, 12 Nov 2013 13:41:31 -0500 ^] telnet> quit Connection to mailhost closed. [root@unixrock ~]#Thanks for reading this post, if you have any doubt please comment, i will respond you at earliest possible.