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.


-------------------------------------------------------------------------
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

Reply via email to