Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Where does an ubuntu machine get the default domain to append to users when sending mail? Ours is currently sending as, while /etc/mailname has set. Should this not be sending as I'm using exim4, and I've dpkg-reconfigure'd it so that the system mail name, and the visible domain name are both set to

--edited to include mailserver--

share|improve this question
What mail server are you using? – Bill Weiss Jul 6 '09 at 20:50
up vote 2 down vote accepted

In the default configuration on an Ubuntu / Debian box, the contents of /etc/mailname is used. It can, of course, be overridden in the actual config file for exim, postfix, etc.

share|improve this answer
D'oh, sorry. Just noticed that you specifically referenced /etc/mailname. – Insyte Jul 6 '09 at 21:19
my /etc/mailname says, and I've dpkg-reconfigure'd exim4-config, so that the system mail name, and visible domain name are both set to But my email is still showing up as coming from Anywhere else it could be set? – Cian Jul 6 '09 at 21:27
Well, there's the possible solution mentioned in this bug report: Unfortunately, I'm not that familiar with exim, so I can't be much use other than to say: I just did a fresh install of exim4 on an Ubuntu 8.04 box and /etc/mailname was used appropriately. – Insyte Jul 6 '09 at 22:12
(After a dpkg-reconfigure exim4-config, of course.) – Insyte Jul 6 '09 at 22:13
After checking this again, it appears mutt reads /etc/mailname, minus everything before the first . Exim itself reads /etc/mailname itself. – Cian Sep 20 '09 at 1:14

Most mail servers will chop off the first part of the mail server name (i.e. pop, pop3, smtp, imap, mail) to get what it should put after the @ sign in the email address.

Without knowing the email server you are using, it is hard to give a recommendation on how to change this. I assume a form of Linux, but you should really give more detail.

share|improve this answer
It appears this is correct. It seems to read /etc/mailname, and then chop off everything up to the first dot to get the domain for users mail addresses. – Cian Jul 6 '09 at 22:12

Just to be on the safe side - you haven't accidentally set a mail address for the user in /etc/email-addresses?

share|improve this answer
Nope. Don't have any such file. – Cian Jul 6 '09 at 22:07

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.