{
    "mode": "man",
    "parameter": "VIRTUAL",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/VIRTUAL/5/json",
    "generated": "2026-10-26T23:05:31Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "virtual - Postfix virtual alias table format\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "postmap /etc/postfix/virtual",
                    "content": "postmap -q \"string\" /etc/postfix/virtual\n\npostmap -q - /etc/postfix/virtual <inputfile\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The  optional virtual(5) alias table rewrites recipient addresses for all local, all virtual,\nand all remote mail destinations.  This is unlike the aliases(5) table which is used only for\nlocal(8) delivery. This feature is implemented in the Postfix cleanup(8) daemon  before  mail\nis queued.\n\nVirtual  aliasing is recursive; to terminate recursion for a specific address, alias that ad‐\ndress to itself.\n\nThe main applications of virtual aliasing are:\n\n•      To redirect mail for one address to one or more addresses.\n\n•      To implement virtual alias domains where all addresses are  aliased  to  addresses  in\nother domains.\n\nVirtual alias domains are not to be confused with the virtual mailbox domains that are\nimplemented  with the Postfix virtual(8) mail delivery agent. With virtual mailbox do‐\nmains, each recipient address can have its own mailbox.\n\nVirtual aliasing is applied only to recipient envelope addresses, and does not affect message\nheaders.  Use canonical(5) mapping to rewrite header and envelope addresses in general.\n\nNormally, the virtual(5) alias table is specified as a text file that serves as input to  the\npostmap(1)  command.   The  result,  an  indexed  file  in dbm or db format, is used for fast\nsearching by the mail system. Execute the command \"postmap /etc/postfix/virtual\"  to  rebuild\nan indexed file after changing the corresponding text file.\n\nWhen  the  table  is  provided via other means such as NIS, LDAP or SQL, the same lookups are\ndone as for ordinary indexed files.\n\nAlternatively, the table can be provided as a regular-expression map where patterns are given\nas regular expressions, or lookups can be directed to a TCP-based server. In those case,  the\nlookups are done in a slightly different way as described below under \"REGULAR EXPRESSION TA‐\nBLES\" or \"TCP-BASED TABLES\".\n",
            "subsections": []
        },
        "CASE FOLDING": {
            "content": "The  search  string  is  folded  to  lowercase before database lookup. As of Postfix 2.3, the\nsearch string is not case folded with database types such as regexp: or  pcre:  whose  lookup\nfields can match both upper and lower case.\n",
            "subsections": []
        },
        "TABLE FORMAT": {
            "content": "The input format for the postmap(1) command is as follows:\n\npattern address, address, ...\nWhen pattern matches a mail address, replace it by the corresponding address.\n\nblank lines and comments\nEmpty lines and whitespace-only lines are ignored, as are lines whose first non-white‐\nspace character is a `#'.\n\nmulti-line text\nA  logical  line  starts  with non-whitespace text. A line that starts with whitespace\ncontinues a logical line.\n",
            "subsections": []
        },
        "TABLE SEARCH ORDER": {
            "content": "With lookups from indexed files such as DB or DBM, or from networked tables such as NIS, LDAP\nor SQL, each user@domain query produces a sequence of query patterns as described below.\n\nEach query pattern is sent to each specified lookup table before trying the next  query  pat‐\ntern, until a match is found.\n\nuser@domain address, address, ...\nRedirect mail for user@domain to address.  This form has the highest precedence.\n\nuser address, address, ...\nRedirect  mail  for user@site to address when site is equal to $myorigin, when site is\nlisted in $mydestination, or when it is listed in  $inetinterfaces  or  $proxyinter‐\nfaces.\n\nThis  functionality  overlaps with the functionality of the local aliases(5) database.\nThe difference is that virtual(5) mapping can be applied to non-local addresses.\n\n@domain address, address, ...\nRedirect mail for other users in domain to address.  This form has the  lowest  prece‐\ndence.\n\nNote: @domain is a wild-card. With this form, the Postfix SMTP server accepts mail for\nany  recipient  in domain, regardless of whether that recipient exists.  This may turn\nyour mail system into a backscatter source: Postfix first accepts mail  for  non-exis‐\ntent  recipients  and  then  tries to return that mail as \"undeliverable\" to the often\nforged sender address.\n\nTo avoid backscatter with mail for a wild-card domain, replace the  wild-card  mapping\nwith  explicit 1:1 mappings, or add a rejectunverifiedrecipient restriction for that\ndomain:\n\nsmtpdrecipientrestrictions =\n...\nrejectunauthdestination\ncheckrecipientaccess\ninline:{example.com=rejectunverifiedrecipient}\nunverifiedrecipientrejectcode = 550\n\nIn the above example, Postfix may contact a remote server if the recipient is  aliased\nto a remote address.\n",
            "subsections": []
        },
        "RESULT ADDRESS REWRITING": {
            "content": "The lookup result is subject to address rewriting:\n\n•      When  the result has the form @otherdomain, the result becomes the same user in other‐\ndomain.  This works only for the first address in a multi-address lookup result.\n\n•      When \"appendatmyorigin=yes\", append \"@$myorigin\" to addresses without \"@domain\".\n\n•      When \"appenddotmydomain=yes\", append \".$mydomain\" to addresses without \".domain\".\n",
            "subsections": []
        },
        "ADDRESS EXTENSION": {
            "content": "When a mail address localpart contains the optional recipient delimiter  (e.g.,  user+foo@do‐\nmain), the lookup order becomes: user+foo@domain, user@domain, user+foo, user, and @domain.\n\nThe  propagateunmatchedextensions parameter controls whether an unmatched address extension\n(+foo) is propagated to the result of a table lookup.\n",
            "subsections": []
        },
        "VIRTUAL ALIAS DOMAINS": {
            "content": "Besides virtual aliases, the virtual alias table can also be used to implement virtual  alias\ndomains.  With  a  virtual  alias domain, all recipient addresses are aliased to addresses in\nother domains.\n\nVirtual alias domains are not to be confused with the virtual mailbox domains that are imple‐\nmented with the Postfix virtual(8) mail delivery agent. With virtual  mailbox  domains,  each\nrecipient address can have its own mailbox.\n\nWith  a  virtual  alias  domain,  the virtual domain has its own user name space. Local (i.e.\nnon-virtual) usernames are not visible in  a  virtual  alias  domain.  In  particular,  local\naliases(5) and local mailing lists are not visible as localname@virtual-alias.domain.\n\nSupport for a virtual alias domain looks like:\n\n/etc/postfix/main.cf:\nvirtualaliasmaps = hash:/etc/postfix/virtual\n\nNote:  some systems use dbm databases instead of hash.  See the output from \"postconf -m\" for\navailable database types.\n\n/etc/postfix/virtual:\nvirtual-alias.domain    anything (right-hand content does not matter)\npostmaster@virtual-alias.domain postmaster\nuser1@virtual-alias.domain      address1\nuser2@virtual-alias.domain      address2, address3\n\nThe virtual-alias.domain anything entry is required for a virtual alias domain. Without  this",
            "subsections": [
                {
                    "name": "entry,  mail  is rejected with \"relay access denied\", or bounces with \"mail loops back to my‐",
                    "content": ""
                },
                {
                    "name": "self\".",
                    "content": "Do not specify virtual alias domain names in the main.cf mydestination or relaydomains  con‐\nfiguration parameters.\n\nWith  a  virtual  alias  domain,  the  Postfix  SMTP  server accepts mail for known-user@vir‐\ntual-alias.domain, and rejects mail for unknown-user@virtual-alias.domain as undeliverable.\n\nInstead of specifying the virtual alias domain name via the virtualaliasmaps table, you may\nalso specify it via the main.cf virtualaliasdomains configuration parameter.   This  latter\nparameter uses the same syntax as the main.cf mydestination configuration parameter.\n"
                }
            ]
        },
        "REGULAR EXPRESSION TABLES": {
            "content": "This  section  describes  how the table lookups change when the table is given in the form of\nregular expressions. For a description of regular expression lookup table  syntax,  see  reg‐\nexptable(5) or pcretable(5).\n\nEach  pattern  is a regular expression that is applied to the entire address being looked up.\nThus, user@domain mail addresses are not broken up into their user  and  @domain  constituent\nparts, nor is user+foo broken up into user and foo.\n\nPatterns  are  applied  in the order as specified in the table, until a pattern is found that\nmatches the search string.\n\nResults are the same as with indexed file lookups, with the additional feature that parenthe‐\nsized substrings from the pattern can be interpolated as $1, $2 and so on.\n",
            "subsections": []
        },
        "TCP-BASED TABLES": {
            "content": "This section describes how the table lookups change when lookups are directed to a  TCP-based\nserver.  For  a description of the TCP client/server lookup protocol, see tcptable(5).  This\nfeature is available in Postfix 2.5 and later.\n\nEach lookup operation uses the entire address once.  Thus, user@domain mail addresses are not\nbroken up into their user and @domain constituent parts, nor is user+foo broken up into  user\nand foo.\n\nResults are the same as with indexed file lookups.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The table format does not understand quoting conventions.\n",
            "subsections": []
        },
        "CONFIGURATION PARAMETERS": {
            "content": "The  following  main.cf  parameters  are  especially  relevant to this topic. See the Postfix\nmain.cf file for syntax details and for default values. Use the \"postfix reload\" command  af‐\nter a configuration change.\n",
            "subsections": [
                {
                    "name": "virtual_alias_maps ($virtual_maps)",
                    "content": "Optional lookup tables that alias specific mail addresses or domains to other local or\nremote addresses.\n"
                },
                {
                    "name": "virtual_alias_domains ($virtual_alias_maps)",
                    "content": "Postfix is the final destination for the specified list of virtual alias domains, that\nis,  domains for which all addresses are aliased to addresses in other local or remote\ndomains.\n"
                },
                {
                    "name": "propagate_unmatched_extensions (canonical, virtual)",
                    "content": "What address lookup tables copy an address extension from the lookup key to the lookup\nresult.\n\nOther parameters of interest:\n"
                },
                {
                    "name": "inet_interfaces (all)",
                    "content": "The network interface addresses that this mail system receives mail on.\n"
                },
                {
                    "name": "mydestination ($myhostname, localhost.$mydomain, localhost)",
                    "content": "The list of domains that are delivered via the $localtransport mail  delivery  trans‐\nport.\n"
                },
                {
                    "name": "myorigin ($myhostname)",
                    "content": "The domain name that locally-posted mail appears to come from, and that locally posted\nmail is delivered to.\n"
                },
                {
                    "name": "owner_request_special (yes)",
                    "content": "Enable  special treatment for owner-listname entries in the aliases(5) file, and don't\nsplit owner-listname and listname-request address localparts when the recipientdelim‐\niter is set to \"-\".\n"
                },
                {
                    "name": "proxy_interfaces (empty)",
                    "content": "The network interface addresses that this mail system receives mail on  by  way  of  a\nproxy or network address translation unit.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "cleanup(8), canonicalize and enqueue mail\npostmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\ncanonical(5), canonical address mapping\n",
            "subsections": []
        },
        "README FILES": {
            "content": "Use \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nADDRESSREWRITINGREADME, address rewriting guide\nDATABASEREADME, Postfix lookup table overview\nVIRTUALREADME, domain hosting guide\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "The Secure Mailer license must be distributed with this software.\n\nAUTHOR(S)\nWietse Venema\nIBM T.J. Watson Research\nP.O. Box 704\nYorktown Heights, NY 10598, USA\n\nWietse Venema\nGoogle, Inc.\n111 8th Avenue\nNew York, NY 10011, USA\n\nVIRTUAL(5)",
            "subsections": []
        }
    },
    "summary": "virtual - Postfix virtual alias table format",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "cleanup",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/cleanup/8/json"
        },
        {
            "name": "postmap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/postmap/1/json"
        },
        {
            "name": "postconf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/postconf/5/json"
        },
        {
            "name": "canonical",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/canonical/5/json"
        }
    ]
}