On Thu, 17 Oct 2002, Kenneth Chen wrote:

> Hey Justin:
> 
> Thanks for your answer!  I'm curious about something else, though: does
> your procmail recipe say (in words) "Take whatever has 5 stars OR more and
> pipe it to /dev/null?"  I'm wondering about that last part with the *.*.

That's what the 2nd recipe does.  The first one delivers it to $SPAM_DIR
which is /var/mail/spool/quarantine/spam in this case.  When I actually go
public with my SA setup, I'll just score messages with SA (alter the
subject only if the score is >=10), and keep a copy of all messages
hitting probably 10 for my reporting/logging.  I won't be using procmail
to reject mail unless I have to.  I'm going to pass that duty to the
users.

> And what is the difference between your ".*\(\*\*\*\*\*.*)" and
> "\*\*\*\*\*.*" examples?

The default SpamAssassin X-Spam-Score header looks like

X-Spam-Score: 7.2 (*******)

I can't use that however.  I have a lot of OutLook users and I haven't
found a way to create a filter in LookOut that will match that (and higher
scores).  I came up with a solution though.  Since I'm calling SA from
MIMEDefang, MD makes all the changes to the message.  SA can only score
the message and return the results.  Rearranging the header in MD is
simple.  Mine now looks like:

X-Spam-Score: ******* (7.2)

LookOut can match that.  I can tell LookOut to search all headers for the
entire string "X-Spam-Score: *******" and it will match all messages with
7 OR MORE stars.  Works slick.  Now if you want to have two actions for
your spam, say delete above 10 and move to a "Possible Spam" folder for
5-9, you need to match the rule with the most stars first.  Otherwise you
match on the shorter string of stars will match from 5 to infinity and you
other rule will never be met.

> Thanks -- I really have no experience with syntax of this nature so
> anybody's help would be much appreciated.

The syntax is a royal pain, even for me.  I'm not great at regexs.  You
can pick it up from looking at the example recipes, other peoples'
recipes, or trial and error.  The asterisk is a special character that has
a certain meaning in a regex.  To use it as a basic character you have to
"escape" it.  ie, put a slash in front of it.

\*   will match a single star.

Now you also have to allow for other characters on the line.  That's where
the 
".* comes in to play.

X-Spam-Score: \*\*\*\*\*.*   matches the string "X-Spam-Score: *****" and
anything after it.  The "^" means beginning of line.  The "$" by itself
means end of line.  For example:

grep bash$ /etc/passwd to see who all is smart and uses bash for their
shell. :)

I know enough regex stuff to be dangerous.  It comes in time though.

HTH
Justin



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to