|
home | projects libical | misc | php-js | php-json | postfix_memcached |
||
postfix_memcachedpostfix_memcached is a patch to the postfix MTA to make it use memcached as a map source. It requires libmemcache. DownloadVersion 1.0.0 for Postfix 2.1.x - Released 2005-04-01 Version 1.0.0 for Postfix 2.2.x - Released 2005-04-01 Documentation(Based on the documentation for pgsql map support.) IntroductionThe 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. Building Postfix with memcached supportIn 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. Configuring memcached lookup tablesOnce 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 information telling postfix how to reference the memcache instance(s). For a complete description, see the memcache_table(5) manual page. Example: local aliases# # 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 # If the email address being rewritten is user@domain.com, then # this line asks memcache for the key user:mail_alias. key_format = %u:mail_alias CreditsThis 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. 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. The memcached changes were done by Omar Kilani. |