Mails from my system are being rejected when the receiving server does HELO checking. I believe my system is sending the wrong domain name. I'm running exim4. Googling for anything about exim4 and domains yields a nightmarish list of irrelevant results. Similarly, googling for HELO rejections yields a horde of outlook users who need to turn on SMTP authentication. I cannot for the life of me figure out this simple question: which hostname is exim sending and how do I change it?
Unfortunately, I can't watch what exim is sending over the wire, so I have no way to debug this myself. I'm hoping someone has had this problem and just knows :).
Assuming the error is complaining about the HELO/EHLO data, you want to use the helo_data option on the smtp transport. The default is $primary_hostname.
More information is available in the manual.
If this isn't the case, you probably want to include some example rejection messages. Just the three digit code and the string after that.
The command
should prompt you for the primary hostname to use.
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 :
(the
2>&1|egrep 'HELO|EHLO'
part is optional, it just redirects stderr to stdout, then pipe the log toegrep
, 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 :
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. :
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. :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
in
/etc/exim4/conf.d/main/00_local_settings
. It seems it would bePRIMARY_HOST_NAME
in monolithic exim4 configuration.On Debian (Lenny) I found that you set hostname in
/etc/hostname
but that this is not recognised until reboot.sets it right away (but is lost on reboot, so you have to do the two).
exim4 seems to report the same as
uname -n
, and I found that a useful way to test.The setting you want is called primary_hostname.
For debugging you can use
to watch SMTP traffic in ASCII.