Open Bug 378080 Opened 17 years ago Updated 2 years ago

Ability to filter messages on spamassassin score

Categories

(MailNews Core :: Filters, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: bugzilla, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: 2.0.0.0 (20070326)

I'd love to see better integration between Thunderbird & Spamassassin.

Currently I can "Trust junk mail headers set by" SpamAssassin.  This is great, but I would love to go another step and be able to setup Thunderbird filters that operate on the SpamAssassin score.

e.g.  Immediately trash everything with a score about 5.  For messages with a score between 2 and 5, move to a folder called VeryLikelySpam. For messages with a score between 0 and 2, move to a folder called SuspectedSpam.

The only missing portion right now is the ability to reference the score in the filter editor.  The editor can already compare to fixed numbers, move messages, etc.

Additionally I'd love to see the SpamAssassin score in the message list as another column.  There is already another bug report for that request.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Why not set up a normal filter to do this? Sounds doable with current design, bug 19442 could make it clean...
Magnus,

Thanks for your suggestion, but I don't see a way to achieve this with the current design.  The problem as I see it, is that I need to make a decision based on a decimal number that is embedded in a header line.  For example, a header line looks like:

X-Spam-Status: No, score=4.4, required=5.0 tests=BAYES_50,HTML_30_40, HTML_IMAGE_ONLY_12,...

So I need a mechanism to pull out the 4.4 (which could be positive or negative) and make a decision on whether it is greater or less than a fixed number.

e.g. on the header line "X-Spam-Status:", pull out the number after "score=" and then compare it to another number.

See what would be needed?  I'm pretty sure that isn't currently feasible.  If it is, please help me out.
I meant you could make a filter
if X-Spam-Status Contains score=4. or X-Spam-Status Contains score=5. etc.

It's a bit primitive, but still...
I see.  Thanks for the idea -- I can experiment with that.  It's definitely not very intuitive for an average computer user. ...and a bit of a pain to setup up repeatedly for each email account.

It could get really messy since spam scores commonly go up to 30.  Fortunately since I have control over the spamassassin settings, I can mark the subject lines if the score exceeds a particular value (so I can catch a big range that way with one rule).
Server filters for SpamAssassin and SpamPal are ordinary filters like message filters. You could create your own message filter first and place it into the isp folder of your Thunderbird installation. There are already SpamAssassin.sfd and SpamPal.sfd. Have a look how they shall look like.

A modification of the filter criteria isn't be possible for users with limited rights on the application folder. IMO it's not a good idea to add a possibility to modify a server filter. As the preference say, we trust the server filter and only mark a message as junk, when it's already marked as junk by SpamAssassin.

Phil, what do you think?
When I have integrated SA into other email clients, for example Outlook, the standard way to do that was to configure SA to deliver a header with a number of characters (typically "*") representing the score. I believe the header is called X-Spam-Level.  So then you add a couple of filters, say one which is MaybeSpam looking for X-SpamLevel= ***, and another called for example ReallySpam with X-SpamLevel= ******. That solves the problem of getting numeric codes - but of course it also assumes you have control of your SA configuration, which is not always the case. My current ISP though delivers emails with an appropriate SA header by default.

But really the integration that I want to do of SA into TB is to allow the SA rule firings themselves to show up as tokens in the Bayes filter. That way, our Bayes filter would learn custom ratings of SA rules that are appropriate for the end user, rather than relying solely on the SA score. It's a trivial change to accomplish this (namely to allow "," to be recognized as a token separator in headers) but I need to do some corpus testing to make sure that the effect is as intended. Lots of Good Ideas in spam processing fail when subjected to actual testing, and my Good Ideas are not immune to that.
I'd love to see this in TB3, I've got some messy filters done based on the number of stars but its not pretty, and I don't think most users will figure this out. 

Filtering them to group into "definately spam" "maybe spam" "probably not" is what is needed so that a user can scan for example just the subject lines of the middle categories while just trashing "definately spam".

- Mitra
Assignee: mscott → nobody
Component: General → MailNews: Filters
Product: Thunderbird → Core
QA Contact: general → filters
Version: unspecified → Trunk
No idea if this fits into the timeline for Thunderbird 3 but let us ask for. 
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-thunderbird3?
Here's one way that we might approach this. Currently, we can add custom headers such as X-SPAM-STATUS. But what is needed is the ability to extend that to include numerical fields in the custom headers. So we could parse your custom header definition, with an optional second field after the main header, and then allow filtering on that subfield.

So for example, my Spam Assassin has the following header:

X-Spam-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,
	RCVD_IN_DNSWL_LOW shortcircuit=no autolearn=ham version=3.2.4

If we included subfields, then you could write a test that was:

X-Spam-Status:score      >     5

That would provide the backend capability for what you want. As to exposure of this as an easy to use front end specific to SpamAssassin, that would probably be left to an extension.

This might not work with all varieties of IMAP though.

I think that would work technically and for advanced users - for example I could setup a filter such as "X-Spam-Status:score >5" and "From" Not in OSX-Address-Book 

Though most users wouldn 't figure it out without an extension. 

- Mitra


Product: Core → MailNews Core
I think an extension would be the right vehicle for this kind of deep integration w/ SA.
Flags: wanted-thunderbird3-
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3-
I don't get why the SA filter is so sporadic in Thunderbird.  I've set TB to "Trust junk mail headers set by: SpamAssassin", but it only "trusts" about 2/3 of the messages SA says are Spam.

Here is a classic example of one that Thunderbird ignored.:

 http://pastebin.com/fe9ef4b8

See Also: → 1139088
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.