I can not send emails with postfix

July 20, 2014 10.7k views

I installed postfix by setting it to a website, such as mail name localhost.
I modified the php.ini file to allow it to use postfix. but when i try to use mail () does not send any email.

Jul 20 11:12:18 overflow postfix/pickup[20232]: A0E0F415CC: uid=33 from=<www-data> 
Jul 20 11:12:18 overflow postfix/cleanup[20249]: A0E0F415CC: message-id=<20140720151218.A0E0F415CC@overflow.system> 
Jul 20 11:12:18 overflow postfix/qmgr[20233]: A0E0F415CC: from=<www-data@overflow.system>, size=422, nrcpt=1 (queue active) 
Jul 20 11:12:18 overflow postfix/pickup[20232]: A38B8415CD: uid=33 from=<webmaster@example.com> 
Jul 20 11:12:18 overflow postfix/cleanup[20249]: A38B8415CD: message-id=<20140720151218.A38B8415CD@overflow.system> 
Jul 20 11:12:18 overflow postfix/qmgr[20233]: A38B8415CD: from=<webmaster@example.com>, size=368, nrcpt=1 (queue active) 
Jul 20 11:12:18 overflow postfix/smtp[20254]: A0E0F415CC: host mx01.gmx.com[74.208.5.27] refused to talk to me: 554-gmx.net (mxgmxus003) Nemesis ESMTP Service not available 554-No SMTP service 554 invalid DNS PTR resource record 
Jul 20 11:12:19 overflow postfix/smtp[20255]: A38B8415CD: host mx01.gmx.com[74.208.5.27] refused to talk to me: 554-gmx.net (mxgmxus002) Nemesis ESMTP Service not available 554-No SMTP service 554 invalid DNS PTR resource record 
Jul 20 11:12:19 overflow postfix/smtp[20254]: A0E0F415CC: to=<marcoferraioli@programmer.net>, relay=mx00.gmx.com[74.208.5.4]:25, delay=0.55, delays=0/0/0.55/0, dsn=4.0.0, status=deferred (host mx00.gmx.com[74.208.5.4] refused to talk to me: 554-gmx.net (mxgmxus002) Nemesis ESMTP Service not available 554-No SMTP service 554 invalid DNS PTR resource record) 
Jul 20 11:12:19 overflow postfix/smtp[20255]: A38B8415CD: to=<marcoferraioli@programmer.net>, relay=mx00.gmx.com[74.208.5.4]:25, delay=0.67, delays=0/0/0.66/0, dsn=4.0.0, status=deferred (host mx00.gmx.com[74.208.5.4] refused to talk to me: 554-gmx.net (mxgmxus001) Nemesis ESMTP Service not available 554-No SMTP service 554 invalid DNS PTR resource record)

this is what comes out from the logs. I can not understand the error shown.

2 Answers

The reason for the "554-No SMTP service 554 invalid DNS PTR resource record" error is reverse DNS is not working for your Digital Ocean droplet, so the mailserver receiving the email cannot validate who you are.

Usually the cause of this is your droplet is not named after the FQDN (fully qualified domain name) of your host. Eg mail.mydomain.com or myserver.mydomain.com

To resolve this please do the following:

  1. Log into digital ocean account
  2. Click droplets
  3. Click the droplet with the problem
  4. Click settings
  5. Click rename
  6. Enter your FQDN
  7. Click rename

You may need to allow some time for DNS to propagate but once thats done your email should be OK.

What the error is saying is that it's actually trying to send the mail but that the recipient's mailserver is refusing to accept it. You also get an explanation as to why it happens:

invalid DNS PTR resource record.

In order to resolve this issue, you need to add an MX record to example.com which points to your server. In case you don't own example.com, then change it to webmaster@your-real-domain.tld while still adding an MX record that points to your server.

Have another answer? Share your knowledge.