Understanding /etc/aliases and what it does

The /etc/aliases file is part of sendmail. It specifies which account mail sent to an alias should really be delivered to. For example, mail to the ftp account would be sent to root's mailbox in the configuration you show.

Multiple recipients can be specified as comma-separated lists, too.

Redirecting mail to users isn't all that can be done. Mail can be piped to programs, too, or simply directed into a file of your choice. The following would "bit-bucket" all mail from the user "somebody":

somebody : /dev/null

Modifications to the /etc/aliases file are not complete until the newaliases command is run to build /etc/aliases.db. It is in this later form that sendmail actually uses.


mailer-daemon, hostmaster and postmaster are special mail addresses required by various RFC's, with the apparent exception of mailer-daemon which we can regard as being "entrenched by convention or tradition".

You need mailer-daemon in order to handle issues related to mail itself, such as SMTP bounce messages. If your mail server receives an undeliverable message, it generates an SMTP non-delivery notice, whose From: address is mailer-daemon. The alias is there in case someone replies to a bounce message; it goes to the postmaster, who is a human being, which "mailer daemon" isn't. I can't find any RFC which describes mailer-daemon let alone requires it. You could probably rename this alias to something else like mailer-server, but then you would have to reprogram your mail server to identify itself as mailer-server when sending bounces. I can't think of a reason why bounces couldn't just be from postmaster.

RFC 2142, section 5, gives a summary of some special aliases, and points to other RFC's where they are introduced. Here we learn that postmaster is specified as far back as RFC 822 (it is in its section 6.3). It is a requirement for mail sites to have this alias. hostmaster is mentioned in RFC's 1033, 1034 and 1035. The other aliases you're wondering about are also given in 2142.

Tags:

Email