Blog emailing problem fixed

Hi Reader,

Minor update for users who have had trouble receiving email from the server. This has affected some users who want to participate in the forum but never received their registration emails. This is not a mooshimeter-related blog entry, but I’m writing it down in case it helps someone.


Some users on were not receiving registration and password reset emails.


Checking /var/log/maillog, I found many lines like the below.

Nov 30 17:42:24 ip-10-220-151-250 sendmail[12078]: uASLHwiA010761: to=<xxx@user.domain>, ctladdr=<> (48/48), delay=1+20:24:26, xdelay=00:00:01, mailer=esmtp, pri=4441319, relay=user.relay., dsn=4.0.0, stat=Deferred: 450 4.1.8 <>: Sender address rejected: Domain not found

Certain mail servers are rejecting mail from sendmail because they can’t find a DNS record associated with the sender’s domain. is hosted on an Amazon EC2 instance, and in this case, the sender’s domain is Amazon’s default, “”. I never changed it when setting up the web server.  Whoops.


Changing the server’s hostname is straightforward enough since I have a static IP address.  It was a matter of editing the “HOSTNAME” line in /etc/sysconfig/network and rebooting.  Your situation might be a little different, so check here.

However this created another problem.  The webserver also sends a lot of mail to email addresses, which are hosted through Gmail.  Since I changed the hostname to, sendmail was treating all email addresses on the domain as usernames and trying to send them locally, resulting in “User unknown” errors.  To get around this, I had to force sendmail to defer to the public MX records whenever it sends mail to  I used the solution from this page, adding:

to the bottom of /etc/mail/ and restarting sendmail
sudo /etc/mail/make
sudo service sendmail restart

And that was that.  Hope someone finds this helpful.


No comments yet.

Leave a Reply

This site is protected by reCaptcha and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.