The optional virtual table specifies redirections for local and non-local recipients or domains. The redirections are used by the cleanup(8) daemon. The redirections are recursive.

The virtual redirection is applied only to the recipient envelope address, and does not affect message headers. Think Sendmail rule set `S0`, if you like. Use canonical mapping to rewrite header and envelope addresses in general.

Typical support for a virtual domain looks like the following:

- `virtual.domain` mapped to... `anything` (right-hand content does not matter)
- `user1@virtual.domain` mapped to... `address1`
- `user2@virtual.domain` mapped to... `address2, address3`

With this, the SMTP server accepts mail for `virtual.domain` and rejects mail for `unknown@virtual.domain` as undeliverable.

The format of the virtual table is as follows, mappings being tried in the order as listed here:

- `user@domain` mapped to... `address, address, ...`: Mail for `user@domain` is redirected to `address`. This form has the highest precedence.
- `user` mapped to... `address, address, ...`: Mail for `user@site` is redirected to `address` when site is equal to `$myorigin` when site is listed in `$mydestination`, or when it is listed in `$inet_interfaces`. This functionality overlaps with functionality of the local alias database. The difference is that virtual mapping can be applied to non-local addresses.
- `@domain` mapped to... `address, address, ...`: Mail for any user in `domain` is redirected to `address`. This form has the lowest precedence.

In all the above forms, when address has the form `@otherdomain`, the result is the same user in otherdomain. This works for the first address in the expansion only.

ADDRESS EXTENSION: When the search fails, and the address localpart contains the optional recipient delimiter (e.g., `user+foo@domain`), the search is repeated for the unextended address (e.g. `user@domain`), and the unmatched address extension is propagated to the result of expansion. The matching order is: `user+foo@domain`, `user@domain`, `user+foo`, `user`, and `@domain`.