8

I have a Postfix/Dovecot email server which fails to deliver emails to some addresses. Here's an example of what is says:

<xxxxx@board.com.ua>: host mail.da.net.ua[91.213.154.4] said: 450
4.7.1 Client host rejected: cannot find your hostname, [128.199.39.109] 
(in reply to RCPT TO command)

Here's a relevant (I suppose) excerpt from my etc/postfix/main.cf:

smtpd_recipient_restrictions = reject_unknown_recipient_domain, 
    reject_unauth_pipelining, permit_mynetworks, 
    permit_sasl_authenticated, reject_unauth_destination

Here's a dig output for my IP:

$ dig -x 128.199.39.109

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> -x 128.199.39.109
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 61194
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;109.39.199.128.in-addr.arpa.   IN  PTR

;; AUTHORITY SECTION:
39.199.128.in-addr.arpa. 1799   IN  SOA ns1.digitalocean.com. hostmaster.39.199.128.in-addr.arpa. 1419274767 10800 3600 604800 1800

;; Query time: 127 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Tue Dec 23 19:08:05 2014
;; MSG SIZE  rcvd: 112

And for my domain name:

$ dig MX btcontract.com +short @ns1.digitalocean.com
50 mail.btcontract.com.

What's the reason for this strange behavior and how can I fix it?

src091
  • 277
  • 3
  • 4
  • 8
  • 1
    Just to clarify, since this is a problem with mail _from_ your server, your MX records and `smtpd_recipient_restrictions` don't come into the equation. – Wesley Dec 23 '14 at 18:45

1 Answers1

9

You need a PTR record that resolves 128.199.39.109 to the hostname of your sending server. Might also want to look into SPF records for your domain too.

Wesley
  • 32,690
  • 9
  • 82
  • 117
  • PTR record was my first thought, but there is one that points back to btcontract.com. They do need an SPF though. – pooter03 Dec 23 '14 at 18:29
  • 1
    @pooter03 I've just added it, it was not there before (as can be seen in my question). – src091 Dec 23 '14 at 18:37
  • 4
    You are quick on the draw. :) Try getting your SPF record setup and also send a test email to mailtest@unlocktheinbox.com It's a good [tool](https://www.unlocktheinbox.com/resources/emailauthentication/) for diagnosing issues. – pooter03 Dec 23 '14 at 18:46
  • unlocktheinbox.com does not valid anymore – Zam Feb 16 '21 at 14:10