to Create Virtual Aliases Files for Sendmail


Sendmail supports aliases and virtual domain through its aliases map and virtualusertable functions.  However, it is convenient to be able to access an alias file as it were the aliases file directly for one of the virtual domains.  That is what does.


In add additional maps for extra aliases file with:

define(`ALIAS_FILE', `/etc/mail/aliases,/etc/mail/alias2')dnl

If you are already using virtusertable for something else then add another virtual user table in with:

FEATURE(`virtusertable', `sequence v1 v2')dnl

K v2 hash -o /etc/mail/virtusertable.db

K v1 hash -o /etc/mail/virt2.db

Create your aliases in the files in the same name as the domains they represent.  In


test1:             "|mailman post test1"

test1-admin:       "|mailman admin test1"



To create the proper maps for sendmail execute: V=/etc/mail/virt2 A=/etc/mail/alias2  /path/to/ /path/to/

Your /etc/mail/aliases file might have specified root to go somewhere else but if you get mail for it will go to and will go to  The test1 address will only be available under the domain.

Document Author and Date:

Jim Ziobro / 2018-12-01