Home | History | Annotate | Line # | Download | only in proto
      1 #++
      2 # NAME
      3 #	memcache_table 5
      4 # SUMMARY
      5 #	Postfix memcache client configuration
      6 # SYNOPSIS
      7 #	\fBpostmap -q "\fIstring\fB" memcache:/etc/postfix/\fIfilename\fR
      8 #
      9 #	\fBpostmap -q - memcache:/etc/postfix/\fIfilename\fB <\fIinputfile\fR
     10 # DESCRIPTION
     11 #	The Postfix mail system uses optional tables for address
     12 #	rewriting or mail routing. These tables are usually in
     13 #	\fBlmdb:\fR, \fBcdb:\fR, \fBhash:\fR, or \fBdbm:\fR format.
     14 #
     15 #	Alternatively, lookup tables can be specified as memcache
     16 #	instances. To use memcache lookups, define a memcache
     17 #	source as a lookup table in main.cf, for example:
     18 #
     19 # .nf
     20 #	    virtual_alias_maps = memcache:/etc/postfix/memcache-aliases.cf
     21 # .fi
     22 #
     23 #	The file /etc/postfix/memcache-aliases.cf has the same
     24 #	format as the Postfix main.cf file, and specifies the
     25 #	parameters described below.
     26 #
     27 #	The Postfix memcache client supports the lookup, update,
     28 #	delete and sequence (first/next) operations. The sequence
     29 #	operation requires a backup database that supports the
     30 #	operation.
     31 # MEMCACHE MAIN PARAMETERS
     32 # .ad
     33 # .fi
     34 # .IP "\fBmemcache (default: inet:localhost:11211)\fR"
     35 #	The memcache server (note: singular) that Postfix will try
     36 #	to connect to.  For a TCP server specify "inet:" followed by
     37 #	a hostname or address, ":", and a port name or number. 
     38 #	Specify an IPv6 address inside "[]".
     39 #	For a UNIX-domain server specify "unix:" followed by the
     40 #	socket pathname. Examples:
     41 #
     42 # .nf
     43 #	    memcache = inet:memcache.example.com:11211
     44 #	    memcache = inet:127.0.0.1:11211
     45 #	    memcache = inet:[fc00:8d00:189::3]:11211
     46 #	    memcache = unix:/path/to/socket
     47 # .fi
     48 #
     49 #	NOTE: to access a UNIX-domain socket with the proxymap(8)
     50 #	server, the socket must be accessible by the unprivileged
     51 #	postfix user.
     52 # .IP "\fBbackup (default: undefined)\fR"
     53 #	An optional Postfix database that provides persistent backup
     54 #	for the memcache database. The Postfix memcache client will
     55 #	update the memcache database whenever it looks up or changes
     56 #	information in the persistent database. Specify a Postfix
     57 #	"type:table" database. Examples:
     58 #
     59 # .nf
     60 #	    # Non-shared postscreen cache.
     61 #	    backup = btree:/var/lib/postfix/postscreen_cache_map
     62 #
     63 #	    # Shared postscreen cache for processes on the same host.
     64 #	    backup = proxy:btree:/var/lib/postfix/postscreen_cache_map
     65 # .fi
     66 #
     67 #	Access to remote proxymap servers is under development.
     68 #
     69 #	NOTE 1: When sharing a persistent \fBpostscreen\fR(8) or
     70 #	\fBverify\fR(8) cache, disable automatic cache cleanup (set
     71 #	*_cache_cleanup_interval = 0) except with one Postfix
     72 #	instance that will be responsible for cache cleanup.
     73 #
     74 #	NOTE 2: When multiple tables share the same memcache
     75 #	database, each table should use the \fBkey_format\fR feature
     76 #	(see below) to prepend its own unique string to the lookup
     77 #	key.  Otherwise, automatic \fBpostscreen\fR(8) or \fBverify\fR(8)
     78 #	cache cleanup may not work.
     79 #
     80 #	NOTE 3: When the backup database is accessed with "proxy:"
     81 #	lookups, the full backup database name (including the
     82 #	"proxy:" prefix) must be specified in the proxymap server's
     83 #	proxy_read_maps or proxy_write_maps setting (depending on
     84 #	whether the access is read-only or read-write).
     85 # .IP "\fBflags (default: 0)\fR"
     86 #	Optional flags that should be stored along with a memcache
     87 #	update. The flags are ignored when looking up information.
     88 # .IP "\fBttl (default: 3600)\fR"
     89 #	The expiration time in seconds of memcache updates.
     90 #
     91 #	NOTE 1: When using a memcache table as \fBpostscreen\fR(8)
     92 #	or \fBverify\fR(8) cache without persistent backup, specify
     93 #	a zero *_cache_cleanup_interval value with all Postfix
     94 #	instances that use the memcache, and specify the largest
     95 #	\fBpostscreen\fR(8) *_ttl value or \fBverify\fR(8) *_expire_time
     96 #	value as the memcache table's \fBttl\fR value.
     97 #
     98 #	NOTE 2: According to memcache protocol documentation, a
     99 #	value greater than 30 days (2592000 seconds) specifies
    100 #	absolute UNIX
    101 #	time. Smaller values are relative to the time of the update.
    102 # MEMCACHE KEY PARAMETERS
    103 # .ad
    104 # .fi
    105 # .IP "\fBkey_digest (default: empty)\fB"
    106 #	After processing the \fBkey_format\fR setting, and before sending
    107 #	a request to the memcache server, run the key through the named
    108 #	message digest algorithm and convert the result to lowercase
    109 #	hexadecimal characters. This prevents a database access error
    110 #	when keys may exceed the memcache server's key length limit
    111 #	(usually, 250 bytes). Specify the name of a message digest
    112 #	algorithm that is supported by OpenSSL, for example, \fBsha256\fR.
    113 #
    114 #	This feature is available in Postfix 3.11 and later, and requires
    115 #	that Postfix is built with TLS support.
    116 # .IP "\fBkey_format (default: %s)\fB"
    117 #	Format of the lookup and update keys that the Postfix
    118 #	memcache client sends to the memcache server.
    119 #	By default, these are the same as the lookup and update
    120 #	keys that the memcache client receives from Postfix
    121 #	applications.
    122 #
    123 #	NOTE 1: The \fBkey_format\fR feature is not used for \fBbackup\fR
    124 #	database requests.
    125 #
    126 #	NOTE 2: When multiple tables share the same memcache
    127 #	database, each table should prepend its own unique string
    128 #	to the lookup key.  Otherwise, automatic \fBpostscreen\fR(8)
    129 #	or \fBverify\fR(8) cache cleanup may not work.
    130 #
    131 #	Examples:
    132 #
    133 # .nf
    134 #	    key_format = aliases:%s
    135 #	    key_format = verify:%s
    136 #	    key_format = postscreen:%s
    137 # .fi
    138 #
    139 #	The \fBkey_format\fR parameter supports the following '%'
    140 #	expansions:
    141 # .RS 
    142 # .IP "\fB%%\fR"
    143 #	This is replaced by a literal '%' character.
    144 # .IP "\fB%s\fR"
    145 #	This is replaced by the memcache client input key.
    146 # .IP "\fB%u\fR"
    147 #	When the input key is an address of the form user@domain,
    148 #	\fB%u\fR is replaced by the SQL quoted local part of the
    149 #	address.  Otherwise, \fB%u\fR is replaced by the entire
    150 #	search string.  If the localpart is empty, a lookup is
    151 #	silently suppressed and returns no results (an update is
    152 #	skipped with a warning).
    153 # .IP "\fB%d\fR"
    154 #	When the input key is an address of the form user@domain,
    155 #	\fB%d\fR is replaced by the domain part of the address.
    156 #	Otherwise, a lookup is silently suppressed and returns no
    157 #	results (an update is skipped with a warning).
    158 # .IP "\fB%[SUD]\fR"
    159 #	The upper-case equivalents of the above expansions behave
    160 #	in the \fBkey_format\fR parameter identically to their
    161 #	lower-case counter-parts.
    162 # .IP "\fB%[1-9]\fR"
    163 #	The patterns %1, %2, ... %9 are replaced by the corresponding
    164 #	most significant component of the input key's domain. If
    165 #	the input key is \fIuser (a] mail.example.com\fR, then %1 is
    166 #	\fBcom\fR, %2 is \fBexample\fR and %3 is \fBmail\fR. If the
    167 #	input key is unqualified or does not have enough domain
    168 #	components to satisfy all the specified patterns, a lookup
    169 #	is silently suppressed and returns no results (an update
    170 #	is skipped with a warning).
    171 # .RE
    172 # .IP "\fBdomain (default: no domain list)\fR"
    173 #	This feature can significantly reduce database server load.
    174 #	Specify a list of domain names, paths to files, or "type:table"
    175 #	databases.
    176 #	When specified, only fully qualified search keys with a
    177 #	*non-empty* localpart and a matching domain are eligible
    178 #	for lookup or update: bare 'user' lookups, bare domain
    179 #	lookups and "@domain" lookups are silently skipped (updates
    180 #	are skipped with a warning).  Example:
    181 #
    182 # .nf
    183 #	    domain = example.com, hash:/etc/postfix/searchdomains
    184 # .fi
    185 # MEMCACHE ERROR CONTROLS
    186 # .ad
    187 # .fi
    188 # .IP "\fBdata_size_limit (default: 10240)\fR"
    189 #	The maximal memcache reply data length in bytes.
    190 # .IP "\fBline_size_limit (default: 1024)\fR"
    191 #	The maximal memcache reply line length in bytes.
    192 # .IP "\fBmax_try (default: 2)\fR"
    193 #	The number of times to try a memcache command before giving
    194 #	up.  The memcache client does not retry a command when the
    195 #	memcache server accepts no connection.
    196 # .IP "\fBretry_pause (default: 1)\fR"
    197 #	The time in seconds before retrying a failed memcache command.
    198 # .IP "\fBtimeout (default: 2)\fR"
    199 #	The time limit for sending a memcache command and for
    200 #	receiving a memcache reply.
    201 # BUGS
    202 #	The Postfix memcache client cannot be used for security-sensitive
    203 #	tables such as \fBalias_maps\fR (these may contain
    204 #	"\fI|command\fR and "\fI/file/name\fR" destinations), or
    205 #	\fBvirtual_uid_maps\fR, \fBvirtual_gid_maps\fR and
    206 #	\fBvirtual_mailbox_maps\fR (these specify UNIX process
    207 #	privileges for "\fI/file/name\fR" destinations).  In a typical
    208 #	deployment a memcache database is writable by any process
    209 #	that can talk to the memcache server; in contrast,
    210 #	security-sensitive tables must never be writable by the
    211 #	unprivileged Postfix user.
    212 #
    213 #	The Postfix memcache client requires additional configuration
    214 #	when used as \fBpostscreen\fR(8) or \fBverify\fR(8) cache.
    215 #	For details see the \fBbackup\fR and \fBttl\fR parameter
    216 #	discussions in the MEMCACHE MAIN PARAMETERS section above.
    217 # SEE ALSO
    218 #	postmap(1), Postfix lookup table manager
    219 #	postconf(5), configuration parameters
    220 # README FILES
    221 # .ad
    222 # .fi
    223 #	Use "\fBpostconf readme_directory\fR" or
    224 #	"\fBpostconf html_directory\fR" to locate this information.
    225 # .na
    226 # .nf
    227 #	DATABASE_README, Postfix lookup table overview
    228 #	MEMCACHE_README, Postfix memcache client guide
    229 # LICENSE
    230 # .ad
    231 # .fi
    232 #	The Secure Mailer license must be distributed with this software.
    233 # HISTORY
    234 # .ad
    235 # .fi
    236 #	Memcache support was introduced with Postfix version 2.9.
    237 # AUTHOR(S)
    238 #	Wietse Venema
    239 #	IBM T.J. Watson Research
    240 #	P.O. Box 704
    241 #	Yorktown Heights, NY 10598, USA
    242 #
    243 #	Wietse Venema
    244 #	Google, Inc.
    245 #	111 8th Avenue
    246 #	New York, NY 10011, USA
    247 #--
    248