Understanding Exim4's /etc/aliases

Regarding this exim /etc/aliases man page

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

/etc/aliases
   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:  [email protected], [email protected], [email protected]

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 [email protected] to the root user?


/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:   [email protected], [email protected]
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 [email protected] 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.