550 Bad Helo - Impersonating hostname

INDABATH

New member
Joined
Jan 30, 2017
Messages
3
Hi,

I have trawled through the forums and google but cannot seem to find what I am looking for, I may just be dumb.

I have my server, indabath.eu, which is hosting my friends domain. My friend's website is hosted on a different cloud server by another company, with a different IP. He keeps all his emails and so on with my server. When I try to use the STMP mail function on his website, the logs give the error:

Code:
2017-10-13 10:46:45	SERVER -> CLIENT: 550 Bad HELO - Host impersonating domain name 
2017-10-13 10:46:45	SMTP ERROR: EHLO command failed: 550 Bad HELO - Host impersonating domain name 
2017-10-13 10:46:45	CLIENT -> SERVER: HELO myfriendsdomain.com
2017-10-13 10:46:45	SMTP -> get_lines(): $data is ""
2017-10-13 10:46:45	SMTP -> get_lines(): $str is  "550 Bad HELO - Host impersonating domain name

Can someone point me in the right direction? How can I allow the external IP address to connect with my mail server?

Thank you in advance.
 
Hello,

In order to solve the issue, you can:

1. either try and configure scripts of myfriendsdomain.com to use different HELO/EHLO. If your PHP application uses PHPMailer class for sending emails you can check the following lines:


PHP:
    /**
     * The hostname to use in the Message-ID header and as default HELO string.
     * If empty, PHPMailer attempts to find one with, in order,
     * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
     * 'localhost.localdomain'.
     * 
     * @var string
     */
    public $Hostname = '';

or

PHP:
    /**
     * The SMTP HELO of the message.
     * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
     * one with the same method described above for $Hostname.
     *
     * @see PHPMailer::$Hostname
     *
     * @var string
     */
    public $Helo = '';
https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php

So you need to set $Hostname or $Helo to something different, for example: server.myfriendsdomain.com or www.myfriendsdomain.com

2. or whitelist the IP of the cloud server on Directadmin server's side and add it to relay_hosts either in /etc/exim.conf (if you don't keep it updated), or in /etc/exim.variables.conf.custom
Code:
hostlist relay_hosts=1.2.3.4.5

and run ./build exim_conf (please be careful if you have modified exim.conf directly).
 
Resolved

Hi Alex,

Once again you have saved my ass sir. I used your method of adding hostlist relay_hosts=1.2.3.4.5, but not quite as you described.

I had to create /etc/exim.variables.conf.custom, but when I added it still no joy
I added it directly to exim.conf, but ran ./build exim.conf, it vanished
But I looked at /etc/exim.variables.conf and the hostlist relay_hosts=1.2.3.4.5 had appeared there. Once I saved it an reloaded exim the emails from the other server started working.

I am not sure if the above will cause issues but I am happy it is working. I am due time to load some hours with you at Poralix for server maintenance. I have been broke for sometime now due to getting married. I'll get that sorted in a couple of weeks. Thanks again.
 
That's correct, every time when you change /etc/exim.variables.conf.custom you need to run ./build exim_conf for changes to take effect.

Please be careful as the whitelisted host can use your server as open relay with this, i.e. send emails to the world without restrictions via your server.

If the cloud server is trusted, then you OK here.

You're always welcome. And please accept my congratulations and best wishes on your marriage ;)
 
Back
Top