summaryrefslogtreecommitdiff
path: root/mailman/commands/join.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-09-23 23:30:05 -0400
committerBarry Warsaw2008-09-23 23:30:05 -0400
commit546825b4ec7a1018bc2182646e8c0433271d1990 (patch)
tree9e7b374bd0dd673a3197fc122e60148b8e8e5d8c /mailman/commands/join.py
parent48d54f30593abd1f018379ce3ecb3452be7986c0 (diff)
downloadmailman-546825b4ec7a1018bc2182646e8c0433271d1990.tar.gz
mailman-546825b4ec7a1018bc2182646e8c0433271d1990.tar.zst
mailman-546825b4ec7a1018bc2182646e8c0433271d1990.zip
Diffstat (limited to 'mailman/commands/join.py')
-rw-r--r--mailman/commands/join.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/mailman/commands/join.py b/mailman/commands/join.py
index bfc3435e7..45535470f 100644
--- a/mailman/commands/join.py
+++ b/mailman/commands/join.py
@@ -24,7 +24,7 @@ __all__ = [
from email.header import decode_header, make_header
-from email.utils import parseaddr
+from email.utils import formataddr, parseaddr
from zope.interface import implements
from mailman.Utils import MakeRandomPassword
@@ -32,6 +32,7 @@ from mailman.configuration import config
from mailman.i18n import _
from mailman.interfaces import (
ContinueProcessing, DeliveryMode, IEmailCommand)
+from mailman.interfaces.registrar import IRegistrar
@@ -56,9 +57,9 @@ example:
def process(self, mlist, msg, msgdata, arguments, results):
"""See `IEmailCommand`."""
# Parse the arguments.
- address, delivery_mmode = self._parse_arguments(arguments)
+ address, delivery_mode = self._parse_arguments(arguments)
if address is None:
- realname, address = parseaddr(msg['from'])
+ real_name, address = parseaddr(msg['from'])
# Address could be None or the empty string.
if not address:
address = msg.get_sender()
@@ -66,15 +67,11 @@ example:
print >> results, _(
'$self.name: No valid address found to subscribe')
return ContinueProcessing.no
- password = MakeRandomPassword()
- try:
- validate_subscription(mlist, address)
- confirm_subscription(mlist, address, realname, password,
- delivery_mode, mlist_preferred_language)
- except XXX:
- pass
- print >> results, self.name, address, \
- (_('digest delivery') if digest else _('regular delivery'))
+ domain = config.domains[mlist.host_name]
+ registrar = IRegistrar(domain)
+ registrar.register(address, real_name)
+ person = formataddr((real_name, address))
+ print >> results, _('Confirmation email sent to $person')
return ContinueProcessing.yes
def _parse_arguments(self, arguments):
@@ -122,6 +119,7 @@ example:
address = parts[1]
return address, delivery_mode
+
def ignore():
# Fill in empty defaults
if digest is None: