~msapiro/mailman/topics

« back to all changes in this revision

Viewing changes to Mailman/Handlers/SMTPDirect.py

  • Committer: Mark Sapiro
  • Date: 2010-07-03 20:56:47 UTC
  • mfrom: (1006.3.2 2.2)
  • mto: (1006.1.254 2.2)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: mark@msapiro.net-20100703205647-rdmmmctwensqq10v
Merged optional Sender: header feature from lp:~mss/mailman/2.2-sender-header.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2009 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
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.