APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

IMAP Tools


2014/12/09

I just came across IMAP Tools thanks to the recommendation of a customer. This is a $35 set of 22 command line IMAP utilities that can be very useful with any mailserver.

The customer who pointed this out to me is using imapfilter.pl to archive large Kerio mailboxes.

For a single user, you'd do something like this:


$ imapfilter.pl -S host/user/password -r rules -L log
 
The "rules" file is a tab delimited file that tells imapfilter what to do. For example, I wanted to move everything in "Sent Items" to a new folder "Sent2014":

From    *       Sent Items      Sent2014
 

That's "From<TAB>*<TAB>Sent Items<TAB>Sent2014".

When I run that, I see this:




/Users/tony/bin/imapfilter.pl starting
Processing messages in batches of 500
apl:notmypassword
Connecting to host mail.aplawrence.com port 143
rule From	*	Sent Items	Sent2014
Checking for filter matches
There are 44 msgs in Sent Items
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   ...
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   Message in Sent Items matches rule: 'From * Sent Items Sent2014'
   Moved 44 message(s) from Sent Items to Sent2014
44 total messages moved
Done
 

Couldn't be simpler. Note: if you happen to be logged into Webmail while doing that, you won't see the new Sent2014 folder until you log out and back in.

You could easily set up a script to do this automatically for yourself or for all users (assuming you have users passwords).

To do that, you need to supply a list of users with their passwords, colon separated. When you invoke imapfilter.pl, you use "-u userfilelist".



Got something to add? Send me email.





Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





If you just want to use the system, instead of hacking on its internals, you don't need source code. (Andrew S. Tanenbaum)

It's a wonderful, wonderful opera, except that it hurts. (Joseph Campbell)







This post tagged: