{
    "content": [
        {
            "type": "text",
            "text": "# generic (man)\n\n## NAME\n\ngeneric - Postfix generic table format\n\n## DESCRIPTION\n\nThe  optional  generic(5) table specifies an address mapping that applies when mail is deliv‐\nered. This is the opposite of canonical(5) mapping, which applies when mail is received.\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- **EXAMPLE**\n- **BUGS**\n- **CONFIGURATION PARAMETERS** (7 subsections)\n- **SEE ALSO**\n- **README FILES**\n- **LICENSE**\n- **HISTORY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "generic",
        "section": "",
        "mode": "man",
        "summary": "generic - Postfix generic table format",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "The  following  shows  a generic mapping with an indexed file.  When mail is sent to a remote",
            "host via SMTP, this replaces his@localdomain.local by his ISP mail address, replaces  her@lo‐",
            "caldomain.local  by  her  ISP mail address, and replaces other local addresses by his ISP ac‐",
            "count, with an address extension of +local (this example assumes that the  ISP  supports  \"+\"",
            "style address extensions).",
            "/etc/postfix/main.cf:",
            "smtpgenericmaps = hash:/etc/postfix/generic",
            "/etc/postfix/generic:",
            "his@localdomain.local   hisaccount@hisisp.example",
            "her@localdomain.local   heraccount@herisp.example",
            "@localdomain.local      hisaccount+local@hisisp.example",
            "Execute the command \"postmap /etc/postfix/generic\" whenever the table is changed.  Instead of",
            "hash,  some  systems use dbm database files. To find out what tables your system supports use",
            "the command \"postconf -m\"."
        ],
        "see_also": [
            {
                "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": "smtp",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/smtp/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "postmap /etc/postfix/generic",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "CASE FOLDING",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "TABLE FORMAT",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "TABLE SEARCH ORDER",
                "lines": 16,
                "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": "EXAMPLE",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONFIGURATION PARAMETERS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "smtp_generic_maps (empty)",
                        "lines": 4
                    },
                    {
                        "name": "propagate_unmatched_extensions (canonical, virtual)",
                        "lines": 5
                    },
                    {
                        "name": "inet_interfaces (all)",
                        "lines": 2
                    },
                    {
                        "name": "proxy_interfaces (empty)",
                        "lines": 3
                    },
                    {
                        "name": "mydestination ($myhostname, localhost.$mydomain, localhost)",
                        "lines": 3
                    },
                    {
                        "name": "myorigin ($myhostname)",
                        "lines": 3
                    },
                    {
                        "name": "owner_request_special (yes)",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 16,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "generic - Postfix generic table format\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "postmap /etc/postfix/generic",
                        "content": "postmap -q \"string\" /etc/postfix/generic\n\npostmap -q - /etc/postfix/generic <inputfile\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "The  optional  generic(5) table specifies an address mapping that applies when mail is deliv‐\nered. This is the opposite of canonical(5) mapping, which applies when mail is received.\n\nTypically, one would use the generic(5) table on a system that does not have a valid Internet\ndomain name and that uses something like localdomain.local instead.  The generic(5) table  is\nthen  used  by  the smtp(8) client to transform local mail addresses into valid Internet mail\naddresses when mail has to be sent across the Internet.  See the EXAMPLE section at  the  end\nof this document.\n\nThe  generic(5) mapping affects both message header addresses (i.e. addresses that appear in‐\nside messages) and message envelope addresses (for example, the addresses that  are  used  in\nSMTP protocol commands).\n\nNormally,  the  generic(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/generic\" 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 cases, 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 result\nWhen pattern matches a mail address, replace it by the corresponding result.\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\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\n@domain address\nReplace other addresses in domain by address.  This form has the lowest precedence.\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 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": []
            },
            "EXAMPLE": {
                "content": "The  following  shows  a generic mapping with an indexed file.  When mail is sent to a remote\nhost via SMTP, this replaces his@localdomain.local by his ISP mail address, replaces  her@lo‐\ncaldomain.local  by  her  ISP mail address, and replaces other local addresses by his ISP ac‐\ncount, with an address extension of +local (this example assumes that the  ISP  supports  \"+\"\nstyle address extensions).\n\n/etc/postfix/main.cf:\nsmtpgenericmaps = hash:/etc/postfix/generic\n\n/etc/postfix/generic:\nhis@localdomain.local   hisaccount@hisisp.example\nher@localdomain.local   heraccount@herisp.example\n@localdomain.local      hisaccount+local@hisisp.example\n\nExecute the command \"postmap /etc/postfix/generic\" whenever the table is changed.  Instead of\nhash,  some  systems use dbm database files. To find out what tables your system supports use\nthe command \"postconf -m\".\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",
                "subsections": [
                    {
                        "name": "smtp_generic_maps (empty)",
                        "content": "Optional lookup tables that perform address rewriting in the Postfix SMTP client, typ‐\nically to transform a locally valid address into a globally valid address when sending\nmail across the Internet.\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": "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"
                    },
                    {
                        "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"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "postmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\nsmtp(8), Postfix SMTP client\n",
                "subsections": []
            },
            "README FILES": {
                "content": "Use \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nADDRESSREWRITINGREADME, address rewriting guide\nDATABASEREADME, Postfix lookup table overview\nSTANDARDCONFIGURATIONREADME, configuration examples\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "The Secure Mailer license must be distributed with this software.\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "A genericstable feature appears in the Sendmail MTA.\n\nThis feature is available in Postfix 2.2 and later.\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\nGENERIC(5)",
                "subsections": []
            }
        }
    }
}