Some remote SMTP server I am trying to deliver mail to refuses to accept the HELO from my server:
504 5.5.2 <localhost>: Helo command rejected: need fully-qualified hostname
Apparently, my Exim4 server sends
localhost as its FQDN. Searching the net and a bunch of config files, I have learned that the value sent as FQDN during HELO is drawn from the
primary_hostname configuration variable.
My question is: what is the correct way to change this variable in a Debian system? I guess I can simply hardcode a value in on of the Exim4 config files, but IMHO it would seem to make more sense if the value automagically corresponded to
/etc/mailname or some other centralized name config.
I have a feeling that the answer to my question can be found in this text from the Debian wiki:
The name used by Exim in EHLO/HELO is pulled from configuration option
primary_hostname. Debian's exim4 default configuration does not set
primary_hostname. Exim then defaults to uname() to find the host name. If that call only returns one component, gethostbyname() or getipnodebyname() is used to obtain the fully qualified host name.
If your Exim HELOs as localhost.localdomain, then you have most probably a misconfigured /etc/hosts created by some versions of the Debian installer. In this case, please fix your /etc/hosts.
Unfortunately, I am not familiar enough with Linux server administration to know exacly what all this means :(