Erratic Sendmail problems…

I’ve recently installed Drupal 6, and was having problems sending out emails (specifically for new users and password resets).
The problem was that sometimes the mail was coming through, and other times it wasn’t (it didn’t even appear in our mail server logs).
After lots of scouting around, I noticed that in /var/log/maillog (on FC6), the relay kept on changing.
On our network, we have 3 domain controllers, one of which is a mail server. Send mail was using it’s “Smart” relay to figure out where to relay the mail through, but unfortunately it kept finding whichever domain controller replied first, rather than just the mail server. This meant that sometimes, when it got the mail server, the email would come through, and other times it wouldn’t.
To fix the problem, I had to edit the “Smart” relay host in:

/etc/mail/sendmail.cf

I searched for “DS” and came across a section such as:

# "Smart" relay host (may be null)
DS

I changed this to read

# "Smart" relay host (may be null)
DSmail.domain.com

where mail.domain.com is the name of the mail server.
Then I restarted the sendmail service using:

service sendmail restart

and everything started working!

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *