Where does an ubuntu machine get the default domain to append to users when sending mail? Ours is currently sending as user@example.com, while /etc/mailname has mail.example.com set. Should this not be sending as user@mail.example.com? 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 mail.example.com.

--edited to include mailserver--

  • What mail server are you using? – Bill Weiss Jul 6 '09 at 20:50

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.

  • D'oh, sorry. Just noticed that you specifically referenced /etc/mailname. – Insyte Jul 6 '09 at 21:19
  • my /etc/mailname says mail.example.com, and I've dpkg-reconfigure'd exim4-config, so that the system mail name, and visible domain name are both set to mail.example.com. But my email is still showing up as coming from user@example.com. Anywhere else it could be set? – Cian Jul 6 '09 at 21:27
  • Well, there's the possible solution mentioned in this bug report: bugs.launchpad.net/ubuntu/+source/exim4/+bug/49776 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.

  • 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?

  • Nope. Don't have any such file. – Cian Jul 6 '09 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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