Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

cwest (1514)

  (email not shown publicly)
AOL IM: caseyrwest (Add Buddy, Send Message)

Perl geek.

Journal of cwest (1514)

Thursday December 16, 2004
01:23 PM

Email-Delete Coming Soon

[ #22334 ]

At the London Perl Workshop I got more than a handful of requests that went like this:

Everyone keeps telling me how great this project is but how the heck do I delete a message from a mailbox?!

So when I got home I got started on Email-Delete. All the hard bits are done and I'm waiting on very minor patches to supporting cast members before this hits the CPAN. A small preview of the syntax.

my ($folder, $mid) = @ARGV;
delete_message matching => sub { shift->header('Message-ID') eq $mid },
               folder   => $folder;

The folder can be anything that Email::FolderType recognizes. I allow you to call your own code reference to determine mail to delete. If the code returns a true value the mail will be deleted. Current implementations are for Mbox and Maildir. IMAP will come a little later.

Posted from, comment here.

New comment creation has been disabled on this discussion.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login
Loading... please wait.