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 logThe "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.
More Articles by Anthony Lawrence © 2014-12-09 Anthony Lawrence
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)