■ OS Environment : Linux, RHEL, Centos
■ Implementation Steps :
1. edit /etc/mail/sendmail.mc & add this line :
3. Rebuild the sendmail.cf :
$ m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
$ /etc/rc.d/init.d/sendmail restart
5. Now send mail and check the maillog. Log will show relay name.
sendmail without DNS :
There are a number of steps required to successfully use sendmail when there is limited or no DNS.
1. I assume that domain is resolvable, either by /etc/hosts or DNS, or alternatively we can specify an IP address.
2. Set realy host in /etc/mail/sendmail.mc ie define(`SMART_HOST',`name.of.smart.host')dnl
3. Since the system implicitly have limited resolving capabilities, accept email for unknown domains so use line in /etc/mail/sendmail.mc of the form
4. We have to make it sure that the ServiceSwitchFile (by default at /etc/mail/service.switch) has content similar to:
5. Setting the submission agent to ignore DNS. Use line in /etc/mail/submit.mc of the form
6. Use line in /etc/mail/submit.mc of the form
7. Execute :
$m4 /etc/mail/submit.mc > /etc/mail/submit.cf
6.service sendmail restart