{
    "content": [
        {
            "type": "text",
            "text": "# memcache_table(5) (man)\n\n**Summary:** memcachetable - Postfix memcache client configuration\n\n**Synopsis:** postmap -q \"string\" memcache:/etc/postfix/filename\npostmap -q - memcache:/etc/postfix/filename <inputfile\n\n## See Also\n\n- postmap(1)\n- postconf(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (14 lines)\n- **MEMCACHE MAIN PARAMETERS** (1 lines) — 4 subsections\n  - memcache (default: inet:localhost:11211) (13 lines)\n  - backup (default: undefined) (26 lines)\n  - flags (default: 0) (3 lines)\n  - ttl (default: 3600) (11 lines)\n- **MEMCACHE KEY PARAMETERS** (42 lines) — 1 subsections\n  - domain (default: no domain list) (8 lines)\n- **MEMCACHE ERROR CONTROLS** (13 lines) — 1 subsections\n  - timeout (default: 2) (2 lines)\n- **BUGS** (11 lines)\n- **SEE ALSO** (3 lines)\n- **README FILES** (4 lines)\n- **LICENSE** (2 lines)\n- **HISTORY** (16 lines)\n\n## Full Content\n\n### NAME\n\nmemcachetable - Postfix memcache client configuration\n\n### SYNOPSIS\n\npostmap -q \"string\" memcache:/etc/postfix/filename\n\npostmap -q - memcache:/etc/postfix/filename <inputfile\n\n### DESCRIPTION\n\nThe Postfix mail system uses optional tables for address rewriting or mail routing. These ta‐\nbles are usually in dbm or db format.\n\nAlternatively, lookup tables can  be  specified  as  memcache  instances.   To  use  memcache\nlookups, define a memcache source as a lookup table in main.cf, for example:\n\nvirtualaliasmaps = memcache:/etc/postfix/memcache-aliases.cf\n\nThe  file  /etc/postfix/memcache-aliases.cf  has the same format as the Postfix main.cf file,\nand specifies the parameters described below.\n\nThe Postfix memcache client supports the lookup, update, delete and sequence (first/next) op‐\nerations. The sequence operation requires a backup database that supports the operation.\n\n### MEMCACHE MAIN PARAMETERS\n\n#### memcache (default: inet:localhost:11211)\n\nThe  memcache  server (note: singular) that Postfix will try to connect to.  For a TCP\nserver specify \"inet:\" followed by a hostname or address, \":\", and a port name or num‐\nber.   Specify  an IPv6 address inside \"[]\".  For a UNIX-domain server specify \"unix:\"\nfollowed by the socket pathname. Examples:\n\nmemcache = inet:memcache.example.com:11211\nmemcache = inet:127.0.0.1:11211\nmemcache = inet:[fc00:8d00:189::3]:11211\nmemcache = unix:/path/to/socket\n\nNOTE: to access a UNIX-domain socket with the proxymap(8) server, the socket  must  be\naccessible by the unprivileged postfix user.\n\n#### backup (default: undefined)\n\nAn  optional  Postfix  database that provides persistent backup for the memcache data‐\nbase. The Postfix memcache client will update the memcache database whenever it  looks\nup  or  changes information in the persistent database. Specify a Postfix \"type:table\"\ndatabase. Examples:\n\n# Non-shared postscreen cache.\nbackup = btree:/var/lib/postfix/postscreencachemap\n\n# Shared postscreen cache for processes on the same host.\nbackup = proxy:btree:/var/lib/postfix/postscreencachemap\n\nAccess to remote proxymap servers is under development.\n\nNOTE 1: When sharing a persistent postscreen(8) or verify(8) cache, disable  automatic\ncache cleanup (set *cachecleanupinterval = 0) except with one Postfix instance that\nwill be responsible for cache cleanup.\n\nNOTE 2: When multiple tables share the same memcache database, each table  should  use\nthe keyformat feature (see below) to prepend its own unique string to the lookup key.\nOtherwise, automatic postscreen(8) or verify(8) cache cleanup may not work.\n\nNOTE 3: When the backup database is accessed with \"proxy:\" lookups,  the  full  backup\ndatabase  name  (including  the  \"proxy:\"  prefix)  must  be specified in the proxymap\nserver's proxyreadmaps or proxywritemaps setting (depending on whether the  access\nis read-only or read-write).\n\n#### flags (default: 0)\n\nOptional  flags  that should be stored along with a memcache update. The flags are ig‐\nnored when looking up information.\n\n#### ttl (default: 3600)\n\nThe expiration time in seconds of memcache updates.\n\nNOTE 1: When using a memcache table as postscreen(8) or verify(8) cache  without  per‐\nsistent  backup,  specify  a  zero *cachecleanupinterval value with all Postfix in‐\nstances that use the memcache, and specify the largest postscreen(8)  *ttl  value  or\nverify(8) *expiretime value as the memcache table's ttl value.\n\nNOTE  2:  According  to  memcache protocol documentation, a value greater than 30 days\n(2592000 seconds) specifies absolute UNIX time. Smaller values  are  relative  to  the\ntime of the update.\n\n### MEMCACHE KEY PARAMETERS\n\nkeyformat (default: %s)\nFormat  of  the  lookup  and update keys that the Postfix memcache client sends to the\nmemcache server.  By default, these are the same as the lookup and  update  keys  that\nthe memcache client receives from Postfix applications.\n\nNOTE 1: The keyformat feature is not used for backup database requests.\n\nNOTE  2:  When  multiple  tables  share  the same memcache database, each table should\nprepend its own unique string to the lookup key.  Otherwise,  automatic  postscreen(8)\nor verify(8) cache cleanup may not work.\n\nExamples:\n\nkeyformat = aliases:%s\nkeyformat = verify:%s\nkeyformat = postscreen:%s\n\nThe keyformat parameter supports the following '%' expansions:\n\n%%     This is replaced by a literal '%' character.\n\n%s     This is replaced by the memcache client input key.\n\n%u     When the input key is an address of the form user@domain, %u is replaced by the\nSQL quoted local part of the address.  Otherwise, %u is replaced by the  entire\nsearch  string.  If the localpart is empty, a lookup is silently suppressed and\nreturns no results (an update is skipped with a warning).\n\n%d     When the input key is an address of the form user@domain, %d is replaced by the\ndomain part of the address.  Otherwise, a lookup is silently suppressed and re‐\nturns no results (an update is skipped with a warning).\n\n%[SUD] The upper-case equivalents of the above expansions behave in the keyformat pa‐\nrameter identically to their lower-case counter-parts.\n\n%[1-9] The  patterns %1, %2, ... %9 are replaced by the corresponding most significant\ncomponent of the input key's domain. If the input key is user@mail.example.com,\nthen  %1  is com, %2 is example and %3 is mail. If the input key is unqualified\nor does not have enough domain components to satisfy  all  the  specified  pat‐\nterns,  a  lookup  is  silently suppressed and returns no results (an update is\nskipped with a warning).\n\n#### domain (default: no domain list)\n\nThis feature can significantly reduce database server load.  Specify a list of  domain\nnames,  paths  to files, or \"type:table\" databases.  When specified, only fully quali‐\nfied search keys with a *non-empty* localpart and a matching domain are  eligible  for\nlookup  or  update: bare 'user' lookups, bare domain lookups and \"@domain\" lookups are\nsilently skipped (updates are skipped with a warning).  Example:\n\ndomain = example.com, hash:/etc/postfix/searchdomains\n\n### MEMCACHE ERROR CONTROLS\n\ndatasizelimit (default: 10240)\nThe maximal memcache reply data length in bytes.\n\nlinesizelimit (default: 1024)\nThe maximal memcache reply line length in bytes.\n\nmaxtry (default: 2)\nThe number of times to try a memcache command before giving up.  The  memcache  client\ndoes not retry a command when the memcache server accepts no connection.\n\nretrypause (default: 1)\nThe time in seconds before retrying a failed memcache command.\n\n#### timeout (default: 2)\n\nThe time limit for sending a memcache command and for receiving a memcache reply.\n\n### BUGS\n\nThe  Postfix  memcache client cannot be used for security-sensitive tables such as aliasmaps\n(these may contain  \"|command  and  \"/file/name\"  destinations),  or  virtualuidmaps,  vir‐‐\ntualgidmaps and virtualmailboxmaps (these specify UNIX process privileges or \"/file/name\"\ndestinations).  In a typical deployment a memcache database is writable by any  process  that\ncan  talk  to  the  memcache  server;  in  contrast,  security-sensitive tables must never be\nwritable by the unprivileged Postfix user.\n\nThe Postfix memcache client requires additional configuration when used as  postscreen(8)  or\nverify(8)  cache.   For  details see the backup and ttl parameter discussions in the MEMCACHE\nMAIN PARAMETERS section above.\n\n### SEE ALSO\n\npostmap(1), Postfix lookup table manager\npostconf(5), configuration parameters\n\n### README FILES\n\nUse \"postconf readmedirectory\" or \"postconf htmldirectory\" to locate this information.\nDATABASEREADME, Postfix lookup table overview\nMEMCACHEREADME, Postfix memcache client guide\n\n### LICENSE\n\nThe Secure Mailer license must be distributed with this software.\n\n### HISTORY\n\nMemcache support was introduced with Postfix version 2.9.\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\nMEMCACHETABLE(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "memcache_table",
        "section": "5",
        "mode": "man",
        "summary": "memcachetable - Postfix memcache client configuration",
        "synopsis": "postmap -q \"string\" memcache:/etc/postfix/filename\npostmap -q - memcache:/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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "MEMCACHE MAIN PARAMETERS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "memcache (default: inet:localhost:11211)",
                        "lines": 13
                    },
                    {
                        "name": "backup (default: undefined)",
                        "lines": 26
                    },
                    {
                        "name": "flags (default: 0)",
                        "lines": 3
                    },
                    {
                        "name": "ttl (default: 3600)",
                        "lines": 11
                    }
                ]
            },
            {
                "name": "MEMCACHE KEY PARAMETERS",
                "lines": 42,
                "subsections": [
                    {
                        "name": "domain (default: no domain list)",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "MEMCACHE ERROR CONTROLS",
                "lines": 13,
                "subsections": [
                    {
                        "name": "timeout (default: 2)",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "README FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 16,
                "subsections": []
            }
        ]
    }
}