# Who or what needs /etc/aliases?



## fonz (Mar 23, 2013)

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?


----------



## cpm@ (Mar 23, 2013)

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:

```
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.


----------



## fonz (Mar 23, 2013)

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.


----------



## cpm@ (Mar 23, 2013)

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
> 
> ...



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.


----------

