I've been working on some perl scripting that grabs the rules listed
at  X-Spam-Status:.  I used a simple regex that looks for that line
and the presence of rules:
  if (/^X-Spam-Status:.*test=\n/ && ! /tests=(\s|[Nn]one)/) {
Or really lack of rules.

Then it splits them out and finds the scores based on a pregenerated
(run daily from cron)
file listing all scores (with local additions first) in this format:
 
   score NAME_OF_RULE 2.34

It then inserts a new header (via procmail), just after the one
mentioned above, containing the results in this format:

   X-Spama-Scores: S:SOME_RULE:2.4 D:SOME_OTHER_RULE:1.2 T:3.6

Legend:
  S= System (system specific from local.cf)
  D= Distribution /usr/share/spamassassin/*scores.cf 
  T= Total sum of scores

All this is for a quick way to analyze, first, what source the score
is from (is local stuff being used) second, a way to see quickly if
scoring needs adjustment on spam that slips thru.

I had it mostly done but on actual testing against real mail I think
the newest cvs of spamassassin inserts the header:
   X-Spam-Status:
but it now includes newlines, so my homeboy (simple) regex fail now.
Maybe its my mua doing it? Or is it spamassassin?

My perl is very weak, so I wondered if someone could coach me a bit
on how to id the presence of `X-Spam-Status:' line including any
newlines that may be involved, and whether there is a space or the
string `none' after `tests='.  I think its just a matter of using
perlre that include newlines, but having a problem finding how.

I can think of other ways to do it, but involving more coding.  The
easiest fix would be a regex to replace the simple one I was using.  

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to