summaryrefslogtreecommitdiff
path: root/src/mailman/commands
diff options
context:
space:
mode:
authorBarry Warsaw2016-09-11 19:51:21 +1200
committerBarry Warsaw2016-09-11 19:51:21 +1200
commite18e7ac34e8b4b2f88d5987ccb76a39c54c61c0c (patch)
treed313d43b1bf35342d4baa3711bb2745dbce82282 /src/mailman/commands
parent1db20c856fa192664d09f93caa1045036b4336dd (diff)
downloadmailman-e18e7ac34e8b4b2f88d5987ccb76a39c54c61c0c.tar.gz
mailman-e18e7ac34e8b4b2f88d5987ccb76a39c54c61c0c.tar.zst
mailman-e18e7ac34e8b4b2f88d5987ccb76a39c54c61c0c.zip
Diffstat (limited to 'src/mailman/commands')
-rw-r--r--src/mailman/commands/docs/membership.rst7
-rw-r--r--src/mailman/commands/eml_membership.py12
2 files changed, 12 insertions, 7 deletions
diff --git a/src/mailman/commands/docs/membership.rst b/src/mailman/commands/docs/membership.rst
index 49e80511d..230b4fb83 100644
--- a/src/mailman/commands/docs/membership.rst
+++ b/src/mailman/commands/docs/membership.rst
@@ -217,9 +217,12 @@ list. ``unsubscribe`` is an alias for ``leave``.
You may be asked to confirm your request.
Anne is a member of the ``baker@example.com`` mailing list, when she decides
-to leave it. She sends a message to the ``-leave`` address for the list and
-is sent a confirmation message for her request.
+to leave it. Because the mailing list allows for *open* unsubscriptions
+(i.e. no confirmation is needed), when she sends a message to the ``-leave``
+address for the list, she is immediately removed.
+ >>> from mailman.interfaces.mailinglist import SubscriptionPolicy
+ >>> mlist_2.unsubscription_policy = SubscriptionPolicy.open
>>> results = Results()
>>> print(leave.process(mlist_2, msg, {}, (), results))
ContinueProcessing.yes
diff --git a/src/mailman/commands/eml_membership.py b/src/mailman/commands/eml_membership.py
index 4e2e78f5d..223552ea5 100644
--- a/src/mailman/commands/eml_membership.py
+++ b/src/mailman/commands/eml_membership.py
@@ -187,12 +187,14 @@ You may be asked to confirm your request.""")
'$self.name: $email is not a member of $mlist.fqdn_listname'),
file=results)
return ContinueProcessing.no
- getAdapter(mlist, ISubscriptionManager, name='unsubscribe').register(
- user_address)
- # member.unsubscribe()
+ manager = getAdapter(mlist, ISubscriptionManager, name='unsubscribe')
+ token, token_owner, member = manager.unregister(user_address)
person = formataddr((user.display_name, email)) # noqa
- print(_('Confirmation email sent to $person to leave'
- ' $mlist.fqdn_listname'), file=results)
+ if member is None:
+ print(_('$person left $mlist.fqdn_listname'), file=results)
+ else:
+ print(_('Confirmation email sent to $person to leave'
+ ' $mlist.fqdn_listname'), file=results)
return ContinueProcessing.yes