summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2016-12-30 01:10:09 +0000
committerBarry Warsaw2016-12-30 01:10:09 +0000
commit0550c741d6601ace0672f7602e1278ebf7881c95 (patch)
tree77241a870d088bd9a7b06c251ee230ec7d31ab39
parent5550ae7a3d1f963492e2a45b7ac411428597a745 (diff)
parent351515f4b47be1fc3b353cbef988879f5c0d3db2 (diff)
downloadmailman-0550c741d6601ace0672f7602e1278ebf7881c95.tar.gz
mailman-0550c741d6601ace0672f7602e1278ebf7881c95.tar.zst
mailman-0550c741d6601ace0672f7602e1278ebf7881c95.zip
Merge branch 'issue297' into 'master'
Remove to_moderators See merge request !226
-rw-r--r--port_me/checkdbs.py2
-rw-r--r--src/mailman/app/moderator.py2
-rw-r--r--src/mailman/app/subscriptions.py4
-rw-r--r--src/mailman/app/tests/test_moderation.py3
-rw-r--r--src/mailman/app/tests/test_subscriptions.py3
-rw-r--r--src/mailman/chains/hold.py2
-rw-r--r--src/mailman/chains/tests/test_hold.py4
-rw-r--r--src/mailman/docs/NEWS.rst2
-rw-r--r--src/mailman/email/message.py12
9 files changed, 12 insertions, 22 deletions
diff --git a/port_me/checkdbs.py b/port_me/checkdbs.py
index 7f46e97d4..912ae7d71 100644
--- a/port_me/checkdbs.py
+++ b/port_me/checkdbs.py
@@ -199,7 +199,7 @@ def main():
mlist.GetBouncesEmail(),
subject, text,
mlist.preferred_language)
- msg.send(mlist, to_moderators=True)
+ msg.send(mlist)
finally:
mlist.Unlock()
diff --git a/src/mailman/app/moderator.py b/src/mailman/app/moderator.py
index fe7a81383..deb54e9b5 100644
--- a/src/mailman/app/moderator.py
+++ b/src/mailman/app/moderator.py
@@ -204,7 +204,7 @@ def hold_unsubscription(mlist, email):
msg = UserNotification(
mlist.owner_address, mlist.owner_address,
subject, text, mlist.preferred_language)
- msg.send(mlist, to_moderators=True)
+ msg.send(mlist)
return request_id
diff --git a/src/mailman/app/subscriptions.py b/src/mailman/app/subscriptions.py
index a38b3061d..7d02a4e6c 100644
--- a/src/mailman/app/subscriptions.py
+++ b/src/mailman/app/subscriptions.py
@@ -287,7 +287,7 @@ class SubscriptionWorkflow(_SubscriptionWorkflowCommon):
msg = UserNotification(
self.mlist.owner_address, self.mlist.owner_address,
subject, text, self.mlist.preferred_language)
- msg.send(self.mlist, to_moderators=True)
+ msg.send(self.mlist)
# The workflow must stop running here.
raise StopIteration
@@ -435,7 +435,7 @@ class UnSubscriptionWorkflow(_SubscriptionWorkflowCommon):
msg = UserNotification(
self.mlist.owner_address, self.mlist.owner_address,
subject, text, self.mlist.preferred_language)
- msg.send(self.mlist, to_moderators=True)
+ msg.send(self.mlist)
# The workflow must stop running here
raise StopIteration
diff --git a/src/mailman/app/tests/test_moderation.py b/src/mailman/app/tests/test_moderation.py
index bb3958cd7..90377bf72 100644
--- a/src/mailman/app/tests/test_moderation.py
+++ b/src/mailman/app/tests/test_moderation.py
@@ -178,7 +178,8 @@ class TestUnsubscription(unittest.TestCase):
break
else:
raise AssertionError('No moderator email found')
- self.assertEqual(item.msgdata['recipients'], {'bart@example.com'})
+ self.assertEqual(
+ item.msgdata['recipients'], {'test-owner@example.com'})
self.assertEqual(
item.msg['subject'],
'New unsubscription request from Test by anne@example.org')
diff --git a/src/mailman/app/tests/test_subscriptions.py b/src/mailman/app/tests/test_subscriptions.py
index b960b7904..0f4809fd5 100644
--- a/src/mailman/app/tests/test_subscriptions.py
+++ b/src/mailman/app/tests/test_subscriptions.py
@@ -451,7 +451,8 @@ class TestSubscriptionWorkflow(unittest.TestCase):
break
else:
raise AssertionError('No moderator email found')
- self.assertEqual(item.msgdata['recipients'], {'bart@example.com'})
+ self.assertEqual(
+ item.msgdata['recipients'], {'test-owner@example.com'})
message = items[0].msg
self.assertEqual(message['From'], 'test-owner@example.com')
self.assertEqual(message['To'], 'test-owner@example.com')
diff --git a/src/mailman/chains/hold.py b/src/mailman/chains/hold.py
index 0b50964b7..86761c3e1 100644
--- a/src/mailman/chains/hold.py
+++ b/src/mailman/chains/hold.py
@@ -247,7 +247,7 @@ also appear in the first line of the body of the reply.""")),
nmsg.attach(text)
nmsg.attach(MIMEMessage(msg))
nmsg.attach(MIMEMessage(dmsg))
- nmsg.send(mlist, to_moderators=True)
+ nmsg.send(mlist)
# Log the held message. Log messages are not translated, so recast
# the reasons in the English.
with _.using('en'):
diff --git a/src/mailman/chains/tests/test_hold.py b/src/mailman/chains/tests/test_hold.py
index 6686c4777..02ca08932 100644
--- a/src/mailman/chains/tests/test_hold.py
+++ b/src/mailman/chains/tests/test_hold.py
@@ -173,8 +173,8 @@ A message body.
# delivery to the moderators.
items = get_queue_messages('virgin', expected_count=1)
msgdata = items[0].msgdata
- # Should get sent to moderators.
- self.assertEqual(msgdata['recipients'], {'bart@example.com'})
+ # Should get sent to -owner address.
+ self.assertEqual(msgdata['recipients'], {'test-owner@example.com'})
# Ensure that the subject looks correct in the postauth.txt.
msg = items[0].msg
value = None
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 1841f8fb7..093c9bd0e 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -97,8 +97,6 @@ Bugs
(Closes: #283)
* Remove the digest mbox files after the digests are sent. Given by Aurélien
Bompard. (Closes: #259)
- * Messages sent to the list's moderators now include the actual recipient
- addresses. Given by Tom Briles. (Closes: #68)
* Transmit the moderation reason and expose it in the REST API as the
``reason`` attribute. Given by Aurélien Bompard.
* Don't return a 500 error from the REST API when trying to handle a held
diff --git a/src/mailman/email/message.py b/src/mailman/email/message.py
index da2ce837f..da341d1b7 100644
--- a/src/mailman/email/message.py
+++ b/src/mailman/email/message.py
@@ -30,7 +30,6 @@ import email.utils
from email.header import Header
from email.mime.multipart import MIMEMultipart
from mailman.config import config
-from mailman.interfaces.member import DeliveryStatus
from public import public
@@ -133,7 +132,7 @@ class UserNotification(Message):
self['To'] = recipients
self.recipients = set([recipients])
- def send(self, mlist, *, add_precedence=True, to_moderators=False, **_kws):
+ def send(self, mlist, *, add_precedence=True, **_kws):
"""Sends the message by enqueuing it to the 'virgin' queue.
This is used for all internally crafted messages.
@@ -143,9 +142,6 @@ class UserNotification(Message):
:param add_precedence: Flag indicating whether a `Precedence: bulk`
header should be added to the message or not.
:type add_precedence: bool
- :param to_moderators: Flag indicating whether the message should be
- sent to the list's moderators instead of the list's membership.
- :type to_moderators: bool
This function also accepts arbitrary keyword arguments. The key/value
pairs for **kws is added to the metadata dictionary associated with
@@ -163,12 +159,6 @@ class UserNotification(Message):
# don't override an existing Precedence: header.
if 'precedence' not in self and add_precedence:
self['Precedence'] = 'bulk'
- if to_moderators:
- self.recipients = set(
- member.address.email
- for member in mlist.moderators.members
- if member.delivery_status is DeliveryStatus.enabled)
- self['To'] = COMMASPACE.join(self.recipients)
self._enqueue(mlist, **_kws)
def _enqueue(self, mlist, **_kws):