procmail
[Top] [All Lists]

RE: Help with redundancy

2007-08-02 15:27:02
Poohba wrote Thursday, August 02, 2007 8:44 PM:
Please tell me if any of this is redundant and/or if I can 

I have emails in the trash folder that don't correspond to 
any emails or host in my files

Other processes can deposit mail in mail folders other than
procmail.  For instance, you might have sent records archived
by your MUA.  You might have performed some shell process
that moved or saved messages.  Etc.

## SHELL=/bin/sh

Uncomment this.

PMDIR=$HOME/.procmail

LOGFILE=$PMDIR/killfile

Strange name, but whatever.

MAILDIR=$HOME/mail       # Make sure this directory exists!


:0Wf
* ^From: .*(my different email addresses)
|formail -I"Status: RO"

Add an "h" flag

:0
* ^Subject.*(make your pick for the nba)
|/path/to/draft.cgi `formail -rtzxTo`

:0:
*^(From|Subject).*(daemon|read:)
daemons

:0c:
*^From.*(my different email addresses)
sent-mail

Well, could combine this one with the one above where
you add s Status header.

  :0
  * ^From:.*myotheraddress
  {
     :0 fw h
     | formail -I"Status: RO"

     :0 c:
     sent-mail
  }
   

:0c:
today

Lots of copies, there.


PHONE=$HOME/.phone
FRIENDLIST=$HOME/.friends
BLACKLIST=$HOME/.killfile
TRASH=$HOME/.trash
BLACK=$HOME/.kills
INCLUDERC=$PMDIR/rc.groups

Maybe you might want to put lots of these things
in $PMDIR or $HOME/mail and get them out of your $HOME.

:0c:
* ^From:.*\/[A-Za-z0-9_(_dot_)+-]+(_at_)[A-Za-z0-9_(_dot_)+-]+
* ? grep -i "$MATCH" $FRIENDLIST
friends

Man, you have a lot of copies!


INCLUDERC=$PMDIR/rc.friends
INCLUDERC=$PMDIR/rc.filters
INCLUDERC=$PMDIR/rc.trash


:0fw: spamassassin.lock
* < 256000
| spamassassin

SA won't process messages that big anyway.  You
don't really need the condition, but it doesn't
hurt.


:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
almost-certainly-spam


:0:
* ^X-Spam-Status: Yes
spam



:0:
* ^From:.*\/[A-Za-z0-9_(_dot_)+-]+(_at_)[A-Za-z0-9_(_dot_)+-]+
* ? grep -i "$MATCH" $BLACKLIST
trash

You already grabbed the From: header up above with
whitelists.  Save it to a var and use the var here
instead of parsing it again.


:0:
*$ ? test -s $BLACKLIST
* ? (formail -x From: -x Reply-To: -x Sender: -x From | fgrep -iqf
$TRASH)
trash

You already extracted the From: header not once, but twice
using procmail; and now you're doing it again with formail -x.


:0:
* ^From:(_dot_)*(_at_)\/[a-z0-9_.+-]+
* ? grep -i "$MATCH" $BLACK
trash

And now you're extracting it a fourth time.

Look:

    :0
    * ^From:(_dot_)*(_at_)\/[a-z0-9_.+-]+
    { FROM = $MATCH }

Now use $FROM whenever you need it again subsequently.

-- 
dman
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>