Page 1 of 1

The EHCP force, Invalid HELO Name Email Bug.

Posted: Wed Dec 10, 2025 11:49 pm
by Rob Swan
Impact Level: MEDIUM

Fix Found: YES

Fix Complexity: EASY

Bug Description
When you send an email it bounces back, with the error “Invalid HELO Name” or “Invalid EHLO Name”.

Symptom
You are unable to send emails to certain people as they just bounce back, this is due to a bug in the EHCP force setup routine that sets the postfix myhostname option to your server name, this needs to be an FQDM (Fully Qualified Domain Name), such as mail.mydomain.com.

The Fix
Connect to you server using PuTTY and issue these commands to set the myhostname setting in postfix, replacing MyDomain.co.uk with your actual domain name.

sudo postconf -e "myhostname = mail.MyDomain.co.uk"
sudo service postfix restart

Your email system should now be fixed.

On a final note, if you find that you are no longer receiving system emails, issue these commands in PuTTY, replacing MyDomain.co.uk with your actual domain name (Assuming that admin@MyDomain.co.uk, is the actual email address you used, for system emails).

sudo su
sed -i 's/@/@mail./' /etc/postfix/canonical
echo '@mail.MyDomain.co.uk admin@MyDomain.co.uk' >> /etc/postfix/canonical
postmap /etc/postfix/canonical
service postfix restart
exit

It is important that the commands above, are only ever run once.

So, just to clarify, your file /etc/postfix/canonical, should contain something like this, with email addresses and a computer name (server name) that match your setup (In the example web-server is the computer name).

@mail.web-server   admin@MyDomain.co.uk
@mail.MyDomain.co.uk   admin@MyDomain.co.uk

Note: Whenever you make changes to the /etc/postfix/canonical file, you must run sudo postmap /etc/postfix/canonical and then sudo service postfix restart in PuTTY, otherwise your changes will be ignored.

For more information on this, please see my blog.