aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Mailman/Defaults.py.in8
-rw-r--r--Mailman/Gui/General.py23
-rw-r--r--Mailman/Handlers/SMTPDirect.py20
-rw-r--r--Mailman/MailList.py1
-rw-r--r--Mailman/versions.py1
5 files changed, 51 insertions, 2 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index db75971d..e1ede271 100644
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -1040,6 +1040,14 @@ DEFAULT_OBSCURE_ADDRESSES = Yes
# lists with no archives).
ALLOW_RFC2369_OVERRIDES = Yes
+# RFC 2822 suggests that not adding a Sender header when Mailman is the agent
+# responsible for the actual transmission is a breach of the RFC. However,
+# some MUAs (notably Outlook) tend to display the Sender header instead of the
+# From details, confusing users and actually losing the original sender when
+# forwarding mail. By setting this variable to Yes, list owners will be
+# given the option to avoid setting this header.
+ALLOW_SENDER_OVERRIDES = Yes
+
# Defaults for content filtering on mailing lists. DEFAULT_FILTER_CONTENT is
# a flag which if set to true, turns on content filtering.
DEFAULT_FILTER_CONTENT = No
diff --git a/Mailman/Gui/General.py b/Mailman/Gui/General.py
index 8271a30e..21547cb8 100644
--- a/Mailman/Gui/General.py
+++ b/Mailman/Gui/General.py
@@ -414,6 +414,29 @@ class General(GUIBase):
does not affect the inclusion of the other <tt>List-*:</tt>
headers.)"""))
)
+ # Suppression of Sender header modification
+ if mm_cfg.ALLOW_SENDER_OVERRIDES:
+ rtn.append(
+ ('include_sender_header', mm_cfg.Radio,
+ (_('No'), _('Yes')), 0,
+ _("""Should the <tt>Sender</tt> header be rewritten for this
+ mailing list to avoid stray bounces? <em>Yes</em> is
+ recommended."""),
+
+ _(""""<a href="http://www.faqs.org/rfcs/rfc2822.html">RFC
+ 2822</a> defines the <tt>Sender</tt> header and defines it
+ as "the mailbox of the agent responsible for the actual
+ transmission of the message." Mailman replaces this header
+ per default with the list's bounce address.
+
+ <p>While it is debatable if Mailman is such an agent, setting
+ this header helps directing bounces from some broken MTAs to
+ the right destination. On the other hand do some mail
+ readers show unexpected behaviour if this header is set (like
+ missing addresses in forwarded mails and copies sent to the
+ bounce address on reply-to-all), so it can be disabled
+ here."""))
+ )
# Discard held messages after this number of days
rtn.append(
diff --git a/Mailman/Handlers/SMTPDirect.py b/Mailman/Handlers/SMTPDirect.py
index 8e3c7d73..1930a549 100644
--- a/Mailman/Handlers/SMTPDirect.py
+++ b/Mailman/Handlers/SMTPDirect.py
@@ -355,10 +355,26 @@ def bulkdeliver(mlist, msg, msgdata, envsender, failures, conn):
# the Sender header at all. Brad Knowles points out that MTAs tend to
# wipe existing Return-Path headers, and old MTAs may still honor
# Errors-To while new ones will at worst ignore the header.
- del msg['sender']
+ #
+ # With some MUAs (eg. Outlook 2003) rewriting the Sender header with our
+ # envelope sender causes more problems than it solves, because some will
+ # include the Sender address in a reply-to-all, which is not only
+ # confusing to subscribers, but can actually disable/unsubscribe them from
+ # lists, depending on how often they accidentally reply to it. Also, when
+ # forwarding mail inline, the sender is replaced with the string "Full
+ # Name (on behalf bounce@addr.ess)", essentially losing the original
+ # sender address.
+ #
+ # The drawback of not touching the Sender: header is that some MTAs might
+ # still send bounces to it, so by not trapping it, we can miss bounces.
+ # (Or worse, MTAs might send bounces to the From: address if they can't
+ # find a Sender: header.) So instead of completely disabling the sender
+ # rewriting, we offer an option to disable it.
del msg['errors-to']
- msg['Sender'] = envsender
msg['Errors-To'] = envsender
+ if mlist.include_sender_header:
+ del msg['sender']
+ msg['Sender'] = envsender
# Get the plain, flattened text of the message, sans unixfrom
# using our as_string() method to not mangle From_ and not fold
# sub-part headers possibly breaking signatures.
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 6083fb12..45ce6f09 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -363,6 +363,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
self.available_languages = []
self.include_rfc2369_headers = 1
self.include_list_post_header = 1
+ self.include_sender_header = 1
self.filter_mime_types = mm_cfg.DEFAULT_FILTER_MIME_TYPES
self.pass_mime_types = mm_cfg.DEFAULT_PASS_MIME_TYPES
self.filter_filename_extensions = \
diff --git a/Mailman/versions.py b/Mailman/versions.py
index 81fafd5a..031094ed 100644
--- a/Mailman/versions.py
+++ b/Mailman/versions.py
@@ -353,6 +353,7 @@ def NewVars(l):
add_only_if_missing('send_goodbye_msg', mm_cfg.DEFAULT_SEND_GOODBYE_MSG)
add_only_if_missing('include_rfc2369_headers', 1)
add_only_if_missing('include_list_post_header', 1)
+ add_only_if_missing('include_sender_header', 1)
add_only_if_missing('bounce_score_threshold',
mm_cfg.DEFAULT_BOUNCE_SCORE_THRESHOLD)
add_only_if_missing('bounce_info_stale_after',