Common Sendmail Issues

** DSN: Service unavailable**

RESOLUTION: set hostname other than localhost

Relay host :

open /etc/mail/  and configure SMART HOST to your relay and remove the dnl at the front.

vi /etc/mail/

dnl define(SMART_HOST',')dnl

make it look like :


save and exit

m4 /etc/mail/ > /etc/mail/

[ if you get this error: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4′: No such file or directory , you have to install sendmail-cf package ]

To change the From user in mails :

you will have to enable this feature first:

vi /etc/mail/

FEATURE(masquerade_envelope)dnl FEATURE(genericstable')dnl GENERICS_DOMAIN(localhost.localdomain')dnl

vi /etc/mail/genericstable root

Setup Authentication relay for Sendmail :

vi /etc/mail/access "U:USERNAME" "P:PASSWORD" "M:PLAIN"

Add following lines to /etc/mail/  ( it could be #dnl (‘SMART_HOST’,’xxx ) dnl , you have to remove the # sign at the begining :

vi /etc/mail/ define(SMART_HOST',') FEATURE(`access_db')

Update and access.db files

cd /etc/mail m4 >

IP Relay with Sendmail :

vi /etc/mail/access

Add the ip there in the format :

<ip_address to relay> RELAY

Map the new hash file :

makemap hash /etc/mail/access < /etc/mail/access

**Setting IP on which sendmail Listens : **

Go and edit /etc/mail/ in your favourite text editor (as root of course) Find the line that reads:

DAEMON_OPTIONS('Port=smtp,Addr=, Name=MTA')

Now you have two options here. You can replace with the IP address you wish to use or simply place dnl at the front of the line which will make sendmail listen on all available network interfaces. e.g:

dnl DAEMON_OPTIONS('Port=smtp,Addr=, Name=MTA')

Once this is done save the exit the editor and save the file. Then run  the following command as root:

m4 /etc/mail/ > /etc/ service sendmail restart

Check if an email is deliverable with sendmail

/usr/lib/sendmail -bv root