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