The Journal Of A Linux Sysadmin

Postfix Newaliases

| Comments

Anyone coming from the “sendmail world” to postfix will notice immediately the care taken by postfix developers to make the transition as easy as possible. The same commands you would be used to, like for ex. mailq, newaliases, are working in postfix also.

The newaliases command works on postfix as expected, rebuilding the aliases database:


One nice feature is that even if you don’t specify any location of the aliases file (yes you can put it in a different location than /etc/aliases), the command will be smart enough to find the alias_database setting from and processes the correct file. Cool! So even if I had defined my aliases in a nonstandard location like for ex, /etc/postfix/aliases:

alias_database = hash:/etc/postfix/aliases

newaliases will manage to find that file and process it appropriately.

Newaliases functions by calling the postalias command (that you can of course also use for this purpose). The full manual page of postalias shows all the usable parameters.

Note: it may take a minute or so before an alias database update becomes visible. Use the “postfix reload” command to eliminate this delay.