MEMCACHE_TABLE(5) | File Formats Manual | MEMCACHE_TABLE(5) |
memcache_table - Postfix memcache client configuration
postmap -q "string" memcache:/etc/postfix/filename postmap -q - memcache:/etc/postfix/filename <inputfile
The Postfix mail system uses optional tables for address rewriting or mail routing. These tables are usually in dbm or db format.
Alternatively, lookup tables can be specified as memcache instances. To use memcache lookups, define a memcache source as a lookup table in main.cf, for example:
virtual_alias_maps = memcache:/etc/postfix/memcache-aliases.cf
The file /etc/postfix/memcache-aliases.cf has the same format as the Postfix main.cf file, and specifies the parameters described below.
The Postfix memcache client supports the lookup, update, delete and sequence (first/next) operations. The sequence operation requires a backup database that supports the operation.
memcache = inet:memcache.example.com:11211
memcache = inet:127.0.0.1:11211
memcache = inet:[fc00:8d00:189::3]:11211
memcache = unix:/path/to/socket
NOTE: to access a UNIX-domain socket with the proxymap(8) server, the socket must be accessible by the unprivileged postfix user.
# Non-shared postscreen cache.
backup = btree:/var/lib/postfix/postscreen_cache_map
# Shared postscreen cache for processes on the same host.
backup = proxy:btree:/var/lib/postfix/postscreen_cache_map
Access to remote proxymap servers is under development.
NOTE 1: When sharing a persistent postscreen(8) or verify(8) cache, disable automatic cache cleanup (set *_cache_cleanup_interval = 0) except with one Postfix instance that will be responsible for cache cleanup.
NOTE 2: When multiple tables share the same memcache database, each table should use the key_format feature (see below) to prepend its own unique string to the lookup key. Otherwise, automatic postscreen(8) or verify(8) cache cleanup may not work.
NOTE 3: When the backup database is accessed with "proxy:" lookups, the full backup database name (including the "proxy:" prefix) must be specified in the proxymap server's proxy_read_maps or proxy_write_maps setting (depending on whether the access is read-only or read-write).
NOTE 1: When using a memcache table as postscreen(8) or verify(8) cache without persistent backup, specify a zero *_cache_cleanup_interval value with all Postfix instances that use the memcache, and specify the largest postscreen(8) *_ttl value or verify(8) *_expire_time value as the memcache table's ttl value.
NOTE 2: According to memcache protocol documentation, a value greater than 30 days (2592000 seconds) specifies absolute UNIX time. Smaller values are relative to the time of the update.
NOTE 1: The key_format feature is not used for backup database requests.
NOTE 2: When multiple tables share the same memcache database, each table should prepend its own unique string to the lookup key. Otherwise, automatic postscreen(8) or verify(8) cache cleanup may not work.
Examples:
key_format = aliases:%s
key_format = verify:%s
key_format = postscreen:%s
The key_format parameter supports the following '%' expansions:
domain = example.com, hash:/etc/postfix/searchdomains
The Postfix memcache client cannot be used for security-sensitive tables such as alias_maps (these may contain "|command and "/file/name" destinations), or virtual_uid_maps, virtual_gid_maps and virtual_mailbox_maps (these specify UNIX process privileges or "/file/name" destinations). In a typical deployment a memcache database is writable by any process that can talk to the memcache server; in contrast, security-sensitive tables must never be writable by the unprivileged Postfix user.
The Postfix memcache client requires additional configuration when used as postscreen(8) or verify(8) cache. For details see the backup and ttl parameter discussions in the MEMCACHE MAIN PARAMETERS section above.
postmap(1), Postfix lookup table manager postconf(5), configuration parameters
Use "postconf readme_directory" or "postconf html_directory" to locate this information.
DATABASE_README, Postfix lookup table overview MEMCACHE_README, Postfix memcache client guide
The Secure Mailer license must be distributed with this software.
Memcache support was introduced with Postfix version 2.9.
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA