Yesterday, I was idly fiddling with the old patch postfix “memcached lookup table” created by Omar Kilani . unfortunately, patches can only be used for old postfix distributions (2.1.x – Released 2005-04-01, 2.2.x – Released 2005-04-01).
I rewrote the patch (code was not modified) so it can be applied against last postfix-2.9-20110706 snapshot.
This patches required memcached and libmemcache .
I was successfully compiled it, but not test it yet whether it will work or not. so it’s not recommended for use on production servers.
$ wget ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/postfix-2.9-20110706.tar.gz $ tar xzf postfix-2.9-20110706.tar.gz $ cd postfix-2.9-20110706
Postfix memcache patch can be download here:
[download#41]
Patch postfix source distribution
$ patch -p1 < ../postfix-2.9-20110706-memcache.patch patching file html/DATABASE_README.html patching file html/Makefile.in patching file html/MEMCACHE_README.html patching file html/memcache_table.5.html patching file man/Makefile.in patching file man/man5/memcache_table.5 patching file proto/DATABASE_README.html patching file proto/Makefile.in patching file proto/MEMCACHE_README.html patching file proto/memcache_table patching file README_FILES/AAAREADME patching file README_FILES/DATABASE_README patching file README_FILES/MEMCACHE_README patching file src/global/dict_memcache.c patching file src/global/dict_memcache.h patching file src/global/mail_dict.c patching file src/global/Makefile.in
Compile postfix source that has been patched with postfix memcached patch. It’s just an example when I compile on my machine. adjust to fit your system environment.
$ make tidy $ make -f Makefile.init makefiles OPT="-O2 -pipe" DEBUG="" CCARGS="-DHAS_MEMCACHE -I/usr/include -DHAS_CDB -DSNAPSHOT -DHAS_PCRE -DHAS_MYSQL -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/lib64/sasl2 -I/usr/include/sasl/ -I/usr/include/mysql/ -DUSE_TLS -DHAS_SSL" AUXLIBS="-lcdb -L/usr/lib64/mysql -lmysqlclient -lmemcache -lz -lm -ldb -lpcre -lsasl2 -lssl -lcrypto" $ make
After the compilation process is completed, tests whether the lookup table has been compiled or not by issuing this command:
$ bin/postconf -m btree cdb cidr environ hash internal memcache mysql nis pcre proxy regexp static tcp texthash unix
Last warning: This patch is not tested. I rewrote Omar Kilani memcache patches postfix just for fun. when I have a headache after fixing a corrupt SAN storage that I use to store the maildir.
Pingback: Postfix, Omar Kilani’s Memcache Patch Try-Out – KutuKupret colorful website
Pingback: postfix, integrating memcache as a lookup table using tcp_table – KutuKupret colorful website