Postfix: bouncing mail (reverse DNS issue)

emailemail-bouncesemail-serverpostfixreverse-dns

I have a problem with Postfix. I get this with some email address:

to=<mail@domain.tld>, relay=mail.domain.tld[IP_ADDRESS]:25, delay=3, delays=0/0/2.5/0.52, dsn=5.7.1, status=bounced (host mail.domain.tld[IP_ADDRESS] said: 550 5.7.1 <mail@domain.tld>... Fix reverse DNS for MY_SERVER_IP_ADDRESS,or use your ISP server (in reply to RCPT TO command))

I read something and it should be related to my HELO/EHLO hostname. Postfix runs on the same server of the script sending mails, same IP address.
When I type hostname -f ubuntu returns "localhost". But in /etc/hostname I have "domain.tld" (one of my domains).

Here's my main.cf file:

### Postfix SMTP Server
myhostname = $mydomain
mydomain = domain.tld
myorigin = $mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_banner = $myhostname ESMTP $mail_name (multiformeingegno)
biff = no
append_dot_mydomain = no
readme_directory = no
relayhost = 
inet_interfaces = all
local_transport = error:local delivery is disabled

mydestination = domain.tld, localhost.domain.tld, localhost
mynetworks = 127.0.0.0/8 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all

Best Answer

Assume your mail server name is multiformeingegno.it (myhostname value in postfix) and your server has two IPs 1.2.3.4 and 1.2.3.5 and you are sending a mail from user@otherdomain.tld, setting up all the following is always recommended.

  • A record of multiformeingegno.it pointing to 1.2.3.4 and 1.2.3.5
  • PTR record for 1.2.3.4 and 1.2.3.5 pointing to multiformeingegno.it
  • SPF record for otherdomain.tld should include both 1.2.3.4 and 1.2.3.5
  • otherdomain.tld should have proper MX record or a A record

Hope that was clear. To clarify you one more thing, your system's name has nothing to do here.

Related Topic