Popen and Razor client

Toorop toorop at cyborgnation.org
Fri Aug 23 19:47:47 CEST 2002


Bonjour ,

  First escuse my english.....
  Second : i want to make a razor client with python in order to add
  this function to my mail scanner (which is in python too).

  But i'm not ok with popen.

  The normal use of razor is :

  $ cat mail | razor-check

  If the exit status of razor-check is 1, the mail is ok, if the exit
  status is 0 the mail is considered has spam for razor.

  In my script, the mail to test is in a string :test_spam.

  My script :
def is_spam_for_razor(test_spam) :
    import popen2
    razor_check="/usr/bin/razor-check"

    in_razor,out_razor=popen2.popen2(razor_check)
    reponse=out_razor.write(test_spam)
    reponse2=in_razor.readline()
    print reponse2

    #close
    in_razor.close()
    out_razor.close()


  But has you can expect, it doesn't work, the script wait, wait,wait...
  If someone could help me.


--
Toorop 

---------------------------------
Mail scanné par Protecmail filter 





More information about the Python-list mailing list