aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2010-07-03 13:59:22 -0700
committerMark Sapiro <mark@msapiro.net>2010-07-03 13:59:22 -0700
commitfb058ebf486a2ad4f411b6272f66b2b6a0b0bf82 (patch)
treed5845206b211f35b9967fffde1f64bcc3ba60ecf /Mailman
parent36b3fde35d2cf9b4dac842669668ccd6925f0430 (diff)
parent77e80be89784ce21e8205ef072de6f665faa304f (diff)
downloadmailman2-fb058ebf486a2ad4f411b6272f66b2b6a0b0bf82.tar.gz
mailman2-fb058ebf486a2ad4f411b6272f66b2b6a0b0bf82.tar.xz
mailman2-fb058ebf486a2ad4f411b6272f66b2b6a0b0bf82.zip
Merged optional Sender: header feature from lp:~mss/mailman/2.1-sender-header.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Defaults.py.in8
-rw-r--r--Mailman/Gui/General.py25
-rw-r--r--Mailman/Handlers/SMTPDirect.py22
-rw-r--r--Mailman/MailList.py1
-rw-r--r--Mailman/Version.py4
-rw-r--r--Mailman/versions.py3
6 files changed, 56 insertions, 7 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..43c5967d 100644
--- a/Mailman/Gui/General.py
+++ b/Mailman/Gui/General.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -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..e248ad1f 100644
--- a/Mailman/Handlers/SMTPDirect.py
+++ b/Mailman/Handlers/SMTPDirect.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2009 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -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/Version.py b/Mailman/Version.py
index 9027568a..339ec0c1 100644
--- a/Mailman/Version.py
+++ b/Mailman/Version.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2009 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@ HEX_VERSION = ((MAJOR_REV << 24) | (MINOR_REV << 16) | (MICRO_REV << 8) |
(REL_LEVEL << 4) | (REL_SERIAL << 0))
# config.pck schema version number
-DATA_FILE_VERSION = 97
+DATA_FILE_VERSION = 98
# qfile/*.db schema version number
QFILE_SCHEMA_VERSION = 3
diff --git a/Mailman/versions.py b/Mailman/versions.py
index 81fafd5a..ade72ae2 100644
--- a/Mailman/versions.py
+++ b/Mailman/versions.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -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',