procmail
[Top] [All Lists]

How to delete mail after procmail reply

1997-04-26 12:23:00
Hello:

Would appreciate some help to do the following:

1. I would like to reply to all junk/bulk mailing list senders to remove
me from 
their mailing list AND,

2. Delete the original mail that they sent instead of appending to inbox

3. Delete all mails from these mailing lists in case the mailing list
owner does not
remove my address from their mailing lists.

As I have to pay international long distance charge for every mail I
receive, I would very much like the #2 and #3.

Here's the thing that I came up with after modifying some existing code.

--- start of procmailrc code ---

# AUTO-remove from list 
#
#
       :0hW 
       * !^FROM_DAEMON
       {
            FROM=`$FORMAIL -rx To:|sed 's/\(@netcom\)[0-9]*/\1/'`
            SUBJECT="Remove"
            ALREADYSENT=$HOME/.junkmail     # database

            :whci:
            * ! ? fgrep -x -e "$FROM" $ALREADYSENT
            | echo "$FROM" >>$ALREADYSENT

             :ahc
             | ( $FORMAIL -rA"Precedence: junk";\
                cat $HOME/.junkmail.msg ) | $SENDMAIL -t
       }

--- end of procmailrc code ---

The problem with this is that it does not meet requirment #2 & #3 i.e.
it appends the original message to inbox and also appends all subsequent
mail to inbox. [I have no idea how to implement #3 at the same time
receive all my regular mail]

Please copy me on your reply as I am not on the mailing list.

thanks for your help in advance.

Ed


<Prev in Thread] Current Thread [Next in Thread>
  • How to delete mail after procmail reply, Ed <=