Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 :).

share|improve this question
up vote 14 down vote accepted

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.

    driver = smtp
    helo_data =

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.

share|improve this answer
Thanks! After 10 more minutes of reading about how to even change an exim4 setting on a debian-based system, I set primary_hostname to the FQDN in /etc/exim4/exim4.conf.template and restarted exim4. That did the trick! My hostname is different from the FQDN and I am not using minimal_dns, thus the original problem. Plus, only by modifying your manual link was I able to even find the docs on primary_hostname (exim is so google-trashed!). Thanks again! – user10066 Jun 19 '09 at 8:43
You probably don't want to update that file. I would recommend running update-exim4.conf --keepcomments and then copy /var/lib/exim4/config.autogenerated to /etc/exim4/exim4.conf and then modify that file. – David Pashley Jun 19 '09 at 13:19

The command

sudo dpkg-reconfigure exim4-config

should prompt you for the primary hostname to use.

share|improve this answer

On Debian (Lenny) I found that you set hostname in /etc/hostname but that this is not recognised until reboot.

$ hostname newhostname

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.

share|improve this answer

The setting you want is called primary_hostname.

For debugging you can use

tcpdump -A port 25

to watch SMTP traffic in ASCII.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.