virtusertable FEATURE

sendmail's virtusertable allows a mail server to receive mail for multiple--possibly nonexistent--domains. Each of these "virtual" domains is added to class {VirtHost}; domains may be added with a separate VIRTUSER_DOMAIN macro for each domain, or may be loaded from a file with the VIRTUSER_DOMAIN_FILE macro.

{VirtHost} domains are automatically added to class R, the "relay domains" class.

In this example, sendmail will be configured to redirect all @example.com mail to my bhutch@gmail.com email address.

1. Add FEATURE(virtusertable) to the sendmail macro configuration file.
2. Add VIRTUSER_DOMAIN(`example.com') to the sendmail macro configuration file.
3. Add @example.com bhutch@gmail.com to /etc/mail/virtusertable.
4. Build the virtusertable database with makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
5. Build and install the sendmail configuration file.
6. Test the configuration.

$ echo '$={VirtHost}' | sendmail -bt
example.com

$ echo '3,0 user@example.com' | sendmail -bt
parse            returns: $# esmtp $@ gmail . com . $: bhutch < @ gmail . com . >

To deliver mail to multiple addresses with virtusertable, you may specify an alias in the right-hand side; multiple values, even separated by commas, are not allowed in virtusertable.

Back to brandonhutchinson.com.
Last modified: 2006/04/28