By Steve Coile <scoile@
This procedure will enable Sendmail's virtual user table, which allows you to configure user-
In order to make use of this feature, you should have Sendmail 8.8.5 or higher installed. Red Hat Linux 4 systems should be using the sendmail-
These instructions assume you are using the stock sendmail-
Add the following line to your Sendmail M4 configuration file (the M4 configuration file supplied with the sendmail-
FEATURE(virtusertable)
Typically, this line is appropriately placed near the bottom of the M4 configuration file. If the line already exists in your M4 configuration file, you need make no changes to the file at all.
Next, generate a new Sendmail configuration file by issuing the following commands. The generated configuration file will be named "redhat.cf" and will be located in the /usr/
cd /usr/lib/sendmail-cf/cf
m4 redhat.mc > redhat.cf
You may wish to compare the newly-
diff -U0 /etc/sendmail.cf redhat.cf
Finally, replace the active Sendmail configuration file with the new configuration file and restart Sendmail:
cat redhat.cf > /etc/sendmail.cf
/etc/rc.d/init.d/sendmail.init stop
killall sendmail
/etc/rc.d/init.d/sendmail.init start
The virtual user table uses two configuration files. The first, /etc/
After creating or modifying /etc/
makemap hash virtusertable.db < /etc/virtusertable
The primary configuration file, /etc/
Each data line in the configuration file should be of the following format:
[username]@hostname forward
Where "[username]" represents an optional username portion of the original recipient address, "hostname" represents the host or domain name portion of the original recipient address, and "forward" represents the address to which the mail should be redirected. If "[username]" is omitted, mail to any address within the given domain will be passed to the forwarding address.
For example, to forward mail addressed to "jqpublic@
jqpublic@somewhere.com joeuser@mydomain.net
To forward all mail addressed to any user in the "somewhere.com" to "jrandom@
@somewhere.com jrandom@mydomain.net
Specific virtual domain aliases (those including the username portion of the address) have precedence over the general aliases (those including only the host or domain name portion of the address). Upon receiving an incoming message, Sendmail will first search for the specific recipient, then for the recipient's domain alone.