PHP, Networking or Postfix missconfiguration? Mail is received by unknown

Keenora Fluffball asked:

I do have a problem which nearly freaks me out. Ok, I do have the following constellation:

There is a Webserver, with the public IPs:

  • 111.111.111.139
  • 111.111.111.140
  • 111.111.111.141
  • 111.111.111.142

I do have 100 different domains, which are seperated by two providers. All of them, except one are pointing to the .140 address. Their MX records are are showing to two different mail servers. One is configured automatically by the provider and for the rest it goes to one domain which is pointing to a internal mail server in my company. That mailserver works perfectly and I can send emails to whereever I want.

Now I do have a script on the webserver. It is a PHP script, and PHP is configured that it uses the localhost with the smtp port set right. mxtoolbox and mailradar have positive results.

When I send mails from this PHP script, lets say to some mail addresses, where they do a reverse DNS PTR check, i get errors like:

Mar 17 21:55:13 *************** postfix/smtp[23695]: **********: host mx00.gmx.net[213.165.67.99] refused to talk to me: 554-gmx.net (mxgmx004) Nemesis ESMTP Service not available 554-No SMTP service 554 invalid DNS PTR resource record

And of course, the mails are not be sent correctly. When I send a mail to a server, which is not checking the reverse DNS I receive the mail with the following header:

Received: (qmail 27829 invoked from network); 19 Mar 2013 13:10:48 +0100
Received: from unknown (HELO ****************) (111.111.111.142)
  by ******************* with SMTP; 19 Mar 2013 13:10:48 +0100
Received: by ************ (Postfix, from userid 0)
    id ************; Tue, 19 Mar 2013 13:07:49 +0100 (CET)
Subject: This is subject
To: <someprivatemail@provider.de>
X-Mailer: mail (GNU Mailutils 2.2)
Message-Id: <20130319120749.872613D674B@*****************>
Date: Tue, 19 Mar 2013 13:07:49 +0100 (CET)
From: root@*************** (root)

This is Content

I see, it says, “from unknown” in the received part. The question is now, who or what is responsible for this? Is it the webserver, where I need to change something in the postfix configuration? Is it the provider for the domains, where I have to set any additional addresses or maybe change anything? Or is it the isp, who has to be active here and change…whatever he can change?

I somehow assume, that its Postfix, but I dont know, what to change there. This is my configuration:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = *************
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = *************, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

My answer:


You need to set reverse DNS (PTR) records for your IP address(es). Contact the entity that assigned the IP addresses to you.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.