How to get the IMAP Tools


EQ Forum Admin
Staff member

Are you looking for a great set of IMAP Tools to help support projects within your email environments?

These IMAP scripts can be purchased here - Download IMAP Tools

They are helpful for a variety of purposes including:

  • copying email for your accounts & domains from old to new hosting providers
  • keeping a backup of your email hosted on your own server
  • large email migration projects where you only have access to IMAP and not the storage of the source servers
Also, if you find a problem or need a feature, the author is available to help with updating the scripts.

Please post any questions about the IMAP Tools in our free IMAP Tools Support Forum
Last edited:


IMAP Tools
New IMAP Tool: imap_search

Administrators sometimes have the need to learn whether a particular message has been delivered to a user or to get a list of messages from a certain sender (for example). imap_search makes it easy to do that. For example: from=james.smith

Folder Date Subject
Drafts 01 Dec 2013 09:12:13 Important news!
INBOX 03 Dec 2013 10:20:33 Holiday party

You can search on just about any field in the header or the body for that matter.

List messages after December 1, 2013: linda.smith sentsince=01-Dec-2013
List Unseen messages joe.jones Unseen
Compound searches: from=joe or from=jim is used to search a user's mailbox for messages matching a set of search criteria. By default all folders are searched but you can limit the search to a single folder if desired.

For example, let's say you want to find all messages sent by john.lombard:

You can combine filter expressions as well:

OR from=tom from=charles

AND subject=test from=marie

"subject=sales meeting" NOT from=linda

from=Mary subject=notification

subject=password NOT subject=new




"body=agenda for today"

Note that the SEARCH command is not a very sophisticated command as specified by the IMAP RFCs so you will want to keep your searches fairly simple. If your search expression is not acceptable to IMAP you'll get a syntax error. After some testing you will find what works on your IMAP server (some fields aren't searchable on some servers while they work on others. It seems to be implementation-specific).

In some cases you have to insert 'header' to tell the IMAP server to search the ENVELOPE rather than the content header: header Received=xxxxx.

Administrator mode
It is a pain having to supply a user's password with each search so imap_search supports admin mode where you can give the administrator's username and pwd instead. For example: host/user:admin_user/admin_password

Configuration file
Another way to simplify searching is by setting up an imap_search configuration file with the following lines:

admin_user: administrator
admin_pwd: secret

You can put the config file in your local directory, /etc, /usr/bin, or /var/tmp and imap_search will find it. Then you just have to supply the username instead of host/user/password:

./ user from=somebody

Much easier, isn't it?

Single folder search
By default imap_search searches all folders but you may want to narrow the search to save time, for example by searching just the inbox. To limit the search place the name of the folder at the end of the access string like this:



o Searches are case-insensitive
o Mailbox names are case-sensitive except for the inbox
o Regular expressions are not permitted
o Wildcards are implied, eg subject=test matches every subject which has the string "test" in it
o Search values containing spaces must be quoted: suubject="this is the day"
o "Body" searches take longer since the body of each message has to be searched
o Dates must be in DD-MM-YYYY format without the timestamp or timezone
o See the IMAP RFC for a listing of all IMAP SEARCH keywords or visit:

Imap.Search Method (Boolean, String, String)



EQ Forum Admin
Staff member
Hi David,

@rfs9999 is aware you made the purchase and will be getting you access.

Please be patient since I copied the tool over to this site since it wasn't online anymore and bits of it need to be set back up.



EQ Forum Admin
Staff member
Hi David,

I see that Rick emailed you yesterday. Is the tool working OK for you now?