Who or what needs /etc/aliases?

I noticed that /etc/aliases exists and is a symbolic link to /etc/mail/aliases. Are there any particular reasons for having this symlink, or more to the point: is there anything that expects the aliases file to be in /etc instead of /etc/mail?
 
Have you replaced your MTA?

Note that /etc/aliases today is a symlink to /etc/mail/aliases. AFAIK, this is for "ease of transition". The path to the alias database file is controlled via the alias_database configuration parameter. The value is system dependent. Usually it is one of the following:
Code:
alias_database = hash:/etc/aliases # (4.4BSD, LINUX)
alias_database = dbm:/etc/aliases # (4.3BSD, SYSV<4)
alias_database = dbm:/etc/mail/aliases # (SYSV4)

The MTA actually does not read directly from /etc/mail/aliases file. Instead, it reads information from /etc/mail/aliases.db, the random access data base. Thus after every modification of the file aliases the data base has to be rebuild by simply executing command newaliases(1). There is no need to restart the MTA daemon.

Take a look to Section 29.4 Changing your MTA of FreeBSD Handbook.
 
cpu82 said:
Have you replaced your MTA?
Nope, just good old sendmail(8), or as I've once seen on a t-shirt: "Yes, that sendmail" :)

cpu82 said:
Note that /etc/aliases today is a symlink to /etc/mail/aliases.
[snip]
AFAIK, this is for "ease of transition".
And that's exactly my point: why is that symlink there? If it's there for "ease of transition", then the question is: "transition from what?" And still the original question remains: what, if anything, uses /etc/aliases (instead of /etc/mail/aliases) in the first place? I suspect that if one just uses sendmail(8), then this symlink is pretty much redundant and the only harm in deleting it would be that mergemaster(8) will probably just recreate it.

cpu82 said:
The MTA actually does not read directly from /etc/mail/aliases file. Instead, it reads information from /etc/mail/aliases.db,
Quite correct, indeed. In fact, if anything that increased my curiosity about what this symlink is for. It doesn't really bother me as such, I'm merely wondering why it's there.
 
I refer a migration from sendmail to postfix (e.g.) as was mentioned in /usr/ports/UPDATING.
20090605:
AFFECTS: users of mail/postfix
AUTHOR: itetcu@FreeBSD.org

Version 2.6.1 introduced a POLA violation by expecting aliases.db to be
in /etc/mail/aliases.db (not /etc/aliases.db). With this version the
location is reverted to the right place.

If you updated your installation to 2.6.1 you need to run newaliases(1)
again after you installed 2.6.2.

Is better not to violate POLA ;)

It means that as FreeBSD evolves, changes visible to the user should be kept as unsurprising as possible. For example, arbitrarily rearranging system startup variables in /etc/defaults/rc.conf violates POLA. Developers consider POLA when contemplating user-visible system changes.
 
Back
Top