On Wednesday, May 15, 2002, at 07:24 PM, Bryan Fullerton wrote:
> + lmtp.sendmail(sender, recipient, checked_data) > + except smtplib.SMTPDataError, errors: > + elif errors.smtp_code/100 == 4: > + sys.exit(75) > + else: > + raise Hey there, that's not going to work too well... an elif with no if. This should be better. --- spamcheck.py.orig Thu May 9 15:00:17 2002 +++ spamcheck.py Wed May 15 19:25:54 2002 @@ -168,9 +168,13 @@ if code != 250: sys.exit(1) #lmtp.set_debuglevel(1) - errors = lmtp.sendmail(sender, recipient, checked_data) - if errors: - sys.exit(1) + try: + lmtp.sendmail(sender, recipient, checked_data) + except smtplib.SMTPDataError, errors: + if errors.smtp_code/100 == 4: + sys.exit(75) + else: + raise else: # too much data. Just pass it through unchanged lmtp = LMTP(lmtp_host) Time to go home, brain tired. :) Bryan -- Bryan Fullerton http://bryanfullerton.com/ Core Competence uunet.ca!gts!cspace!bryanf Samurai Consulting Inc. Powered by Boredom _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk