[Mailman-Users] help with rather time-sensitive dilemma??

Amanda arandall at auntminnie.com
Fri Jul 13 20:29:20 CEST 2001

"Barry A. Warsaw" wrote:

> - Try to use Python's smtplib module directly to mimic the same calls
>   Mailman is making to see what kind of failure or return value you're
>   getting.

Heh. I hate to say this, but I know just enough perl to make my life easier, and
nothing about python except that which I can infer from reading existing code.
How do I use Python smtplib to mimic this?

> - Try adding a syslog() call to SMTPDirect.py's process() function,
>   inside the "if code >= 500 and code <> 552" clause to log exactly
>   which error codes you're receiving.  Something like:
>   syslog('debug', 'Received error code %d for recipient %s' % (code, recip))
>   Then tail the logs/debug file to see which error codes your
>   getting.  Then try to figure out why qmail is returning these error
>   codes. ;)

Nothing that says "Received error code...." in syslog. I don't appear to have a
log file called debug. Nothing in servicelog or messages. So I figure either I
dinna add it right, or else there's nothing to log. I'm appending a chunk of the
SMTPDirect.py file.

I'm willing to try anything that doesn't involve formatting the hard drive, at
this point...


This is what SMTPDirect.py looks like right now, starting on line 96:

    for recip, (code, smtpmsg) in refused.items():
        # DRUMS is an internet draft, but it says:
        #    [RFC-821] incorrectly listed the error where an SMTP server
        #    exhausts its implementation limit on the number of RCPT commands
        #    ("too many recipients") as having reply code 552.  The correct
        #    reply code for this condition is 452. Clients SHOULD treat a 552
        #    code in this case as a temporary, rather than permanent failure
        #    so the logic below works.
        if code >= 500 and code <> 552:
            # It's a permanent failure for this recipient so register it.  We
            # don't save the list between each registration because we assume
            # it happens around the whole message delivery sequence
### next line AJR 7/13/01 track breakdown delivering remote messages ###
            syslog('debug', 'Received error code %d for recipient %s' %
            mlist.RegisterBounce(recip, msg)
            # Deal with persistent transient failures by queuing them up for
            # future delivery.  TBD: this could generate lots of log entries!
            syslog('smtp-failure', '%d %s (%s)' % (code, recip, smtpmsg))
    if tempfailures:
        msgdata['recips'] = tempfailures
        raise HandlerAPI.SomeRecipientsFailed

More information about the Mailman-Users mailing list