Regarding this exim /etc/aliases man page

I am not sure how /etc/aliases works. The

   The file should contain lins of the form
   name: address, address, ...

I looked in /usr/share/doc/exim4-base/spec.txt.gz, but all I want is an example of the format of the aliases.

Is it

root:  bobjoe@mysite.com, Robbiejoe@mysite.com, bobjoe@mysecondsite.com

Where root is the login username on the Linux system, and the aliases that trail after it are (email addresses that go to root's inbox)

Or is it

root:  bobjoe, Robbiejoe

Where the domain name is left out.. so the alias file doesn't care about domain..??

And so how can you route bobjoe@mysecondsite.com to the root user?

1 Answer 1


/etc/aliases is used to redirect mail for users in the local domain (the domain the exim4 server belongs to). Therefore, if you were to have a line like

joe:   joseph@another.domain.com, josephine@some.where.else
then email addressed to joe (and joe being a local user on the mail server) would be sent to the other two email addresses instead.

If you want to redirect email addressed to bobjoe@mysecondsite.com to root, then you would first of all need to make sure that your mail server is configured to process messages for the domain mysecondsite.com (i.e. mysecondsite.com has to be a relay domain, and the MX records for it have to point to your mail server), and then (if you wanted to use /etc/aliases) bobjoe would need to have a local account, plus you need a line in /etc/aliases of the form

bobjoe:   root

For mail servers with hundreds of users that would be a real pain in the backside, so I would recommend using other methods of aliasing, e.g. vexim.

  • So, if I'm using exim, another.domain.com and some.where.else cannot be entered under "local domains"?
    – bobobobo
    Aug 21, 2010 at 20:40
  • They could, but then forwarding email like this wouldn't make sense. You would then simply forward to joseph and josephine. By default exim is not configured for multiple virtual mail domains, so all users would only have exactly one local mailbox. All of this can be configured, but that would go way beyond the initial scope of your question.
    – wolfgangsz
    Aug 21, 2010 at 21:20
  • Ah, ok. I am now following debian-administration.org/articles/140
    – bobobobo
    Aug 21, 2010 at 21:26
  • Well, my friend, welcome to the wonderful (and sometimes confusing) world of exim users. If you really want to run your own mail server, you will do a lot of reading over the next few days or weeks.
    – wolfgangsz
    Aug 21, 2010 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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