wiki:mail_troubleshooting
This is an old revision of the document!
Table of Contents
Mail troubleshooting
Error: 554 Service unavailble, No IP queries
Apr 9 11:09:08 myhostname postfix/smtpd[11535]: disconnect from unknown[92.118.38.82] Apr 9 11:09:10 myhostname postfix/smtpd[12679]: connect from mail2.protonmail.ch[185.70.40.22] Apr 9 11:09:10 myhostname postfix/smtpd[12679]: NOQUEUE: reject: RCPT from mail2.protonmail.ch[185.70.40.22]: 554 5.7.1 Service unavai lable; Client host [185.70.40.22] blocked using dbl.spamhaus.org; No IP queries, see https://www.spamhaus.org/faq/section/Spamhaus%20 DBL#279; from=<user@protonmail.com> to=<test@example.com> proto=ESMTP helo=<mail2.protonmail.ch> Apr 9 11:09:10 myhostname postfix/smtpd[12679]: disconnect from mail2.protonmail.ch[185.70.40.22] Apr 9 11:09:12 myhostname postfix/smtpd[10216]: connect from unknown[45.142.195.2]
/etc/postfix.conf
... smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_rbl_client zen.spamhaus.org, reject_rbl_client dbl.spamhaus.org ...
remove “reject_rbl_client dbl.spamhaus.org” from above
postfix check postfix reload
Error: Invalid HELO name
If you get an error like this:
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
user.name@example.org
SMTP error from remote mail server after MAIL FROM:<root@hostname.example.com> SIZE=3627:
host example.org [<someip>]: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
A python script was sending an email via exim.
Some SMTP servers require you to send a valid host name with the HELO command that also is the same as the reverse DNS of the IP address the request originates from.
To resolve this add FQDN and hostname in /etc/hosts:
root@hostname:~# cat /etc/hosts <ipaddress> subdomain.example.com subdomain # add this line 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
hostname -f should now return FQDN correctly
root@subdomain:~# hostname -f subdomain.example.com
Tested on
- Debian 7 Wheezy
- Exim version 4.80 #3 built 10-Feb-2018 15:37:27
rejected email forwardings
If you have something like this in logs:
- download
Sep 09 10:06:58 mail.private43.com postfix/smtp[361594]: C37B21408EF: to=<homer@example.org>, orig_to=<homertest321@privatemailexample.com>, relay=mailserver.example.org[xxx.xx.xxx.xx]:25, delay=6.8, delays=0.04/0.01/2.7/4, dsn=5.7.1, status=bounced (host mailserver.example.org[xxx.xx.xxx.xx] said: 554 5.7.1 This message does not meet our delivery requirements (in reply to end of DATA command)) Sep 09 10:06:58 mail.private43.com postfix/cleanup[361593]: AABA3140901: message-id=<20260909080658.AABA3140901@privatemailexample.com> Sep 09 10:06:58 mail.private43.com postfix/qmgr[322346]: AABA3140901: from=<>, size=7080, nrcpt=1 (queue active) Sep 09 10:06:58 mail.private43.com postfix/bounce[361601]: C37B21408EF: sender non-delivery notification: AABA3140901 Sep 09 10:06:58 mail.private43.com postfix/qmgr[322346]: C37B21408EF: removed Sep 09 10:06:59 mail.private43.com postfix/smtp[361598]: AABA3140901: to=<user@gmail.com>, relay=gmail-smtp-in.l.google.com[142.251.182.27]:25, delay=0.62, delays=0.04/0/0.18/0.39, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[142.251.182.27] said: 550-5.7.26 Your email has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF [] with ip: [xxx.xx.xxx.xx] = did not pass 550-5.7.26 550-5.7.26 For instructions on setting up authentication, go to 550 5.7.26 https://support.google.com/mail/answer/81126#authentication 6a1803df08f44-9104072e7a1si221877546d6.79 - gsmtp (in reply to end of DATA command))
Make sure the SPF DNS record is set up correctly and includes ip4 config specifically pointing to your mailserver eg.
"v=spf1 a ip4:xxx.xx.xxx.xx ~all"
just setting a component doesn't seem to work.
See also
References
wiki/mail_troubleshooting.1788944377.txt.gz · Last modified: by antisa
