{
    "content": [
        {
            "type": "text",
            "text": "# PCRE_TABLE (man)\n\n## NAME\n\npcretable - format of Postfix PCRE tables\n\n## SYNOPSIS\n\npostmap -q \"string\" pcre:/etc/postfix/filename\npostmap -q - pcre:/etc/postfix/filename <inputfile\npostmap -hmq - pcre:/etc/postfix/filename <inputfile\npostmap -bmq - pcre:/etc/postfix/filename <inputfile\n\n## DESCRIPTION\n\nThe  Postfix  mail system uses optional tables for address rewriting, mail routing, or access\ncontrol. These tables are usually in dbm or db format.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **COMPATIBILITY**\n- **TABLE FORMAT**\n- **SEARCH ORDER**\n- **TEXT SUBSTITUTION**\n- **EXAMPLE SMTPD ACCESS MAP**\n- **EXAMPLE HEADER FILTER MAP**\n- **EXAMPLE BODY FILTER MAP**\n- **SEE ALSO**\n- **README FILES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "PCRE_TABLE",
        "section": "",
        "mode": "man",
        "summary": "pcretable - format of Postfix PCRE tables",
        "synopsis": "postmap -q \"string\" pcre:/etc/postfix/filename\npostmap -q - pcre:/etc/postfix/filename <inputfile\npostmap -hmq - pcre:/etc/postfix/filename <inputfile\npostmap -bmq - pcre:/etc/postfix/filename <inputfile",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "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": "regexptable",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/regexptable/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "TABLE FORMAT",
                "lines": 86,
                "subsections": []
            },
            {
                "name": "SEARCH ORDER",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "TEXT SUBSTITUTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "EXAMPLE SMTPD ACCESS MAP",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "EXAMPLE HEADER FILTER MAP",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLE BODY FILTER MAP",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 25,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pcretable - format of Postfix PCRE tables\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "postmap -q \"string\" pcre:/etc/postfix/filename\n\npostmap -q - pcre:/etc/postfix/filename <inputfile\n\npostmap -hmq - pcre:/etc/postfix/filename <inputfile\n\npostmap -bmq - pcre:/etc/postfix/filename <inputfile\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  Postfix  mail system uses optional tables for address rewriting, mail routing, or access\ncontrol. These tables are usually in dbm or db format.\n\nAlternatively, lookup tables can be specified in Perl Compatible Regular Expression form.  In\nthis case, each input is compared against a list of patterns. When a match is found, the cor‐\nresponding result is returned and the search is terminated.\n\nTo find out what types of lookup tables your Postfix system supports use  the  \"postconf  -m\"\ncommand.\n\nTo  test  lookup tables, use the \"postmap -q\" command as described in the SYNOPSIS above. Use\n\"postmap -hmq - <file\"  for  headerchecks(5)  patterns,  and  \"postmap  -bmq  -  <file\"  for\nbodychecks(5) (Postfix 2.6 and later).\n",
                "subsections": []
            },
            "COMPATIBILITY": {
                "content": "With  Postfix  version  2.2  and earlier specify \"postmap -fq\" to query a table that contains\ncase sensitive patterns. Patterns are case insensitive by default.\n",
                "subsections": []
            },
            "TABLE FORMAT": {
                "content": "The general form of a PCRE table is:\n\n/pattern/flags result\nWhen pattern matches the input string, use the corresponding result value.\n\n!/pattern/flags result\nWhen pattern does not match the input string, use the corresponding result value.\n\nif /pattern/flags\n\nendif  If the input string matches /pattern/, then match that input string against  the  pat‐\nterns between if and endif.  The if..endif can nest.\n\nNote: do not prepend whitespace to patterns inside if..endif.\n\nThis feature is available in Postfix 2.1 and later.\n\nif !/pattern/flags\n\nendif  If the input string does not match /pattern/, then match that input string against the\npatterns between if and endif. The if..endif can nest.\n\nNote: do not prepend whitespace to patterns inside if..endif.\n\nThis feature is available in Postfix 2.1 and later.\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\nEach pattern is a perl-like regular expression. The expression delimiter can be  any  non-al‐\nphanumerical character, except whitespace or characters that have special meaning (tradition‐\nally the forward slash is used).  The regular expression can contain whitespace.\n\nBy default, matching is case-insensitive, and newlines are not treated as special characters.\nThe  behavior  is controlled by flags, which are toggled by appending one or more of the fol‐\nlowing characters after the pattern:\n\ni (default: on)\nToggles the case sensitivity flag. By default, matching is case insensitive.\n\nm (default: off)\nToggles the PCREMULTILINE flag. When this flag is on,  the  ^  and  $  metacharacters\nmatch  immediately  after and immediately before a newline character, respectively, in\naddition to matching at the start and end of the subject string.\n\ns (default: on)\nToggles the PCREDOTALL flag. When this flag is on, the .  metacharacter  matches  the\nnewline  character.  With  Postfix  versions prior to 2.0, the flag is off by default,\nwhich is inconvenient for multi-line message header matching.\n\nx (default: off)\nToggles the pcre extended flag. When this flag is on,  whitespace  characters  in  the\npattern  (other than in a character class) are ignored.  To include a whitespace char‐\nacter as part of the pattern, escape it with backslash.\n\nNote: do not use #comment after patterns.\n\nA (default: off)\nToggles the PCREANCHORED flag.  When this flag is on, the pattern  is  forced  to  be\n\"anchored\",  that is, it is constrained to match only at the start of the string which\nis being searched (the \"subject string\"). This effect can also be achieved  by  appro‐\npriate constructs in the pattern itself.\n\nE (default: off)\nToggles  the  PCREDOLLARENDONLY flag. When this flag is on, a $ metacharacter in the\npattern matches only at the end of the subject string. Without  this  flag,  a  dollar\nalso  matches immediately before the final character if it is a newline character (but\nnot before any other newline characters). This flag is ignored if PCREMULTILINE  flag\nis set.\n\nU (default: off)\nToggles the ungreedy matching flag.  When this flag is on, the pattern matching engine\ninverts the \"greediness\" of the quantifiers so that they are not  greedy  by  default,\nbut  become  greedy  if  followed  by  \"?\".  This flag can also set by a (?U) modifier\nwithin the pattern.\n\nX (default: off)\nToggles the PCREEXTRA flag.  When this flag is on, any backslash in a pattern that is\nfollowed by a letter that has no special meaning causes an error, thus reserving these\ncombinations for future expansion.\n",
                "subsections": []
            },
            "SEARCH ORDER": {
                "content": "Patterns are applied in the order as specified in the table, until a pattern  is  found  that\nmatches the input string.\n\nEach  pattern  is  applied  to  the  entire input string.  Depending on the application, that\nstring is an entire client hostname, an entire client IP address, or an entire mail  address.\nThus,  no  parent domain or parent network search is done, and user@domain mail addresses are\nnot broken up into their user and domain constituent parts, nor is user+foo  broken  up  into\nuser and foo.\n",
                "subsections": []
            },
            "TEXT SUBSTITUTION": {
                "content": "Substitution  of substrings (text that matches patterns inside \"()\") from the matched expres‐\nsion into the result string is requested with $1, $2, etc.; specify $$ to produce a $ charac‐\nter  as  output.   The  macros in the result string may need to be written as ${n} or $(n) if\nthey aren't followed by whitespace.\n\nNote: since negated patterns (those preceded by !) return a result when the  expression  does\nnot match, substitutions are not available for negated patterns.\n",
                "subsections": []
            },
            "EXAMPLE SMTPD ACCESS MAP": {
                "content": "# Protect your outgoing majordomo exploders\n/^(?!owner-)(.*)-outgoing@(.*)/ 550 Use ${1}@${2} instead\n\n# Bounce friend@whatever, except when whatever is our domain (you would\n# be better just bouncing all friend@ mail - this is just an example).\n/^(friend@(?!my\\.domain$).*)$/  550 Stick this in your pipe $1\n\n# A multi-line entry. The text is sent as one line.\n#\n/^noddy@my\\.domain$/\n550 This user is a funny one. You really don't want to send mail to\nthem as it only makes their head spin.\n",
                "subsections": []
            },
            "EXAMPLE HEADER FILTER MAP": {
                "content": "/^Subject: make money fast/     REJECT\n/^To: friend@public\\.com/       REJECT\n",
                "subsections": []
            },
            "EXAMPLE BODY FILTER MAP": {
                "content": "# First skip over base 64 encoded text to save CPU cycles.\n# Requires PCRE version 3.\n~^[[:alnum:]+/]{60,}$~          OK\n\n# Put your own body patterns here.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "postmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\nregexptable(5), format of POSIX regular expression tables\n",
                "subsections": []
            },
            "README FILES": {
                "content": "Use \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nDATABASEREADME, Postfix lookup table overview\n\nAUTHOR(S)\nThe PCRE table lookup code was originally written by:\nAndrew McNamara\nandrewm@connect.com.au\nconnect.com.au Pty. Ltd.\nLevel 3, 213 Miller St\nNorth Sydney, NSW, Australia\n\nAdopted and adapted by:\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\nPCRETABLE(5)",
                "subsections": []
            }
        }
    }
}