4.73. How do I debug smtp-failure problems - delivery to user@example.com failed with code -1: and Low level smtp error:

Various issues can result in problems occurring in SMTP delivery from Mailman to the outgoing MTA. These can result in various 'failure' messages being logged in Mailman's 'post', 'smtp' and 'smtp-failure' logs.

Some of these messages are more obvious than others such as those indicating an invalid local delivery address. Invalid remote addresses are usually not detected during SMTP from Mailman to the MTA, but invalid local addresses often are. These can result from an invalid address subscribed to a list or entered as an owner or moderator of a list.

Attempts to deliver to invalid local addresses can also result from bogus requests sent to the list's -request, -join, -leave, -(un)subscribe addresses from spoofed invalid local addresses.

All of these invalid addresses are normally handled as bounces, and other than correcting the invalid address of a list member, owner or moderator, no action is normally required.

Less obvious are persistent or intermittent failures such as

 delivery to user@example.com failed with code -1: (110, 'Connection timed out')
 delivery to user@example.com failed with code -1: (-2, 'Name or service not known')
 delivery to user@example.com failed with code -1: Server not connected
 delivery to user@example.com failed with code -1: (4 , 'Interrupted system call')
 Low level smtp error: (111,'Connection refused')

Some of these may result in messages ending up in Mailman's 'retry' queue and being retried with or without success.

FAQ 6.14 <Mail delivery fails with "(-2, 'Name or service not known')", aka I am not receiving any notification messages from Mailman.> addresses one of these and gives some solutions and debugging tchniques which can be applicable to any of these errors.

One simple test is to try to telnet to your smtp server. Try this as an unprivileged user, not root (at least two people have seen problems because /etc/hosts was not world readable).

Check your MTA logs too for messges relating to the failed SMTP transactions.

Also, additional debugging information can be obtained from the underlying python library.

You can get this information in Mailman's 'error' log by altering Mailman/Handlers/SMTPDirect.py as follows.

NOTE: This won't work with python versions older than 2.4. Prior to 2.4, the Python smtplib module wrote its debug output to stdout rather than stderr, and these stdout writes are not captured in Mailman's logs and cause additional problems.

Find

    def __connect(self):
        self.__conn = smtplib.SMTP()
        self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
        self.__numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION

and add a line so it becomes

    def __connect(self):
        self.__conn = smtplib.SMTP()
        self.__conn.set_debuglevel(1)
        self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
        self.__numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION

Then restart Mailman.

Converted from the Mailman FAQ Wizard

This is one of many Frequently Asked Questions.

MailmanWiki: DOC/4.73 How do I debug smtp-failure problems - delivery to user-example.com failed with code -1- and Low level smtp error- (last edited 2015-01-31 02:36:58 by msapiro)