postfix mail bounces back with 5.0.0

Julius Junghans asked:

im trying to setup posfix so i can send emails with a “free” domain name from http://freedns.afraid.org/.
i can receive mails alright, but sending is a different story…the mail bounces back with status: 5.0.0.

under mynetworks is 6.6.6.6 listed, this is the actual server ip…but the hoster (hetzner.de) adds another ip (1.2.3.4) to the system that is reachable via the internet.
The first one is not.
i cant set a MX record for the host but as far as i read that is not needed.

this is the information to show you whats going on, please tell me if i missed important bits.

i replaced these values:
server ip: 1.2.3.4
dns name: somedomainname.strangled.net
target email: [email protected]
username: myuser

yes myuser is the system user and also part of the target / destination email.

when i send a mail like this:

echo "This is the body" | mutt -s "Testing mutt" [email protected]

this shows up int the log

Feb 18 15:37:44 andromeda postfix/pickup[6781]: 1EE9FC05B3: uid=1000   from=<myuser>
Feb 18 15:37:44 andromeda postfix/cleanup[6920]: 1EE9FC05B3: message-id=<[email protected]>
Feb 18 15:37:44 andromeda postfix/qmgr[6134]: 1EE9FC05B3: from=<[email protected]>, size=477, nrcpt=1 (queue active)
Feb 18 15:37:44 andromeda postfix/error[6922]: 1EE9FC05B3:  to=<[email protected]>, relay=none, delay=0.07, delays=0.05/0.01/0/0.02,   dsn=5.0.0, status=bounced (mail.de)
Feb 18 15:37:44 andromeda postfix/cleanup[6920]: 2B2BAC090C: message-id=<[email protected]>
Feb 18 15:37:44 andromeda postfix/qmgr[6134]: 2B2BAC090C: from=<>, size=2360, nrcpt=1 (queue active)
Feb 18 15:37:44 andromeda postfix/bounce[6923]: 1EE9FC05B3: sender non-delivery notification: 2B2BAC090C
Feb 18 15:37:44 andromeda postfix/qmgr[6134]: 1EE9FC05B3: removed
Feb 18 15:37:44 andromeda postfix/local[6925]: 2B2BAC090C: to=<[email protected]>, relay=local, delay=0.03, delays=0.01/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Feb 18 15:37:44 andromeda postfix/qmgr[6134]: 2B2BAC090C: removed

and this is what mail.de replys, as you can see: Status: 5.0.0

[-- Attachment #2: Delivery report --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; somedomainname.strangled.net
X-Postfix-Queue-ID: 1EE9FC05B3
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Sat, 18 Feb 2017 15:37:44 +0100 (CET)

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; mail.de

dns lookup

dig somedomainname.strangled.net

; <<>> DiG 9.10.3-P4-Debian <<>> somedomainname.strangled.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17662
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1460
;; QUESTION SECTION:
;somedomainname.strangled.net. IN  A

;; ANSWER SECTION:
somedomainname.strangled.net. 3600 IN  A   1.2.3.4

;; Query time: 176 msec 
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Sat Feb 18 15:42:20 CET 2017
;; MSG SIZE  rcvd: 95

revers dns

dig -x 1.2.3.4

; <<>> DiG 9.10.3-P4-Debian <<>> -x 1.2.3.4
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44643
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1460
;; QUESTION SECTION:
;4.3.2.1.in-addr.arpa.    IN  PTR

;; ANSWER SECTION:
4.3.2.1.in-addr.arpa. 43200 IN    PTR somedomainname.strangled.net.

;; Query time: 41 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Sat Feb 18 15:44:44 CET 2017
;; MSG SIZE  rcvd: 94

/etc/mailname:
somedomainname.strangled.net.

postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
bounce_notice_recipient = myuse[email protected]
default_transport = error
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = ${myhostname} localhost.localdomain, localhost
mydomain = strangled.net
myhostname = mickeymouse.${mydomain}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 6.6.6.6/32
myorigin = $myhostname
readme_directory = no
recipient_delimiter = +
relay_transport = error
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail/
virtual_mailbox_domains = andromeda
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000

any idea what i missed?

My answer:


The destination mail server (for mail.de) has chosen not to disclose the reason it rejected the mail. That reason should normally appear in the Diagnostic-Code line, but here they have replaced it with garbage.

You can guess that they reject mail from freedns hosted domains, which is a reasonable thing to do. But to be 100% sure of the reason for rejection, you will need to contact the postmaster for that domain and hope that they choose to tell you why it was rejected.


View the full question and any other answers on Server Fault.

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