~msapiro/mailman/topics

« back to all changes in this revision

Viewing changes to Mailman/Handlers/SMTPDirect.py

  • Committer: Malte S. Stretz
  • Date: 2010-06-30 14:34:30 UTC
  • mto: (1006.1.110 2.2)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: mss@apache.org-20100630143430-24boi97jjxqknuf1
Added option include_sender_header to suppress rewrite of the Sender header which confuses Outlook (formerly known as FAQ 2.3).  See also <http://mail.python.org/pipermail/mailman-developers/2006-July/019040.html>.  Bug #266824.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
    # the Sender header at all.  Brad Knowles points out that MTAs tend to
356
356
    # wipe existing Return-Path headers, and old MTAs may still honor
357
357
    # Errors-To while new ones will at worst ignore the header.
358
 
    del msg['sender']
 
358
    #
 
359
    # With some MUAs (eg. Outlook 2003) rewriting the Sender header with our
 
360
    # envelope sender causes more problems than it solves, because some will 
 
361
    # include the Sender address in a reply-to-all, which is not only 
 
362
    # confusing to subscribers, but can actually disable/unsubscribe them from
 
363
    # lists, depending on how often they accidentally reply to it.  Also, when
 
364
    # forwarding mail inline, the sender is replaced with the string "Full 
 
365
    # Name (on behalf bounce@addr.ess)", essentially losing the original
 
366
    # sender address.
 
367
    # 
 
368
    # The drawback of not touching the Sender: header is that some MTAs might
 
369
    # still send bounces to it, so by not trapping it, we can miss bounces.
 
370
    # (Or worse, MTAs might send bounces to the From: address if they can't
 
371
    # find a Sender: header.)  So instead of completely disabling the sender
 
372
    # rewriting, we offer an option to disable it.
359
373
    del msg['errors-to']
360
 
    msg['Sender'] = envsender
361
374
    msg['Errors-To'] = envsender
 
375
    if mlist.include_sender_header:
 
376
        del msg['sender']
 
377
        msg['Sender'] = envsender
362
378
    # Get the plain, flattened text of the message, sans unixfrom
363
379
    # using our as_string() method to not mangle From_ and not fold
364
380
    # sub-part headers possibly breaking signatures.