IMAP Tools examples

IMAP Tools are simple and easy to use even though they are flexible and powerful. Here are some examples:

imapcopy
imapcopy example

We want to copy all of our folders and messages from host1 to host2. We need the username and password on host1 and the username and password on host2.

	imapcopy.pl -S host1/user1/password1 -D host2/user2/password2

imapcopy.pl starting

Connected to host1 on port 143
Connected to host2 on port 143

Number of mailboxes to process: 7

Copied 60 messages to Big-Box
Copied 31 messages to Drafts
Copied 6025 messages to INBOX
Copied 32 messages to NOTES/2010
Copied 900 messages to NOTES/2011
Copied 525 messages to NOTES/2012/DRAFTS
Copied 633 messages to Sent
Copied 9226 total messages
Done

Wasn't that easy enough?

imapcopy has many configuration settings to control how it works, such as copying a single folder or excludng a folder from being copied, copying messages between a ranges of dates, copying only messages which don't already on the destination server, and so on. Please refer to imapcopy.pl description for details.

In addition to command-line mode imapcopy can also be used from a Web browser. Please see the IMAP Tools User Guide (Section 8) for details on how to install, configure, and use imapcopy as a Web browser application.

imapfilter
imapfilter example

Let's say we want to move all messages in our Inbox whose Subject has a certain value. imapfilter makes that a simple task. All we have to do is to create a Rules File to tell imapfilter what to do. In the Rules File we put the following line:

Subject   "Parts Order"   INBOX  ORDERS 

When we run imapfilter all messages in the INBOX whose subject is Parts Order will be moved from the Inbox to the ORDERS folder. Let's see how that looks:

	imapfilter.pl -S host1/john/mypassword1 -r rules.dat
   
Checking for filter matches
   msgnum 10 in Inbox matches rule: 'Subject "Parts Order" Inbox ORDERS'
   msgnum 11 in Inbox matches rule: 'Subject "Parts Order" Inbox ORDERS'
   msgnum 50 in Inbox matches rule: 'Subject "Parts Order" Inbox ORDERS'
   msgnum 51 in Inbox matches rule: 'Subject "Parts Order" Inbox ORDERS'
   msgnum 52 in Inbox matches rule: 'Subject "Parts Order" Inbox ORDERS'

5 total messages moved

imapfilter lets you filter messages based on all sorts of criteria including but not limited to the following:

You can put multiple rules in the rules file. Rules can be exact matches or they can utilize Regular Expressions.

For more information on imapfilter please see imapfilter.pl or download the IMAP Tools Users Guide.

imapsync
imapsync example

If we have the need to synchronize an account on one host (host1) with another (host2) then imapsync.pl can be used to do it.

When imapsync runs it compares the user's account on host2 against the account on host1. Any messages on host1 which are not on host2 are added to host2. Messages which have been modified on host1 are also modified on host2. And messages which have been deleted from host1 are deleted from host2.

	imapsync.pl -S host1/user1/password1 -D host2/user2/password2

Inserting message <200.LNX.4.61.0411220828410.2225@Tikd>
Inserting message <456.LNX.4.61.0411230950090.2141@Tikd>
Inserting message <200411021538.36718@exponet.com>
Inserting message <129543087.20041102152150@spanm.org>
Inserting message <16110728103.20041102155828@msnet.com>
Deleting message <161128103.2004155828@msnet.com>

Summary of results
   Added   5
   Updated 0
   Deleted 1

IMAP Tools Home