procmail
[Top] [All Lists]

Re: Deleting a single e-mail from a mailbox - mbox format

2001-08-09 05:34:57
* Odhiambo Washington <wash(_at_)wananchi(_dot_)com> [010809 08:03]:
* Barrett W Clark <mgronduty(_at_)texoma(_dot_)net> [20010809 08:42]: writing 
on the subject 'Re: Deleting a single e-mail from a mailbox - mbox format'
Odhiambo,

I think you could use pine. (please correct me if I am wrong.)

i.e...pine -f /var/mail/some_mailbox

You should be able to view the mailbox and delete the problem e-mail.

Very correct and I can also use elm -f some_mailbox but that is not what I
wanted to do.
Say I have 2k mailboxes and someone has sent a mass mail to all those
mailboxes and I want to delete that mail before the others retrieve it.
I would want to match some condition, either From: or Subject: and pass
all these mailboxes to procmail somehow, you see the point why I asked
this on the procmail list and not pine-users ;-)

So this email has already been sent to 2k mailboxes and you want to get
rid of it.  You'd be using procmail as a postprocessor in this case.
Here's an idea.  Very, very, very untested.  Wouldn't it be funny if you
mangled 2k mailboxes?  And you would owe it all to me.. ;-)

#!/bin/bash

SPOOL=/path/to/your/mail/spool
BOXES=`ls $SPOOL`

cd $SPOOL
for mailbox in $BOXES
do
    tmpbox=/tmp/$mailbox
    mv $mailbox $tmpbox
    formail -s procmail -m rcfile <$tmpbox
    rm $tmpbox
done

-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
"Don't be too proud of this technological terror you've constructed. The
ability to destroy a planet is insignificant next to the power of the
Force." 
  -- Darth Vader
--
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail