PPoossttffiixx mmeemmccaacchheedd HHoowwttoo

-------------------------------------------------------------------------------

IInnttrroodduuccttiioonn

The Postfix memcache map type allows you to hook up Postfix to a memcached
server. This implementation allows for multiple memcached servers: you can use
one for a virtual(5) table, two for an access(5) table, and three for an
aliases (5) table if you want.

The memcache map type can be used to reduce the load on another map type, e.g.
pgsql. By placing the memcache map before the pgsql map, a key not found in the
memcache will fall through to the database. You'll need to figure out a way to
reverse populate the cache from the database yourself.

This map type can be seen as an alternative to the proxymap(8) service.

BBuuiillddiinngg PPoossttffiixx wwiitthh mmeemmccaacchheedd ssuuppppoorrtt

In order to build Postfix with memcached map support, you specify -
DHAS_MEMCACHE, and the directory where libmemcache resides (both memcache.c and
memcache.h are used.)

For example:

    % make tidy
    % make -f Makefile.init makefiles \
            'CCARGS=-DHAS_MEMCACHE -I/opt/libmemcache'

 Then just run 'make'.

CCoonnffiigguurriinngg mmeemmccaacchheedd llooookkuupp ttaabblleess

 Once Postfix is built with memcache support, you can specify a
map type in main.cf like this:

    /etc/postfix/main.cf:
        alias_maps = memcache:/etc/postfix/memcache-aliases.cf

The file /etc/postfix/memcache-aliases.cf specifies lots of information telling
postfix how to reference the memcache instance(s). For a complete description,
see the memcache_table(5) manual page.

EExxaammppllee:: llooccaall aalliiaasseess

#
# memcache config file for local(8) aliases(5) lookups
#

#
# The memcached servers that Postfix will try to connect to
# If no servers are specified, localhost is used.
# If no port is specified, 11211 is used.

servers = mc01.some.domain mc02.some.domain

# The key_format to use. The default is just to use whatever postfix
# sends us. See memcache_table(5) for more details
key_format = %u:mail_alias

CCrreeddiittss

  * This code is based upon the Postfix mysql map by Scott Cotton and Joshua
    Marcus, IC Group, Inc.
  * The PostgreSQL changes were done by Aaron Sethman.
  * The memcached changes were done by Omar Kilani.
  * Updates for Postfix 1.1.x and PostgreSQL 7.1+ and support for calling
    stored procedures were added by Philip Warner.
  * LaMont Jones was the initial Postfix pgsql maintainer.
  * Liviu Daia revised the configuration interface and added the main.cf
    configuration feature.

