dpkg-reconfigure exim4-config asks for a domain name to "qualify" email addresses of local users such as root. Let's say I've set this setting to qualified.example.com - this causes all email sent to simply root to go to [email protected].

I instead want all email to root to be sent to [email protected], but I want the qualified domain name setting left set to qualified.example.com for other reasons.

I've added this line to /etc/aliases

root: [email protected]

And I've also put [email protected] in /root/.forward

I've run newaliases and restarted exim, but no matter what I do, mail to root continues to always try to send to [email protected], which doesn't even exist.

How can I force email to root to go to [email protected]?

This is on Ubuntu Server 14.04

My /etc/exim4/update-exim4.conf.conf looks like this:


When I ran dpkg-reconfigure exim4-config I answered the qualified domain question like so:

The 'mail name' is the domain name used to 'qualify' mail addresses without a domain name.                  

This name will also be used by other programs. It should be the single, fully qualified domain name (FQDN). 

Thus, if a mail address on the local host is [email protected], the correct value for this option would be    

This name won't appear on From: lines of outgoing messages if rewriting is enabled.                         

System mail name:                                                                                           


Although that setting doesn't appear in /etc/exim4/update-exim4.conf.conf. Should it?

I've noticed that the same issue happens on my Debian servers too. I must be completely misunderstanding something about Exim and/or the /etc/aliases file, because they all seem to ignore my /etc/aliases root: [email protected] entry and they always send root's mail to [email protected] no matter what I try. It also seems odd that a simple forwarding rule is so dependent on the mail servers main configuration?

  • 1
    Please could you include a copy of your /etc/exim4/update-exim4.conf.conf in your question, and also indicate if you have edited any other configuration file in the /etc/exim4 directory. I suspect you've simply omitted to tell your local server that it itself is qualified.example.com, but when I see your update-exim4.conf.conf I'll be able to confirm that. Commented Oct 9, 2015 at 21:19
  • Hi @roaima ... I've added more details as requested. Thanks.
    – LaVache
    Commented Oct 10, 2015 at 6:27
  • those settings are stored in /etc/default/exim4
    – Jasen
    Commented Oct 10, 2015 at 9:17

2 Answers 2


Your host doesn't sufficiently know that it is supposed to be qualified.example.com. A local delivery to root is rewritten as [email protected], which is (wrongly) considered to be elsewhere, so an off-host delivery is attempted.

You need to complete the process telling exim4 that your local host really is qualified.example.com. Then, when it delivers to root, rewritten as [email protected] it will consider this as local delivery. It will then check the /etc/aliases file and perform off-host delivery to [email protected] per your instructions.

Let's assume your host's real DNS name is myhost.contoso.com. Rerun dpkg-reconfigure exim4-config and include these settings:

  • System mail name: myhost.contoso.com
  • Other destinations for which [local] mail is accepted: myhost : qualified.example.com
  • Domains to relay mail for: {empty}
  • Machines to relay mail for: {empty}

Then run update-exim4.conf and invoke-rc.d exim4 restart

  • Hey thanks for your help on this. This did solve the issue on a Debian server, but in the end this problem on the Ubuntu server seemed to be caused by VestaCP, so I should have mentioned that I was running that. For anyone else with the same problem running VestaCP, you need to add your version of "qualified.example.com" as a mail domain in the VestaCP control panel for some reason, otherwise root's forwarding won't work and gives the following error in the Exim mainlog: remote host address is the local host
    – LaVache
    Commented Oct 11, 2015 at 6:43
  • Also good to know: Exim4 does not use /etc/hosts to determine which domain maps to localhost. It really only uses the domains entered by the question Other destinations for which mail is accepted:. Commented Nov 14, 2023 at 22:41

Although that setting doesn't appear in /etc/exim4/update-exim4.conf.conf. Should it?

That setting goes to /etc/mailname file. As long as the first (and only) line of /etc/mailname matches your /etc/hosts, it will be considered as a local delivery. E.g. you wanna use qualified.example.com, so you should have it in your /etc/mailname file and it should also be defined in /etc/hosts file, like: qualified.example.com. Be sure to define the same for ipv6 in your hosts file (or disable ipv6 for exim if you don't use it).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .