1# VIRTUAL(5) VIRTUAL(5) 2# 3# NAME 4# virtual - Postfix virtual alias table format 5# 6# SYNOPSIS 7# postmap /etc/postfix/virtual 8# 9# postmap -q "string" /etc/postfix/virtual 10# 11# postmap -q - /etc/postfix/virtual <inputfile 12# 13# DESCRIPTION 14# The optional virtual(5) alias table rewrites recipient 15# addresses for all local, all virtual, and all remote mail 16# destinations. This is unlike the aliases(5) table which 17# is used only for local(8) delivery. This feature is imple- 18# mented in the Postfix cleanup(8) daemon before mail is 19# queued. 20# 21# Virtual aliasing is recursive; to terminate recursion for 22# a specific address, alias that address to itself. 23# 24# The main applications of virtual aliasing are: 25# 26# o To redirect mail for one address to one or more 27# addresses. 28# 29# o To implement virtual alias domains where all 30# addresses are aliased to addresses in other 31# domains. 32# 33# Virtual alias domains are not to be confused with 34# the virtual mailbox domains that are implemented 35# with the Postfix virtual(8) mail delivery agent. 36# With virtual mailbox domains, each recipient 37# address can have its own mailbox. 38# 39# Virtual aliasing is applied only to recipient envelope 40# addresses, and does not affect message headers. Use 41# canonical(5) mapping to rewrite header and envelope 42# addresses in general. 43# 44# Normally, the virtual(5) alias table is specified as a 45# text file that serves as input to the postmap(1) command. 46# The result, an indexed file in dbm or db format, is used 47# for fast searching by the mail system. Execute the command 48# "postmap /etc/postfix/virtual" to rebuild an indexed file 49# after changing the corresponding text file. 50# 51# When the table is provided via other means such as NIS, 52# LDAP or SQL, the same lookups are done as for ordinary 53# indexed files. 54# 55# Alternatively, the table can be provided as a regu- 56# lar-expression map where patterns are given as regular 57# expressions, or lookups can be directed to a TCP-based 58# server. In those case, the lookups are done in a slightly 59# different way as described below under "REGULAR EXPRESSION 60# TABLES" or "TCP-BASED TABLES". 61# 62# CASE FOLDING 63# The search string is folded to lowercase before database 64# lookup. As of Postfix 2.3, the search string is not case 65# folded with database types such as regexp: or pcre: whose 66# lookup fields can match both upper and lower case. 67# 68# TABLE FORMAT 69# The input format for the postmap(1) command is as follows: 70# 71# pattern address, address, ... 72# When pattern matches a mail address, replace it by 73# the corresponding address. 74# 75# blank lines and comments 76# Empty lines and whitespace-only lines are ignored, 77# as are lines whose first non-whitespace character 78# is a `#'. 79# 80# multi-line text 81# A logical line starts with non-whitespace text. A 82# line that starts with whitespace continues a logi- 83# cal line. 84# 85# TABLE SEARCH ORDER 86# With lookups from indexed files such as DB or DBM, or from 87# networked tables such as NIS, LDAP or SQL, each 88# user@domain query produces a sequence of query patterns as 89# described below. 90# 91# Each query pattern is sent to each specified lookup table 92# before trying the next query pattern, until a match is 93# found. 94# 95# user@domain address, address, ... 96# Redirect mail for user@domain to address. This 97# form has the highest precedence. 98# 99# user address, address, ... 100# Redirect mail for user@site to address when site is 101# equal to $myorigin, when site is listed in $mydes- 102# tination, or when it is listed in $inet_interfaces 103# or $proxy_interfaces. 104# 105# This functionality overlaps with the functionality 106# of the local aliases(5) database. The difference is 107# that virtual(5) mapping can be applied to non-local 108# addresses. 109# 110# @domain address, address, ... 111# Redirect mail for other users in domain to address. 112# This form has the lowest precedence. 113# 114# Note: @domain is a wild-card. With this form, the 115# Postfix SMTP server accepts mail for any recipient 116# in domain, regardless of whether that recipient 117# exists. This may turn your mail system into a 118# backscatter source: Postfix first accepts mail for 119# non-existent recipients and then tries to return 120# that mail as "undeliverable" to the often forged 121# sender address. 122# 123# To avoid backscatter with mail for a wild-card 124# domain, replace the wild-card mapping with explicit 125# 1:1 mappings, or add a reject_unverified_recipient 126# restriction for that domain: 127# 128# smtpd_recipient_restrictions = 129# ... 130# reject_unauth_destination 131# check_recipient_access 132# inline:{example.com=reject_unverified_recipient} 133# unverified_recipient_reject_code = 550 134# 135# In the above example, Postfix may contact a remote 136# server if the recipient is aliased to a remote 137# address. 138# 139# RESULT ADDRESS REWRITING 140# The lookup result is subject to address rewriting: 141# 142# o When the result has the form @otherdomain, the 143# result becomes the same user in otherdomain. This 144# works only for the first address in a multi-address 145# lookup result. 146# 147# o When "append_at_myorigin=yes", append "@$myorigin" 148# to addresses without "@domain". 149# 150# o When "append_dot_mydomain=yes", append ".$mydomain" 151# to addresses without ".domain". 152# 153# ADDRESS EXTENSION 154# When a mail address localpart contains the optional recip- 155# ient delimiter (e.g., user+foo@domain), the lookup order 156# becomes: user+foo@domain, user@domain, user+foo, user, and 157# @domain. 158# 159# The propagate_unmatched_extensions parameter controls 160# whether an unmatched address extension (+foo) is propa- 161# gated to the result of a table lookup. 162# 163# VIRTUAL ALIAS DOMAINS 164# Besides virtual aliases, the virtual alias table can also 165# be used to implement virtual alias domains. With a virtual 166# alias domain, all recipient addresses are aliased to 167# addresses in other domains. 168# 169# Virtual alias domains are not to be confused with the vir- 170# tual mailbox domains that are implemented with the Postfix 171# virtual(8) mail delivery agent. With virtual mailbox 172# domains, each recipient address can have its own mailbox. 173# 174# With a virtual alias domain, the virtual domain has its 175# own user name space. Local (i.e. non-virtual) usernames 176# are not visible in a virtual alias domain. In particular, 177# local aliases(5) and local mailing lists are not visible 178# as localname@virtual-alias.domain. 179# 180# Support for a virtual alias domain looks like: 181# 182# /etc/postfix/main.cf: 183# virtual_alias_maps = hash:/etc/postfix/virtual 184# 185# Note: some systems use dbm databases instead of hash. See 186# the output from "postconf -m" for available database 187# types. 188# 189# /etc/postfix/virtual: 190# virtual-alias.domain anything (right-hand content does not matter) 191# postmaster@virtual-alias.domain postmaster 192# user1@virtual-alias.domain address1 193# user2@virtual-alias.domain address2, address3 194# 195# The virtual-alias.domain anything entry is required for a 196# virtual alias domain. Without this entry, mail is rejected 197# with "relay access denied", or bounces with "mail loops 198# back to myself". 199# 200# Do not specify virtual alias domain names in the main.cf 201# mydestination or relay_domains configuration parameters. 202# 203# With a virtual alias domain, the Postfix SMTP server 204# accepts mail for known-user@virtual-alias.domain, and 205# rejects mail for unknown-user@virtual-alias.domain as 206# undeliverable. 207# 208# Instead of specifying the virtual alias domain name via 209# the virtual_alias_maps table, you may also specify it via 210# the main.cf virtual_alias_domains configuration parameter. 211# This latter parameter uses the same syntax as the main.cf 212# mydestination configuration parameter. 213# 214# REGULAR EXPRESSION TABLES 215# This section describes how the table lookups change when 216# the table is given in the form of regular expressions. For 217# a description of regular expression lookup table syntax, 218# see regexp_table(5) or pcre_table(5). 219# 220# Each pattern is a regular expression that is applied to 221# the entire address being looked up. Thus, user@domain mail 222# addresses are not broken up into their user and @domain 223# constituent parts, nor is user+foo broken up into user and 224# foo. 225# 226# Patterns are applied in the order as specified in the ta- 227# ble, until a pattern is found that matches the search 228# string. 229# 230# Results are the same as with indexed file lookups, with 231# the additional feature that parenthesized substrings from 232# the pattern can be interpolated as $1, $2 and so on. 233# 234# TCP-BASED TABLES 235# This section describes how the table lookups change when 236# lookups are directed to a TCP-based server. For a descrip- 237# tion of the TCP client/server lookup protocol, see tcp_ta- 238# ble(5). This feature is available in Postfix 2.5 and 239# later. 240# 241# Each lookup operation uses the entire address once. Thus, 242# user@domain mail addresses are not broken up into their 243# user and @domain constituent parts, nor is user+foo broken 244# up into user and foo. 245# 246# Results are the same as with indexed file lookups. 247# 248# BUGS 249# The table format does not understand quoting conventions. 250# 251# CONFIGURATION PARAMETERS 252# The following main.cf parameters are especially relevant 253# to this topic. See the Postfix main.cf file for syntax 254# details and for default values. Use the "postfix reload" 255# command after a configuration change. 256# 257# virtual_alias_maps ($virtual_maps) 258# Optional lookup tables that alias specific mail 259# addresses or domains to other local or remote 260# addresses. 261# 262# virtual_alias_domains ($virtual_alias_maps) 263# Postfix is the final destination for the specified 264# list of virtual alias domains, that is, domains for 265# which all addresses are aliased to addresses in 266# other local or remote domains. 267# 268# propagate_unmatched_extensions (canonical, virtual) 269# What address lookup tables copy an address exten- 270# sion from the lookup key to the lookup result. 271# 272# Other parameters of interest: 273# 274# inet_interfaces (all) 275# The network interface addresses that this mail sys- 276# tem receives mail on. 277# 278# mydestination ($myhostname, localhost.$mydomain, local- 279# host) 280# The list of domains that are delivered via the 281# $local_transport mail delivery transport. 282# 283# myorigin ($myhostname) 284# The domain name that locally-posted mail appears to 285# come from, and that locally posted mail is deliv- 286# ered to. 287# 288# owner_request_special (yes) 289# Enable special treatment for owner-listname entries 290# in the aliases(5) file, and don't split owner-list- 291# name and listname-request address localparts when 292# the recipient_delimiter is set to "-". 293# 294# proxy_interfaces (empty) 295# The network interface addresses that this mail sys- 296# tem receives mail on by way of a proxy or network 297# address translation unit. 298# 299# SEE ALSO 300# cleanup(8), canonicalize and enqueue mail 301# postmap(1), Postfix lookup table manager 302# postconf(5), configuration parameters 303# canonical(5), canonical address mapping 304# 305# README FILES 306# Use "postconf readme_directory" or "postconf html_direc- 307# tory" to locate this information. 308# ADDRESS_REWRITING_README, address rewriting guide 309# DATABASE_README, Postfix lookup table overview 310# VIRTUAL_README, domain hosting guide 311# 312# LICENSE 313# The Secure Mailer license must be distributed with this 314# software. 315# 316# AUTHOR(S) 317# Wietse Venema 318# IBM T.J. Watson Research 319# P.O. Box 704 320# Yorktown Heights, NY 10598, USA 321# 322# Wietse Venema 323# Google, Inc. 324# 111 8th Avenue 325# New York, NY 10011, USA 326# 327# VIRTUAL(5) 328