[Mailman-Users] Mailman silently discard messages

Mark Sapiro mark at msapiro.net
Fri Sep 25 01:20:30 CEST 2009

Chris Miller wrote:
>In this case we have an email address hosted by Google's business mail
>services, that forwards to the Mailman list on a remote server.
>I setup a test forwarded and confirmed that Google is in fact added the
>X-BeenThere: header. I'm assuming that Google just added this header a
>few days ago, since the list worked fine before that.
>Also email sent to the list's local address (not routed via Google) work
>just fine.

Are you sure it is Google adding this header. I get mail forwarded from
Google mail and the only headers of this type it adds are

X-Forwarded-To: mark at msapiro.net
X-Forwarded-For: msapiro at value.net mark at msapiro.net

>We have *"require_explicit_destination*" set, with the Google hosted
>email address 
>listed in the "*acceptable_aliases*".
>I disabled *require_explicit_destination*
>and removed the acceptable aliases, however the problem still exists.

require_explicit_destination is processed by the Hold handler. Approve
has deleted the message long before it gets there.

>I'm not certain I'm reading the code correctly, but it appears that
>Mailman (version 2.1.5) is only looking for the presence of the
>X-BeenThere: header, not comparing the contents to the list address :
>    # has this message already been posted to this list?
>    beentheres = [s.strip().lower() for s in msg.get_all('x-beenthere', [])]
>    if mlist.GetListEmail().lower() in beentheres:
>        raise Errors.LoopError

This code is correct. It says make a list, beentheres, of the values of
all the X-BeenThere: headers of the message (lower cased and stripped
of leading and trailing whitespace). Then if this list's posting
address (lower cased) is in that beentheres list raise the LoopError
exception which results in the message being discarded.


It seems really strange that Google would add an X-BeenThere: header
with the forward-to address, but if in fact they are, you have to take
this up with them.

You could remove the code you quote above from Approve.py, but then you
run the risk of mail bombing the list if there is a real loop.

You could also change the name of the header from X-BeenThere to say
X-X-BeenThere. to do that, you would replace 'x-beenthere' in the code
you quote above from Approve.py with 'x-x-beenthere' and change the

    msg['X-BeenThere'] = mlist.GetListEmail()

in Mailman/Handlers/CookHeaders.py to

    msg['X-X-BeenThere'] = mlist.GetListEmail()

You'd also need to change 'x-beenthere' to 'x-x-beenthere' one place in
cron/gate_news if you are doing any usenet to Mailman gatewaying.

Mark Sapiro <mark at msapiro.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