Skip to content

Introduces explicit_header_only option

Nick Wynja requested to merge nickwynja/mailman:master into master

Introduce option for not including list address in CC when replying.

Closes #531 (closed)


Steps to Test

$ mailman shell -l ant@example.xx
Welcome to the GNU Mailman shell
The variable 'm' is the ant@example.xx mailing list
>>> from mailman.interfaces.mailinglist import (Personalization, ReplyToMunging)
>>> from mailman.testing.helpers import message_from_string
>>> from mailman.handlers.cook_headers import process
>>> m.personalize = Personalization.full
>>> m.reply_goes_to_list = ReplyToMunging.explicit_header_only
>>> m.reply_to_address = 'my-list@example.com'
>>> m.first_strip_reply_to = True
>>> msg = message_from_string("""\
... From: aperson@example.com
... Reply-To: bperson@example.com
... Cc: cperson@example.com
...
... A message of great import.
... """)
>>> msg.sender = 'anne@example.com'
>>> process(m, msg, {})
>>> print(msg)
From: aperson@example.com
X-Mailman-Version: 3.2.0+
Precedence: list
Reply-To: my-list@example.com
Cc: cperson@example.com

A message of great import.

As expected, the list address is not in Cc but cperson@example.com remains.

And let's confirm that ReplyToMunging.explicit_header still works as expected:

>>> m.reply_goes_to_list = ReplyToMunging.explicit_header
>>> process(m, msg, {})
>>> print(msg)
From: aperson@example.com
X-Mailman-Version: 3.2.0+
Precedence: list
Reply-To: my-list@example.com
Cc: cperson@example.com, ant@example.xx

A message of great import.

Merge request reports