{
    "content": [
        {
            "type": "text",
            "text": "# regexp_table (man)\n\n## NAME\n\nregexptable - format of Postfix regular expression tables\n\n## SYNOPSIS\n\npostmap -q \"string\" regexp:/etc/postfix/filename\npostmap -q - regexp:/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- **TABLE 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": "regexp_table",
        "section": "",
        "mode": "man",
        "summary": "regexptable - format of Postfix regular expression tables",
        "synopsis": "postmap -q \"string\" regexp:/etc/postfix/filename\npostmap -q - regexp:/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": "pcretable",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pcretable/5/json"
            },
            {
                "name": "cidrtable",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/cidrtable/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "TABLE FORMAT",
                "lines": 58,
                "subsections": []
            },
            {
                "name": "TABLE 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": 4,
                "subsections": []
            },
            {
                "name": "EXAMPLE BODY FILTER MAP",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 29,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "regexptable - format of Postfix regular expression tables\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "postmap -q \"string\" regexp:/etc/postfix/filename\n\npostmap -q - regexp:/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 POSIX regular expression form. In this case,\neach  input  is compared against a list of patterns. When a match is found, the corresponding\nresult 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 Postfix regular expression 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 POSIX regular expression enclosed by a pair of delimiters. The regular  ex‐\npression  syntax  is documented in reformat(7) with 4.4BSD, in regex(5) with Solaris, and in\nregex(7) with Linux. Other systems may use other document names.\n\nThe expression delimiter can be any non-alphanumerical character, except whitespace or  char‐\nacters  that  have special meaning (traditionally the forward slash is used). The regular ex‐\npression 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)\nToggle the multi-line mode 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 input string.\n\nx (default: on)\nToggles the extended expression syntax flag. By default, support for extended  expres‐\nsion syntax is enabled.\n",
                "subsections": []
            },
            "TABLE 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": "# Disallow sender-specified routing. This is a must if you relay mail\n# for other domains.\n/[%!@].*[%!@]/       550 Sender-specified routing rejected\n\n# Postmaster is OK, that way they can talk to us about how to fix\n# their problem.\n/^postmaster@/       OK\n\n# Protect your outgoing majordomo exploders\nif !/^owner-/\n/^(.*)-outgoing@(.*)$/  550 Use ${1}@${2} instead\nendif\n",
                "subsections": []
            },
            "EXAMPLE HEADER FILTER MAP": {
                "content": "# These were once common in junk mail.\n/^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~^[[:alnum:]+/]{60,}$~          OK\n\n# Put your own body patterns here.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "postmap(1), Postfix lookup table manager\npcretable(5), format of PCRE tables\ncidrtable(5), format of CIDR 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 regexp table lookup code was originally written by:\nLaMont Jones\nlamont@hp.com\n\nThat code was based on the PCRE dictionary contributed 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\nREGEXPTABLE(5)",
                "subsections": []
            }
        }
    }
}