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

IMAP Tools


Some material is very old and may be incorrect today

© December 2015 Anthony Lawrence

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".


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> IMAP Tools


Inexpensive and informative Apple related e-books:

iOS 8: A Take Control Crash Course

Take Control of the Mac Command Line with Terminal, Second Edition

Take Control of Preview

Sierra: A Take Control Crash Course

Take Control of IOS 11





More Articles by © Anthony Lawrence





Printer Friendly Version

Have you tried Searching this site?

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


Printer Friendly Version





The difference between e-mail and regular mail is that computers handle e-mail, and computers never decide to come to work one day and shoot all the other computers. (Jamais Cascio)




Linux posts

Troubleshooting posts


This post tagged:

Kerio Connect

Kerio

Kerio Info

Kerio Pricing

Kerio RSS Feed

Mail



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode