Setting score based on SpamAssassin score

Setting score based on SpamAssassin score

Post by Tim Vro » Thu, 12 Sep 2002 00:18:31



Hi,

I'd like to be able to sort by spamassasin score things that end up in
my inbox.  I've noticed the score directive in muttrc, can I set it to
capture that from the e-mail header or do I have to setup a number of
score directives?

Any help would be much appreciated.

--Tim

 
 
 

Setting score based on SpamAssassin score

Post by Andre Berge » Thu, 12 Sep 2002 02:35:49



Quote:> I'd like to be able to sort by spamassasin score things that end up in
> my inbox.  I've noticed the score directive in muttrc, can I set it to
> capture that from the e-mail header or do I have to setup a number of
> score directives?

> Any help would be much appreciated.

Tim,

source . "/usr/local/bin/spamassassin2muttscore|"
source . "~/.mutt/mutt.blacklist"
source . "~/.mutt/mutt.whitelist"

#!/bin/bash
#/usr/local/bin/spamassassin2muttscore

rm $HOME/.mutt/mutt.blacklist 2> /dev/null
rm $HOME/.mutt/mutt.whitelist 2> /dev/null

cat $HOME/.spamassassin/blacklist | while read addr; do
        [ -n '$addr' ] && echo "score \"~f "$addr"\" -9999" >> $HOME/.mutt/mutt.blacklist
done

cat $HOME/.spamassassin/whitelist | while read addr; do
        [ -n '$addr' ] && echo "score \"~f "$addr"\" 20" >> $HOME/.mutt/mutt.whitelist
done

This is only a part of my fairly complicated setup. But you get the
idea. Note: These are long lines.

-Andre

 
 
 

Setting score based on SpamAssassin score

Post by Andre Berge » Thu, 12 Sep 2002 02:52:19




> > I'd like to be able to sort by spamassasin score things that end up in
> > my inbox.  I've noticed the score directive in muttrc, can I set it to
> > capture that from the e-mail header or do I have to setup a number of
> > score directives?

> > Any help would be much appreciated.

> Tim,

> source . "/usr/local/bin/spamassassin2muttscore|"
> source . "~/.mutt/mutt.blacklist"
> source . "~/.mutt/mutt.whitelist"

> #!/bin/bash
> #/usr/local/bin/spamassassin2muttscore

> rm $HOME/.mutt/mutt.blacklist 2> /dev/null
> rm $HOME/.mutt/mutt.whitelist 2> /dev/null

Sorry, something is missing here (replace the above two lines with
it)

cat $HOME/.spamassassin/user_prefs | egrep "^blacklist" | mawk '{print $2}' > $HOME/.spamassassin/blacklist
cat $HOME/.spamassassin/user_prefs | egrep "^whitelist" | mawk '{print $2}' > $HOME/.spamassassin/whitelist

Quote:> cat $HOME/.spamassassin/blacklist | while read addr; do
>         [ -n '$addr' ] && echo "score \"~f "$addr"\" -9999" >> $HOME/.mutt/mutt.blacklist
> done

> cat $HOME/.spamassassin/whitelist | while read addr; do
>         [ -n '$addr' ] && echo "score \"~f "$addr"\" 20" >> $HOME/.mutt/mutt.whitelist
> done

> This is only a part of my fairly complicated setup. But you get the
> idea. Note: These are long lines.

Sorry!

-Andre

 
 
 

Setting score based on SpamAssassin score

Post by Andre Berge » Thu, 12 Sep 2002 02:59:17




> > I'd like to be able to sort by spamassasin score things that end up in
> > my inbox.  I've noticed the score directive in muttrc, can I set it to
> > capture that from the e-mail header or do I have to setup a number of
> > score directives?

> > Any help would be much appreciated.

> Tim,

> source . "/usr/local/bin/spamassassin2muttscore|"
> source . "~/.mutt/mutt.blacklist"
> source . "~/.mutt/mutt.whitelist"

> #!/bin/bash
> #/usr/local/bin/spamassassin2muttscore

> rm $HOME/.mutt/mutt.blacklist 2> /dev/null
> rm $HOME/.mutt/mutt.whitelist 2> /dev/null

Sorry again,

replace the two "rm " lines with:

cat $HOME/.spamassassin/user_prefs | egrep "~blacklist" | mawk '{print $2}' > $HOME/.spamassassin/blacklist
cat $HOME/.spamassassin/user_prefs | egrep "~whitelist" | mawk '{print $2}' > $HOME/.spamassassin/whitelist

Quote:> cat $HOME/.spamassassin/blacklist | while read addr; do
>         [ -n '$addr' ] && echo "score \"~f "$addr"\" -9999" >> $HOME/.mutt/mutt.blacklist
> done

> cat $HOME/.spamassassin/whitelist | while read addr; do
>         [ -n '$addr' ] && echo "score \"~f "$addr"\" 20" >> $HOME/.mutt/mutt.whitelist
> done

> This is only a part of my fairly complicated setup. But you get the
> idea. Note: These are long lines.

-Andre
 
 
 

Setting score based on SpamAssassin score

Post by Sven Gucke » Thu, 12 Sep 2002 09:25:39



Quote:> I'd like to be able to sort by spamassasin score things
> that end up in my inbox.  I've noticed the score directive
> in muttrc, can I set it to capture that from the e-mail
> header or do I have to setup a number of score directives?

there is no code in mutt for every possible score system - sorry.

Sven

 
 
 

1. Troubleshooting IMAPAssassin, Mail::SpamAssassin, Check Msg always returns 0 point score

I am trying to evaluate SpamAssassin 2.55 on a per user install
 through IMAPAssassin. (perl 5.008)

When the message is passed to Mail::SpamAssassin,
  the score always comes back as 0 point,
 If the message is written to a file,
  then passed to spamassassin -t < input > output,
  the score points are valid.

my $SpamTest = new Mail::SpamAssassin
({'userprefs_filename'=>$SAFile});
my $IMAP = Mail::IMAPClient->new;

$Message = $IMAP -> message_string($MID);
   # Gets message from IMAP ok

my $MessageObject = $SpamTest -> check_message_text($Message);
my $IsSpam = $MessageObject -> is_spam();

if ($IsSpam) {  ...
   # Always returns as not Spam

print "\n",($MessageObject -> get_report ()),"\n";
   # Report on the msg looks as expected (per user conf)
   # EXCEPT ALWAYS HAS 0 POINTS !

open TESTFILE,">$TestFile$MID.txt";
print TESTFILE $Message;
close TESTFILE;
   # If I write the messages to files
   # then run spamassassin -t < TestFile > TestFile-sa
   # Report in TestFile-sa looks as expected (per user conf)
   # including valid points !

2. Remote Users of Exchange being Disconnected.

3. expr and scoring script not working in procmailrc

4. Fiber optic Mux/demux

5. procmail scoring of spam

6. Just for fun

7. Bouncing file between gec.kl.ac.uk and info-a16@score.stanford.edu

8. Problem with AWGS

9. scoring on realname

10. Scoring system

11. Problem with regexp in score

12. Scoring an individual article on-the-fly?

13. Scoring questions, index_format questions.