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 VirtDomains.pl does.
In sendmail.mc add additional maps for extra aliases file with:
If you are already using virtusertable for something else then add another virtual user table in sendmail.cf 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 example-list.com:
test1: "|mailman post test1"
test1-admin: "|mailman admin test1"
To create the proper maps for sendmail execute:
VirtDomain.pl V=/etc/mail/virt2 A=/etc/mail/alias2 /path/to/example-list.com /path/to/example.com
Your /etc/mail/aliases file might have specified root to go somewhere else but if you get mail for email@example.com it will go to firstname.lastname@example.org and email@example.com will go to firstname.lastname@example.org. The test1 address will only be available under the example-list.com domain.
Jim Ziobro / 2018-12-01