XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum -> Bayesian Spam Filter

Reply to this topicStart new topicStart Poll

> Bayesian Spam Filter, For all platforms!
hschneider
Posted: Nov 24 2004, 07:37 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



QUOTE

Who are these people who send me mail: ulycufueohvx@proxad.net, dndpfk@anet.net, ltw707oga@chollian.net?

XMail offers a mechanism to run message filters during an SMTP session. There are several XMail filters available that invoke SpamAssassin, written in Perl, and one that does SPF, written in Python.

It is quite easy add to an SMTP filter to XMail. Here's my Spambayes filter which took just several minutes to write, and I've never seen Spambayes before this. It seems to work, too.


CODE

#!/usr/bin/env python

import sys
from spambayes import hammie

hammie_db = '/usr/local/pkg/xmail/hammie.db'

REJECT = 3

def main(argv):
   if len(argv) != 2:
       sys.exit(0)
   filter = hammie.open(hammie_db)
   spam_prob =  filter.score(open(argv[1]))
   if spam_prob >= 0.5:
       sys.exit(REJECT)
   
if __name__ == '__main__':
   main(sys.argv)


QUOTE

hammie.db is the output of sb_mboxtrain.py.

If the filter finishes with exit code 3, XMail drops the message without spooling it to the user mailbox; any other exit code causes XMail to accept the message. A filter may modify the message data, e.g., do the regular Spambayes thing of adding an X-Spam-BlahBlah header.

To turn the filter on, edit the file filters.post-data.tab thusly:


CODE

"/usr/local/bin/sb_xmail.py"    "@@FILE"


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Announcements | Next Newest »

Reply to this topicStart new topicStart Poll