Jérôme Blion wrote: > #!/usr/bin/python > # spamassassin -- Courier filter which scans messages with spamassassin > # Copyright (C) 2004 Robert Penz <[EMAIL PROTECTED]> >
You should use your own copyright string here. > ... > > def doFilter(bodyFile, controlFileList): > # check for viruses > try: > cmd = '/usr/bin/spamc -c < ' + bodyFile > (status,output) = commands.getstatusoutput(cmd) > > except Exception, e: > return "554 " + str(e) > > if status != 0: > return '554 Mail rejected - spam detected: '+ output > return '200 Spamassassin score: '+ output > You probably don't want to return a 200 code. Your spamassassin module will stop other filters from running. See the "README.hacking" file. > if __name__ == '__main__': > # we only work with 2 parameter > if len(sys.argv) != 2: > print "Usage: spamassassin.py <message_body_file> <controlFileList>" > sys.exit(0) > print doFilter(sys.argv[1], "") > Your "usage" text tells users to give two arguments, but the function will not run the filter unless only one is given. You should fix that, too. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
