IMAP Tools

Updated: March 23, 2021

Welcome to the IMAP Tools Website! Rick Sanders rfs9999@earthlink.net

What is the IMAP Tools Set? It is a set of Perl programs for use with IMAP servers. IMAP Tools enable you to do a great many things including the following:

What is in the IMAP Tools Set?
E-Mail Attachment Cleaner
IMAP Tools User Guide
IMAP Tools FAQ
Examples
Notes:
Change History
Release Notes
Admin Mode
SSL Support
OAUTH2 Support
CRAM-MD5 Logins
IMAP debugging and tracing

What is in the IMAP Tools Set?

The IMAP Tools set consists of nearly two dozen scripts. Click on the link for a tool to see a description or refer to the IMAP Tools User Guide.

  1. imapcopy.pl
  2. pop3toimap.pl
  3. migrateIMAP.pl
  4. imapsync.pl
  5. imapfilter.pl
  6. imapdump.pl
  7. dumptoIMAP.pl
  8. IMAPtoMbox.pl
  9. MboxtoIMAP.pl
  10. maildir_to_imap.pl
  11. imap_to_maildir.pl
  12. delIMAPdups.pl
  13. delete_imap_mailboxes.pl
  14. thunderbird_to_imap.pl
  15. imapCapability.pl
  16. imapPing.pl
  17. purgeMbx.pl
  18. trash.pl
  19. imap_audit.pl
  20. list_imap_folders.pl
  21. list_account_sizes
  22. imap_search.pl

E-Mail Attachment Cleaner

Would you like to remove attachments from old messages to save space? Or extract attachments from messages and save them? email_attachment_cleaner.pl from IMAP Tools makes that possible!

Selecting messages.
You select the messages to be cleaned of attachments by setting an age threshold which is either a fixed date (DD-MMM-YYYY) or a number of days old (365). email_attachment_cleaner finds the messages older than that date and removes their attachments.
Selecting the size.
You can also set a minimum size such as -s 100 which means only strip attachments from old messages whose size is greater than 100 KB.
Deleting messages
You can choose delete the messages meeting the criteria rather than stripping their attachments. This is set with -a delete_message.
Saving deleted attachments
You may choose to save the attachments removed from messages by setting -O <directory> where directory is where the attachments are to be copied. A user's attachments are written to <directory>/<user>. For example:
/var/attachments/<user>.
Just copy the attachments.
You can save the attachments without stripping them from messages. Set -a just_save_attachments, and E-Mail Attachment Cleaner will copy the attachments to the output directory without removing them from the messages.
Multiple users.
You can run the E-Mail Attachment Cleaner on a single user's account or on a list of users.
Multiple processes.
E-Mail Attachment Cleaner can spin off multiple simultaneous processes for better performance on Linux/Unix/Mac OS and other Unix-like operating systems. On Windows it is limited to a single process since Windows does not support the fork() operation.