diff options
Diffstat (limited to 'src/mailman/commands')
| -rw-r--r-- | src/mailman/commands/docs/membership.rst | 7 | ||||
| -rw-r--r-- | src/mailman/commands/eml_membership.py | 12 |
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 |
