A virtusertable is a database that maps virtual (possibly nonexistent) domains into new addresses. Essentially, it gives you a database hook into the early part of the parse rule set 0. Note that this only reroutes delivery. It does not change mail headers.

By way of example, consider one mapping in a source text file:       bob          

The key portion (on the left) must be either a full address (user, host, and domain name), as in the first two lines, or an address without a host part (just a domain), as in the third line, or an address with the user part missing, as in the last line. This source text file is converted into a database with the makemap(1) program (Section 5.5).

The first three lines illustrate a full address for the key. The first line will be delivered to a local user (bob), the second and third to a remote user ( The fourth line shows how all mail to a virtual domain ( can be delivered to a single address, regardless of the user part.

Note that sendmail does multiple lookups, so one line can reference another. The following, for example, will work:      

Here, mail to will be delivered to

Also note that virtual hosts, just like real hosts, need to belong to class w ($=w ...

Get Sendmail, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.