Postfix memcache client Howto


Introduction

The Postfix memcache client type allows you to hook up Postfix to a memcache server. This implementation supports multiple memcache servers for redundancy, and multiple memcache clients that you can use for different table lookups. The Postfix memcache client supports both lookup and update operations.

Typically, a memcache map is used to reduce query load on a database server, or to share a low-latency database among different Postfix instances.

Limitations

Building Postfix with memcache support

To build Postfix with memcache client support, specify -DHAS_MEMCACHE, the location of the libmemcache include files, and the location of the libmemcache object library.

For example:

% make -f Makefile.init makefiles \
        'CCARGS=-DHAS_MEMCACHE -I/usr/local/include' \
	'AUXLIBS=-L/usr/local/lib -lmemcache'

Then run 'make'.

If the build fails with "undefined reference to `mcm_buf_len'" (and with a similar error message for mcm_buf_remain_off), then you need to edit libmemcache source code.

The following instructions apply to libmemcache 1.4.0.rc2.

Then, continue building Postfix by running 'make'.

Configuring memcache lookup tables

Configuration is described in the memcache_table(5) manpage.

Credits

The first memcache client for Postfix was written by Omar Kilani.

Wietse wrote a new memcache client from the ground up. Besides also using libmemcache, the current implementation bears no resemblance to Omar's work.