[Spambayes] notate_subject

Tony Meyer tameyer at ihug.co.nz
Mon Oct 20 02:52:36 EDT 2003


> What happened to hammie.py?

It was deprecated a long while back.  You can still access it if you want
to, by using the hammie.py module (in the spambayes directory) as a script,
or by using the hammiebulk.py module.  The recommended method is to use
sb_filter.py and sb_mboxtrain.py or sb_server.py with sb_upload.py (the
former in your case, I would imagine).

> Regardless, you're saying that there's an 
> open ticket which would fix my dilemma?

Yes.

> Iff true, this alone 
> would allow me to switch from SA to SB.  Learning Python 
> seems like fun, maybe I'll idle the devel list and see if 
> there's anything I can do to help.

Good plan :)  The change isn't that difficult to make, but I can't see that
I would be able to get to it before mid November (I'm going away for a
while).  One of the other developers might, though.

Actually, although that is the correct long-term solution, you could add in
subject modification to a local copy yourself without much trouble.  I've
only done a bare minimum of testing this, but it appears to work:
"""
*** hammie.py   Mon Oct 20 19:51:31 2003
--- hammie2.py  Mon Oct 20 19:47:20 2003
***************
*** 116,121 ****
--- 116,125 ----
          else:
              is_spam = False
              disp = options["Headers", "header_unsure_string"]
+         if disp in options["Headers", "notate_subject"]:
+             subj = msg["Subject"]
+             del msg["Subject"]
+             msg["Subject"] = "%s %s" % (disp, subj)
          if train:
              self.train(msg, is_spam, True)
          disp += ("; %."+str(options["Headers",
"header_score_digits"])+"f") % Prob
"""

> I greatly appreciate your assistance, Tony.  Have a great weekend.

No worries, and thanks, I did :)

=Tony Meyer




More information about the Spambayes mailing list