Forum: Ruby IMAPCleanse

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-03-29 21:22
(Received via mailing list)
= IMAPCleanse

Rubyforge Project:


== About

IMAPCleanse removes old, read, unflagged messages from your IMAP

== Why?

I'm lazy.  I don't delete read messages from my mailboxes because I
like to
have context when reading threads.  Since I'm lazy my more-trafficed
can end up with tens of thousands of read messages.  Deleting this many
messages with is time consuming and boring.

So I wrote IMAPCleanse to clean out my old mailboxes for me.  If I
want to keep
a message around for forever I'll just flag it and IMAPCleanse won't
touch it.

== Installing IMAPCleanse

Just install the gem:

   $ sudo gem install IMAPCleanse

== Using IMAPCleanse

In short:

   imap_cleanse -H -p mypassword -b Lists/FreeBSD/
current,Lists/Ruby -a 30

The help for IMAPCleanse should be sufficiently verbose, but here's a
couple of

=== --noop and --verbose

The --noop flag tells IMAPCleanse not to delete anything.  When
combined with
the --verbose flag you can see how many messages IMAPCleanse would
have deleted
from which mailboxes.

   $ ruby -Ilib bin/imap_cleanse -nv
   # Connected to
   # Logged in as drbrain
   # Cleansing read, unflagged messages older than 26-Feb-2006 17:04 PST
   # Found 23 mailboxes to cleanse:
   #       mail/Lists/FreeBSD/current
   #       mail/Lists/Ruby/ZineBoard
   # Selected mail/Lists/FreeBSD/current
   # Scanning for messages
   # Found 0 messages
   # Selected mail/Lists/Ruby/ZineBoard
   # Scanning for messages
   # Found 0 messages
   # Done. Found 0 messages in 23 mailboxes

(Since I just ran IMAPCleanse it didn't have anything to do.)

=== ~/.imap_cleanse

The ~/.imap_cleanse file can hold your password and other options so
you don't
have to type them in on the command line every time.  The format is
just the options file name followed by '=' followed by the argument.

No whitespace is stripped from options, so be sure to do that
yourself.  Mine
looks something like this:
   Password=my password

Eric Hodel - -
This implementation is HODEL-HASH-9600 compliant
This topic is locked and can not be replied to.