1

When sending emails, I receive undelivered mail with the following message "Recipient address rejected: Invalid HELO/EHLO; Must be a FQDN or an address literal, not 'xxx' 554 5.7.1" from certain webservers (where xxx is the name of my VPS).

I checked the logs but didn't find anything suspicious.

The postfix configuration is as follows (should be fairly default):

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = vm19243
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
myorigin = /etc/mailname
mydestination = vm19243, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
inet_protocols = all
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf
smtpd_tls_security_level = may
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipi$
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf

I tried playing around with different "smtpd_relay_restrictions" setups but to no avail.

I have also checked the spam blacklists but the IP does not seem to be blacklisted (according to mxtoolbox.com).

I welcome any suggestions!

Running on Debian 8.6, postfix version 2.11.3

Kraken
  • 113
  • 1
  • 3

1 Answers1

1

Either change myhostname to include the domain (must exist as a register on the dns server of that domain and be accesible publicly) or leave myhostname as is and force the helo with the public domain by using smtp_helo_name

So it could be

myhostname = vm19243.domain.com

Or it could be

myhostname = vm19243

smtp_helo_name = mail.domain.com

NuTTyX
  • 1,168
  • 5
  • 10
  • Thank you, that indeed seems to fix the problem for one of the domains but what if I have more than one domain? For example I might have smtp_helo_name = mx.domainA.com, how do I add additional domain names such as mx.domainB.com etc.? Chaining them with comma doesn't seem to work (smtp_helo_name = mx.domainA.com, mx.domainB.com). – Kraken Nov 02 '16 at 23:16
  • To my knowledge there is no way to change that (you can also put that configuration in master.cf, but I don't think it would help at all). Let's think about the other possibility: specifying an IP address between brackets `[123.123.123.123]`. I'm not sure if some server might complain if there is no PTR record to match that IP to some name. Just try to have a "default" one. It's not really a big deal and most enterprises use Google or Microsoft servers for their mail: you can check that their mail have headers from their "hosting" companies. Just make sure to have SPF records up to date. – NuTTyX Nov 02 '16 at 23:40
  • Switching the domain name for the IP address seems to have done the trick, thank you very much! – Kraken Nov 06 '16 at 19:57