EXIM using old hostname for HELO

Biv

Verified User
Joined
Jun 9, 2016
Messages
9
Hello,

I am having a problem with Exim. I recently changed my hostname from server1.olddomain.com to server.newdomain.com within the DirectAdmin Admin Panel. Everything is working correctly following the change. I am using SPF and DKIM and have no issues with that either.

However, when I send any emails, the HELO is incorrect when viewing the original message and is still using the old hostname:

Code:
Received: from [::1] (helo=server1.olddomain) by server.newdomain.com with esmtpa (Exim 4.87)

I have changed primary_hostname to primary_hostname = server.newdomain.com in etc/exim.conf (and removed the # so it is not a comment).

Where is Exim getting the information for HELO from? Does anyone know how I can fix this?
 
The ::1 looks to be pointing to ipv6.

Check your hostname by SSH and /etc/hosts if it's correct there.
 
Thanks for the reply Richard.

I checked and it looks like this, which I am assuming looks correct as it has the new domain there:

Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost4.localdomain4 localhost4
# Auto-generated hostname. Please do not remove this comment.
199.180.131.3 server.newddomain.com  server
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 
You're welcome Biv.

As for the hosts file, no it doesn't look correct.
I've read somewhere on the forums that only 127.0.0.1 should be named localhost and/or localhost.localdomain.
You should remove the localhost and localhost.localdomain statements from the ::1 line because that will give issues with Exim.

Ah... found it here:
http://forum.directadmin.com/showthread.php?t=53299
 
Hmm, I made those changes in /etc/hosts and it just changed ::1 to 127.0.0.1 in the Received from of the email, and the old hostname is still in there:

Before:
Code:
Received: from [::1] (helo=server1.olddomain) by server.newdomain.com with esmtpa (Exim 4.87)

After:
Code:
Received: from [127.0.0.1] (helo=server1.olddomain.com) by server.newddomain.com with esmtpa (Exim 4.87)

Any other ideas?
 
Oops, I've read wrongly, changing my reply.

Helo is taken from the hostname, check your hostname for the old hostname, the /etc/hosts and /etc/hostname and check /etc/sysconfig/network-scripts/ for the ethx running scripts, like eth0 and eth1 for presence of the old hostname.
I presume it's not present in DA anymore.

If the above won't help, I hope Zeiter or somebody else can shed their light on this, because then I'm out of idea's.

Edit: Also check your /etc/exim.conf for this line:
# primary_hostname =
if it does not contain the old hostname (should not contain any name by default).
 
Last edited:
Thanks for the reply, I checked the following files but couldn't find any instances of the old servername. And in exim.conf, I manually set the primary hostname to server.newdomain.com. I did not see any smtp_active_hostname variable at all in that file either.

This is really puzzling to me, but thanks for trying!

Code:
ifcfg-lo        ifdown-isdn    ifup-bnep   ifup-ppp
ifcfg-venet0    ifdown-post    ifup-eth    ifup-routes
ifcfg-venet0:0  ifdown-ppp     ifup-ippp   ifup-sit
ifdown          ifdown-routes  ifup-ipv6   ifup-tunnel
ifdown-bnep     ifdown-sit     ifup-isdn   ifup-wireless
ifdown-eth      ifdown-tunnel  ifup-plip   init.ipv6-global
ifdown-ippp     ifup           ifup-plusb  network-functions
ifdown-ipv6     ifup-aliases   ifup-post   network-functions-ipv6
 
Odd.
Just to be sure, which DA are you using? CB 1.2 or 2.0?
Which exim version?
Which exim.pl version?
Which exim.conf version?
 
I'm using DA 1.52.1; CB 2.0; exim version 4.87; exim.pl version 16; exim.conf version is the SpamBlocker 2.1.1 release.
 
SOLUTION to old hostname in email headers (with Roundcube)

After some more web searching, I finally figured it out! This actually has to do with the settings directly in Roundcube. It did not change here when I changed the hostname (after Roundcube was already installed). I tried checking custombuild for Roundcube settings, but it seems that Roundcube may have been installed differently on my server. Here is the solution if anyone is having this problem in the future.

SOLUTION:
Code:
nano /var/www/html/roundcube/config/config.inc.php

(or wherever your Roundcube config.inc.php file is)

Find and update $config['smtp_helo_host'] = 'server.oldname.com';

Thanks again Richard. :)
 
You're welcome. I now see why I did not find it. You put me on the wrong foot:
However, when I send any emails,
With *any* mails, you state really any mails. So I was presuming normal mail traffic via an email client, or "any" as in email client as well as webmail.
We might have found it faster if you had stated you only use webmail, or the problem only occurs on webmail. :)
But no problem, can happen to anyone, maybe you did not think of it.

I don't have any "smtp_helo_host" in roundcube's config.inc.php, there are no hardcoded things in there by default.
So I'm wondering where that line is coming from, or if it's an old Roundcube version.
I presume you have roundcube=yes in your options.conf and maybe also webapps_updates=yes?

I would suggest removing roundcube and let it build from Custombuild again so that helo host is gone there too and you have the latest version of Roundcube which does not need that.
At least... if you're running on Centos.

Some other tips:
exim.pl version 16; exim.conf version is the SpamBlocker 2.1.1 release.
This is the default exim.conf but well.... it's really very basic.
If you want life better, also better protection, it might be wise to use the newest exim.pl version 24 and Spamblocker 4.5.7 which makes life al lot easier for you.
Via eximconf=yes and exim=yes you can have both automatically updated.

Anyway I'm glad you found and fixed the issue.
 
Yes, the title of the topic was misleading as I did not think that it could be an issue with just webmail itself until later. I ran several mail tests that passed, so that was my fault. Also thanks for the other tips, DA was initially installed by my VPS host so I'm not sure how they set up everything or if they may have installed Roundcube separately.
 
I had same problem, but in this topic there was no solution, so I post one:
nano /etc/exim.variables.conf
change value after primary_hostname and restart exim
 
I had same problem, but in this topic there was no solution, so I post one:
That's not a real solution, that's a workaround which might cause to run in to possible issues later on. Also lot of hostname and exim things changed in 7 years.

If Exim is using the old hostname, then the old hostname is still present somewhere on the system or server not rebooted. It's better to investigate to root cause and fix it there.
 
Actually not. Host name is set in /etc/exim.variables.conf without any variable and it is using default host name after DA installation, so I think it is bug.
 
@qba82

In new version, (maybe) DA might handle hostname via "da build exim_conf" or "da build exim", if you change hostname, then you should rebuild exim too.
 
Actually not.
I still do think so. It is hardcoded but if this was a bug, we would see a lot of these issues here, which we don't.
So probably something went wrong with definate hostname setup or indeed Exim was not recompiled afterwards.
 
Back
Top