9 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Pythonfilter not ...
FromSent OnAttachments
Jérôme BlionMay 12, 2007 10:48 am 
Gordon MessmerMay 12, 2007 11:27 am 
Jérôme BlionMay 12, 2007 11:54 am 
Gordon MessmerMay 12, 2007 1:13 pm 
Jérôme BlionMay 12, 2007 6:40 pm 
Gordon MessmerMay 13, 2007 11:41 am 
Jérôme BlionMay 13, 2007 3:49 pm 
Gordon MessmerMay 14, 2007 10:01 am 
Jérôme BlionMay 14, 2007 10:52 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Pythonfilter not runningActions...
From:Gordon Messmer (yiny@eburg.com)
Date:May 14, 2007 10:01:12 am
List:net.sourceforge.lists.courier-users

Jérôme Blion wrote:

def doFilter(bodyFile, controlFileList): # check for viruses try: pyclamd.init_unix_socket('/tmp/clamd') avresult = pyclamd.contscan_file(bodyFile)

except Exception, e: return "554 " + str(e)

if str(avresult) == 'None': return ''

You don't need to convert avresult to a string. Just do a comparison:

if avresult == None: return ''

if __name__ == '__main__': # we only work with 2 parameter if len(sys.argv) != 2: print "Usage: clamd.py <message_body_file> <controlFileList" sys.exit(0) print doFilter(sys.argv[1], "")

This "usage" text has the same problem as the one in your spamc module.