Which hostname is exim sending ?
One can find the HELO name in exim4's logs. Stop the exim4 daemon, then restart it manually with debugging enabled :
/usr/sbin/exim4 -bd -d+all 2>&1 | egrep 'HELO|EHLO'
(the 2>&1|egrep 'HELO|EHLO'
part is optional, it just redirects stderr to stdout, then pipe the log to egrep
, which will filter everything but lines containing HELO or EHLO).
Send an email and there should be one or two lines in the following form :
SMTP>> EHLO foobar.example.com
The HELO name is foobar.example.com
.
There are also several useful online checking tools which provide this information (and many useful others), e.g. :
- https://www.mail-tester.com (beware, only 3 free email checks per day) ;
- check-auth@verifier.port25.com (free) ;
- mailtest@unlocktheinbox.com (most of its feedback is not free, but for this purpose it is).
How do I change it ?
Instead of editing the transport file as suggested by David, I'd rather use exim4 constant definitions (?) and set the name in /etc/exim4/conf.d/main/00_local_settings
(in split configuration), e.g. :
REMOTE_SMTP_HELO_DATA=$sender_address_domain
Don't forget to run update-exim4.conf
before to restart exim4.
I set primary_hostname […] in /etc/exim4/exim4.conf.template
As mentioned by David, this is probably not the best idea. In split configuration, you can set the primary hostname by adding
MAIN_HARDCODE_PRIMARY_HOSTNAME = subdomain.example.com
in /etc/exim4/conf.d/main/00_local_settings
. It seems it would be PRIMARY_HOST_NAME
in monolithic exim4 configuration.