IMAP Mailbox Manipulation for the Masses
From the website, IMAPFilter is;
“…a mail filtering utility. It connects to remote mail servers using the Internet Message Access Protocol (IMAP), sends searching queries to the server and processes mailboxes based on the results. It can be used to delete, copy, move, flag, etc. messages residing in mailboxes at the same or different mail servers. The 4rev1 and 4 versions of the IMAP protocol are supported.”
Basically, it’s the most awesome utility I’ve found to search through large IMAP accounts, performing actions on messages that meet certain criteria. In Ubuntu 9.10, the repo version is 2.0.10 (February 2008), but the latest available version is 2.2 (December 2009), which includes several important fixes and various new features. Unfortunately, compiling the new version in Karmic has a few small gotchas, that might throw-off a few people.
There are a few essential packages we need to install, that might not be found on a standard build system. Don’t forget to accept any other packages your system might suggest;
sudo apt-get install libssl-dev liblua5.1-0-dev libpcre3-dev
Then, we need to download and extract the source code;
cd ~/src
wget http://imapfilter.hellug.gr/source/imapfilter-2.2.tar.bz2
tar jxvf imapfilter-2.2.tar.bz2
cd imapfilter-2.2/
Next comes the unusual bit, we have to create a symlink that the code is expecting;
sudo ln -s /usr/lib/liblua5.1.a /usr/lib/liblua.a
Once this is done, we can follow the standard make procedure;
./configure
make
sudo make install
IMAPFilter should now be correctly built and installed. It doesn’t create a default configuration file for you, as it knows nothing about your E-Mail account or what you want to do with it. Use this great sample configuration file as a basis for your configuration file – http://imapfilter.hellug.gr/sample.config.lua.txt
Note: I’m sure it should be easy to roll something into the code to remove the need for the symlink, but my programming skills are, to be polite, poor.






