At 01:46 PM 2/26/2004, Ryan wrote:
What
I'd *really* like is a way to rewrite the subject with, say, five or ten
of the top Bayes hits from the message. If someone sees a message with a
subject of "[spam] Viagra doctor prescription cheap guaranteed", they'll
pass it by much more quickly.

How hard would it be to rewrite the subject like this, either from
SpamAssassin, or perhaps something else down the chain (but then, how
will the Bayes tokens get identified again?)

Yes, that would be tricky to rewrite the subject like that... you'd have to modify the SA code in a fairly invasive way to accomplish it.


1) you'd have to add support for keeping track of the list of bayes tokens that the email matched. This kind of information isn't currently used by parts of SA outside the bayes engine itself, so I don't think there's any globally exposed list of them that PerMsgStatus.pm can get at. I could be wrong however. Look at sub scan in Bayes.pm

2) Sorting them and selecting the top 5 shouldn't be hard from there, but you'd need to do that.

3) you'd have to create a "subject_rewrite" keyword and implement it. Not hard, it'd be a lot like subject_tag

4) you'd have to add _BAYESTOKS_ as a placeholder tag and implement that. (Currently the closest is _BAYES_ which gets replaced by the bayes score)






Reply via email to