{
    "content": [
        {
            "type": "text",
            "text": "# canonical (man)\n\n## NAME\n\ncanonical - Postfix canonical table format\n\n## DESCRIPTION\n\nThe  optional  canonical(5)  table  specifies  an address mapping for local and non-local ad‐\ndresses. The mapping is used by the cleanup(8) daemon, before mail is stored into the  queue.\nThe address mapping is recursive.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **CASE FOLDING**\n- **TABLE FORMAT**\n- **TABLE SEARCH ORDER**\n- **RESULT ADDRESS REWRITING**\n- **ADDRESS EXTENSION**\n- **REGULAR EXPRESSION TABLES**\n- **TCP-BASED TABLES**\n- **BUGS**\n- **CONFIGURATION PARAMETERS** (2 subsections)\n- **SEE ALSO**\n- **README FILES**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "canonical",
        "section": "",
        "mode": "man",
        "summary": "canonical - Postfix canonical table format",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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": "virtual",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/virtual/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "postmap /etc/postfix/canonical",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "CASE FOLDING",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "TABLE FORMAT",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "TABLE SEARCH ORDER",
                "lines": 42,
                "subsections": []
            },
            {
                "name": "RESULT ADDRESS REWRITING",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "ADDRESS EXTENSION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "REGULAR EXPRESSION TABLES",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "TCP-BASED TABLES",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONFIGURATION PARAMETERS",
                "lines": 45,
                "subsections": [
                    {
                        "name": "mydestination ($myhostname, localhost.$mydomain, localhost)",
                        "lines": 3
                    },
                    {
                        "name": "myorigin ($myhostname)",
                        "lines": 13
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 16,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "canonical - Postfix canonical table format\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "postmap /etc/postfix/canonical",
                        "content": "postmap -q \"string\" /etc/postfix/canonical\n\npostmap -q - /etc/postfix/canonical <inputfile\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "The  optional  canonical(5)  table  specifies  an address mapping for local and non-local ad‐\ndresses. The mapping is used by the cleanup(8) daemon, before mail is stored into the  queue.\nThe address mapping is recursive.\n\nNormally,  the  canonical(5)  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/canonical\" 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 TCP-based server. In those  cases,  the\nlookups are done in a slightly different way as described below under \"REGULAR EXPRESSION TA‐\nBLES\" or \"TCP-BASED TABLES\".\n\nBy default the canonical(5) mapping affects both message  header  addresses  (i.e.  addresses\nthat  appear inside messages) and message envelope addresses (for example, the addresses that\nare used in SMTP protocol commands). This is controlled with the canonicalclasses parameter.\n\nNOTE: Postfix versions 2.2 and later rewrite message headers from remote SMTP clients only if\nthe  client  matches  the localheaderrewriteclients parameter, or if the remoteheaderre‐\nwritedomain configuration parameter specifies a non-empty value. To get the behavior  before\nPostfix 2.2, specify \"localheaderrewriteclients = static:all\".\n\nTypically, one would use the canonical(5) table to replace login names by Firstname.Lastname,\nor to clean up addresses produced by legacy mail systems.\n\nThe canonical(5) mapping is not to be confused with  virtual  alias  support  or  with  local\naliasing. To change the destination but not the headers, use the virtual(5) or aliases(5) map\ninstead.\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\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\nReplace user@domain by address. This form has the highest precedence.\n\nThis is useful to clean up addresses produced by legacy mail systems.  It can also  be\nused  to produce Firstname.Lastname style addresses, but see below for a simpler solu‐\ntion.\n\nuser address\nReplace user@site by address when site is equal to $myorigin, when site is  listed  in\n$mydestination, or when it is listed in $inetinterfaces or $proxyinterfaces.\n\nThis form is useful for replacing login names by Firstname.Lastname.\n\n@domain address\nReplace other addresses in domain by address.  This form has the lowest precedence.\n\nNote:  @domain  is  a wild-card. When this form is applied to recipient addresses, the\nPostfix SMTP server accepts mail for any recipient in domain,  regardless  of  whether\nthat  recipient  exists.   This  may  turn your mail system into a backscatter source:\nPostfix first accepts mail for non-existent recipients and then tries to  return  that\nmail as \"undeliverable\" to the often forged 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 rewrit‐\nten to 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.\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 table lookup.\n",
                "subsections": []
            },
            "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 not available up to and including Postfix version 2.4.\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.  The text below provides only a pa‐\nrameter summary. See postconf(5) for more details including examples.\n\ncanonicalclasses (envelopesender, enveloperecipient, headersender, headerrecipient)\nWhat addresses are subject to canonicalmaps address mapping.\n\ncanonicalmaps (empty)\nOptional address mapping lookup tables for message headers and envelopes.\n\nrecipientcanonicalmaps (empty)\nOptional address mapping lookup tables for envelope and header recipient addresses.\n\nsendercanonicalmaps (empty)\nOptional address mapping lookup tables for envelope and header sender addresses.\n\npropagateunmatchedextensions (canonical, virtual)\nWhat address lookup tables copy an address extension from the lookup key to the lookup\nresult.\n\nOther parameters of interest:\n\ninetinterfaces (all)\nThe network interface addresses that this mail system receives mail on.\n\nlocalheaderrewriteclients (permitinetinterfaces)\nRewrite  message header addresses in mail from these clients and update incomplete ad‐\ndresses with the domain name in $myorigin or $mydomain; either don't  rewrite  message\nheaders  from  other  clients at all, or rewrite message headers and update incomplete\naddresses with the domain specified in the remoteheaderrewritedomain parameter.\n\nproxyinterfaces (empty)\nThe network interface addresses that this mail system receives mail on  by  way  of  a\nproxy or network address translation unit.\n\nmasqueradeclasses (envelopesender, headersender, headerrecipient)\nWhat addresses are subject to address masquerading.\n\nmasqueradedomains (empty)\nOptional  list  of domains whose subdomain structure will be stripped off in email ad‐\ndresses.\n\nmasqueradeexceptions (empty)\nOptional list of user names that are not subjected to address masquerading, even  when\ntheir address matches $masqueradedomains.\n",
                "subsections": [
                    {
                        "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\nownerrequestspecial (yes)\nEnable  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\nremoteheaderrewritedomain (empty)\nDon't rewrite message headers from remote clients at all when this parameter is empty;\notherwise, rewrite message headers and append the specified domain name to  incomplete\naddresses.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "cleanup(8), canonicalize and enqueue mail\npostmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\nvirtual(5), virtual aliasing\n",
                "subsections": []
            },
            "README FILES": {
                "content": "Use \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nDATABASEREADME, Postfix lookup table overview\nADDRESSREWRITINGREADME, address rewriting 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\n\n\nCANONICAL(5)",
                "subsections": []
            }
        }
    }
}