procmail
[Top] [All Lists]

Re: "a" or "A" flag

1997-06-29 07:10:00
At 10:49 AM 6/28/97 -0400, Donald E. Hammond wrote:
Hello all -

I've been using procmail for about 6 mos and lurking here getting tips
and info.  Thanks.  Now it's time to work on my .procmailrc file and
I'm unclear on the "a" and "A" flags.

I don't think you need them (see below).

Some quick background.  At this time procmail is used as a SPAM filter,
because that was the pressing need.  (It will soon be used for sorting
as well but that's another story.)  There are recipes that catch
everything known to be good and then recipes that test for SPAM.  Some
of these filter on (From|Reply|Sender|Received) and others on obvious
Subject: lines.  I send SPAM to a file using the "c" flag, then to
/dev/null.  This is redundant, but I am being overly cautious until
certain everything is ok.  My recipes are not aggressive - I don't want
to cut off all communication with the outside world, only that which is
obviously of no interest to me.

I have some recipes like the following (which have apparently worked
fine) but want to do some things like logging $MATCH to get more detail.

# zap obvious Subject lines

      :0 c: 
      * ^Subject:.*(\$\$+|!!+)
      SPAM

      :0 a
      /dev/null

      :0 Dc: 
      * ^Subject:.*(MONEY|FAST|FREE)
      SPAM

      :0 a 
      /dev/null

OK, why use the a (or A) flag at all here?  Instead, just drop the
"c" flags, making those delivering recipes:
        :0:
        * ^Subject:.*(\$\$+|!!+)
        SPAM

        :0 D:
        * ^Subject:.*(MONEY|FAST|FREE)
        SPAM

Or even combine them all:
        :0 D:
        * ^Subject:.*(\$\$|!!|MONEY|FAST|FREE)
        SPAM
(I dropped the "+" since any match to "!!!" also matches "!!", e.g.)

While reading stuff from this list and the man pages, I began to
question whether the "a" flags should be "A".  The man pages read to 
me as though the "a" flag depends on the *two* preceding recipes, but 
in the cases above only one exists.  Am I reading this correctly?

I don't read it that way... maybe you could quote what makes you think
that.  Anyway, "A" and "a" will be identical unless the delivery (writing
to file SPAM in this case) were to fail for some reason.

I want to change these to something like:

       :0 Dc:
       * \/^Subject:.*(MONEY|FAST|FREE)
      {
              LOG="$MATCH
      "
              :0:
              SPAM
      }

       :0 a
       /dev/null

Again, drop the "c" flag and the final recipe.  (If the intent
is to log the whole subject line, I think you'll also need a .*
on the end of the \/ line.)

Hope that helps,
Stan

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