primary_hostname and unrouteable address

uadm

Well-Known Member
May 19, 2003
107
0
166
Hi,

We set the primary_hostname in exim advanced editor to the name of the main domain on the server and that domain started to get "Unrouteable address" errors for all it's mailboxes and forwarders. Once we removed primary_hostname from the config the problem resolved.

Is there a way to set primary_hostname and having the email to that domain to work?

and a side question: Why would setting this config make the mails to this domain fail?

Thanks
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
Where exactly in the the advanced editor did you modify this? There are several places this is noted. If you modified this by setting the Primary Hostname in Add additional configuration setting, it is important to understand that this needs to be the hostname of the server. This is detailed when selecting the setting:
This specifies the name of the current host. It is used in the default EHLO or HELO command for outgoing SMTP messages (changeable via the helo_data option in the smtp transport), and as the default for qualify_domain. The value is also used by default in some SMTP response messages from an Exim server. This can be changed dynamically by setting smtp_active_hostname.

If primary_hostname is not set, Exim calls uname() to find the host name. If this fails, Exim panics and dies. If the name returned by uname() contains only one component, Exim passes it to gethostbyname() (or getipnodebyname() when available) in order to obtain the fully qualified version. The variable $primary_hostname contains the host name, whether set explicitly by this option, or defaulted.
What exactly is the end goal you're looking to achieve here?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
Setting primary_hostname in the exim configuration is not going to change the behavior of mail being sent from the hostname when the system sends the email. All other outgoing mail from the server, would come from whatever domain you sent it from.

I don't believe there is a way to change this, there's even a feature request for this here: https://features.cpanel.net/topic/ability-to-specify-system-notification-email-address.
 

cPanelChris

Moderator
Staff member
Feb 16, 2020
38
6
8
Houston, TX
cPanel Access Level
Root Administrator
Hello @uadm ,

Per the Exim documentation, primary_hostname should be set to the fully qualified hostname of the server if uncommented. I would advise against changing this setting.
 

uadm

Well-Known Member
May 19, 2003
107
0
166
Thanks Chris,

As per exim documentation we set qualify_domain instead and it works great.