[Spambayes] hammiefilter and hammiecli improvements

Ranieri J D Severiano rjdsnet@yahoo.com
Wed Nov 20 15:41:16 2002


Hi,
What you think about add the "-d" option to hammiefilter.py ?

-----------------
def main():
    action = filter
    opts, args = getopt.getopt(sys.argv[1:], 'hngsd') ### HERE
    for opt, arg in opts:
        if opt == '-h':
            usage(0)
        elif opt == '-g':
            action = train_ham
        elif opt == '-s':
            action = train_spam
        elif opt == "-n":
            action = newdb
        elif opt == '-d':    ###\
            global USEDB     ### - AND HERE
            USEDB = True     ###/
    action()
-----------------



My other suggestion is to fix the print statement of hammiecli.py :


-----------------
def main():
    msg = sys.stdin.read()
    try:
        x = xmlrpclib.ServerProxy(RPCBASE)
        m = xmlrpclib.Binary(msg)
        out = x.filter(m)
        print out.data    ### HERE
    except:
        if __debug__:
            import traceback
            traceback.print_exc()
        print msg
-----------------

Now, you can get the message and pass it to procmail
or another filter.


Thanks,
Ranieri J D Severiano



More information about the Spambayes mailing list