On Wednesday, May 8, 2002, at 07:57 PM, Daniel Pittman wrote:
> Yup. Postfix respects the standard system return codes, so returning one > of those should just do the right thing. You need to detect the problem, > of course, and return the right code. Ok, how about this. Seems to be working for me. --- spamcheck.py.orig Thu May 9 15:00:17 2002 +++ spamcheck.py Wed May 15 19:16:49 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: + elif errors.smtp_code/100 == 4: + sys.exit(75) + else: + raise else: # too much data. Just pass it through unchanged lmtp = LMTP(lmtp_host) I'm not sure if that raise should be a sys.exit(1), but hopefully either should work. When mail is sent to a mailbox with quota exceeded, I now get: May 15 19:09:12 bob postfix/pipe[16995]: 00D1D1E25: to=<[snip]@bob.samurai.com>, relay=spamcheck, delay=6, status=deferred (temporary failure) 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