[Mailman-Users] Return Path

Mark Sapiro msapiro at value.net
Tue Jun 28 05:54:45 CEST 2005


Petra Humann wrote:
>
>I'm running mailman 2.1.5 with Sun Messaging Server.
>
>I noticed, that every mail has two "Return-Path" headers:
>> Return-path: <mylist-bounces at mylist.host.domain.de>
>> Return-path: <original-sender at some.domain.com>
>
>Running mailman version 2.1.1 with sendmail only one
>Return-Path header exists.
>> Return-path: <mylist-bounces at mylist.host.domain.de>
>
>Are two Return-Path headers okay?


Not really, but they shouldn't cause the following problem.

Section 4.4 of RFC 2821 - SMTP which can be found at
http://www.faqs.org/rfcs/rfc2821.html is the standard which covers the
use of Return-Path: headers.

When mail is delivered from the SMTP environment to an 'outside'
destination, the delivering server MUST add a Return-Path: header
containing the envelope sender information. The MTA that finally
delivers to Mailman inserts the

Return-path: <original-sender at some.domain.com>

header, and the MTA that finally delivers the post from Mailman to the
recipient inserts the

Return-path: <mylist-bounces at mylist.host.domain.de>

header.

The issue is the removal of the first Return-Path: header in the
process of delivery from Mailman to recipient. The standard says that
the MTA making final delivery MAY (not MUST) remove Return-Path:
headers before adding its own. It also says that gateways from
elsewhere to SMTP SHOULD delete any Return-Path: header from the
message which seems to say that Mailman should do this before sending
the message, but it doesn't. It could easily be done in the
bulkdeliver() method in Mailman/Handlers/SMTPDirect.py, but comments
there seem to indicate that Mailman relies the outgoing and/or final
delivery MTA to do it.

Thus we have the situation where your messages wind up with two
Return-Path headers in your particular configuration although some
recipients may see only one if the MTA doing final delivery to them
removes the first.


>Some mails fail,the notifications to the postmaster include the
>reason, e.g.:
>
>> Sat, 25 Jun 2005 21:25:08 +0200 (MEST)
>> Error reading SMTP packet; response to RCPT TO command expected
>
>I assume, that the two Return-Path headers are the reason.
>How do I correct this?

I don't think this is the reason, but I may be wrong. Do the failures
occur consistently for the same subset of recipients? If so, it might
be the extra Return-Path, but it doesn't seem to me that this would
result in the specific reported error.

If you want to delete the first Return-Path in Mailman to test this,
you could edit the Mailman/Handlers/SMTPDirect.py module. In this
module you will see

def bulkdeliver(mlist, msg, msgdata, envsender, failures, conn):

followed by several lines of comments followed by

    del msg['sender']
    del msg['errors-to']
    msg['Sender'] = envsender
    msg['Errors-To'] = envsender

Change these by adding one line as follows:

    del msg['sender']
    del msg['errors-to']
    del msg['return-path']
    msg['Sender'] = envsender
    msg['Errors-To'] = envsender

Be sure the added line is indented exactly the same as the others and
with spaces, not tab.

After editing, restart mailman to pick up the change.

--
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list