{
    "content": [
        {
            "type": "text",
            "text": "# generic(5) (man)\n\n**Summary:** generic - Postfix generic table format\n\n## Examples\n\n- `The  following  shows  a generic mapping with an indexed file.  When mail is sent to a remote`\n- `host via SMTP, this replaces his@localdomain.local by his ISP mail address, replaces  her@lo‐`\n- `caldomain.local  by  her  ISP mail address, and replaces other local addresses by his ISP ac‐`\n- `count, with an address extension of +local (this example assumes that the  ISP  supports  \"+\"`\n- `style address extensions).`\n- `/etc/postfix/main.cf:`\n- `smtpgenericmaps = hash:/etc/postfix/generic`\n- `/etc/postfix/generic:`\n- `his@localdomain.local   hisaccount@hisisp.example`\n- `her@localdomain.local   heraccount@herisp.example`\n- `@localdomain.local      hisaccount+local@hisisp.example`\n- `Execute the command \"postmap /etc/postfix/generic\" whenever the table is changed.  Instead of`\n- `hash, some systems use dbm database files. To find out what tables your system  supports  use`\n- `the command \"postconf -m\".`\n\n## See Also\n\n- postmap(1)\n- postconf(5)\n- smtp(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (1 lines) — 1 subsections\n  - postmap /etc/postfix/generic (4 lines)\n- **DESCRIPTION** (26 lines)\n- **CASE FOLDING** (4 lines)\n- **TABLE FORMAT** (13 lines)\n- **TABLE SEARCH ORDER** (16 lines)\n- **RESULT ADDRESS REWRITING** (9 lines)\n- **ADDRESS EXTENSION** (6 lines)\n- **REGULAR EXPRESSION TABLES** (14 lines)\n- **TCP-BASED TABLES** (10 lines)\n- **EXAMPLE** (18 lines)\n- **BUGS** (2 lines)\n- **CONFIGURATION PARAMETERS** (22 lines) — 2 subsections\n  - mydestination (2 lines)\n  - myorigin (5 lines)\n- **SEE ALSO** (4 lines)\n- **README FILES** (5 lines)\n- **LICENSE** (2 lines)\n- **HISTORY** (18 lines)\n\n## Full Content\n\n### NAME\n\ngeneric - Postfix generic table format\n\n### SYNOPSIS\n\n#### postmap /etc/postfix/generic\n\npostmap -q \"string\" /etc/postfix/generic\n\npostmap -q - /etc/postfix/generic <inputfile\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\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 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\n### CASE FOLDING\n\nThe  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\n### TABLE FORMAT\n\nThe 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\n### TABLE SEARCH ORDER\n\nWith 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\n### RESULT ADDRESS REWRITING\n\nThe 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\n### ADDRESS EXTENSION\n\nWhen  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\n### REGULAR EXPRESSION TABLES\n\nThis  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\n### TCP-BASED TABLES\n\nThis  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\n### EXAMPLE\n\nThe  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\n### BUGS\n\nThe table format does not understand quoting conventions.\n\n### CONFIGURATION PARAMETERS\n\nThe 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\nsmtpgenericmaps\nAddress mapping lookup table for envelope and header sender  and  recipient  addresses\nwhile delivering mail via SMTP.\n\npropagateunmatchedextensions\nA  list of address rewriting or forwarding mechanisms that propagate an address exten‐\nsion from the original address to the result.  Specify zero or more of canonical, vir‐‐\ntual, alias, forward, include, or generic.\n\nOther parameters of interest:\n\ninetinterfaces\nThe  network  interface addresses that this system receives mail on.  You need to stop\nand start Postfix when this parameter changes.\n\nproxyinterfaces\nOther interfaces that this machine receives mail on by way of a proxy agent or network\naddress translator.\n\n#### mydestination\n\nList of domains that this mail system considers local.\n\n#### myorigin\n\nThe domain that is appended to locally-posted mail.\n\nownerrequestspecial\nGive special treatment to owner-xxx and xxx-request addresses.\n\n### SEE ALSO\n\npostmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\nsmtp(8), Postfix SMTP client\n\n### README FILES\n\nUse \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nADDRESSREWRITINGREADME, address rewriting guide\nDATABASEREADME, Postfix lookup table overview\nSTANDARDCONFIGURATIONREADME, configuration examples\n\n### LICENSE\n\nThe Secure Mailer license must be distributed with this software.\n\n### HISTORY\n\nA 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\n\n\nGENERIC(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "generic",
        "section": "5",
        "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": 22,
                "subsections": [
                    {
                        "name": "mydestination",
                        "lines": 2
                    },
                    {
                        "name": "myorigin",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 18,
                "subsections": []
            }
        ]
    }
}