You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Ryan <sp...@sasknow.com> on 2004/02/26 19:46:42 UTC

More advanced subject_tag'ing?

Hi All,

I currently use quite a simple subject_tag, but I'd like to do more.
Since so many spams use ambiguous subjects (blank, "Hello", "This
friday", etc..), to entice users to open them and see the body, I'd like
to rewrite the entire subject, instead of just tagging it. Ideally, I'd
like to do this from spamassassin (spamass-milter, in my config), so
that I can take advantage of spamassassin's knowledge of the email. 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?)

Thanks,
- Ryan

-- 
  Ryan Thompson <ry...@sasknow.com>

  SaskNow Technologies - http://www.sasknow.com
  901-1st Avenue North - Saskatoon, SK - S7K 1Y4

        Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America



Re: More advanced subject_tag'ing?

Posted by Matt Kettler <mk...@evi-inc.com>.
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)