4 The mail command 'join' subscribes an email address to the mailing list.
5 'subscribe' is an alias for 'join'.
7 >>> from mailman.configuration import config
8 >>> command = config.commands['join']
11 >>> print command.description
12 Join this mailing list. You will be asked to confirm your subscription
13 request and you may be issued a provisional password.
15 By using the 'digest' option, you can specify whether you want digest
16 delivery or not. If not specified, the mailing list's default will be
17 used. You can also subscribe an alternative address by using the
18 'address' option. For example:
20 join address=myotheraddress@example.com
22 >>> print command.argument_description
23 [digest=<yes|no>] [address=<address>]
29 >>> from mailman.Message import Message
30 >>> from mailman.app.lifecycle import create_list
31 >>> from mailman.queue.command import Results
32 >>> mlist = create_list(u'test@example.com')
34 When no address argument is given, the message's From address will be used.
35 If that's missing though, then an error is returned.
37 >>> results = Results()
38 >>> print command.process(mlist, Message(), {}, (), results)
40 >>> print unicode(results)
41 The results of your email command are provided below.
43 join: No valid address found to subscribe
46 The 'subscribe' command is an alias.
48 >>> subscribe = config.commands['subscribe']
49 >>> print subscribe.name
51 >>> results = Results()
52 >>> print subscribe.process(mlist, Message(), {}, (), results)
54 >>> print unicode(results)
55 The results of your email command are provided below.
57 subscribe: No valid address found to subscribe
64 When the message has a From field, that address will be subscribed.
66 >>> msg = message_from_string("""\
67 ... From: Anne Person <anne@example.com>
70 >>> results = Results()
71 >>> print command.process(mlist, msg, {}, (), results)
72 ContinueProcessing.yes
73 >>> print unicode(results)
74 The results of your email command are provided below.
76 Confirmation email sent to Anne Person <anne@example.com>
79 Anne is not yet a member because she must confirm her subscription request
82 >>> print config.db.user_manager.get_user(u'anne@example.com')
85 Mailman has sent her the confirmation message.
87 >>> from mailman.queue import Switchboard
88 >>> virginq = Switchboard(config.VIRGINQUEUE_DIR)
89 >>> qmsg, qdata = virginq.dequeue(virginq.files[0])
90 >>> print qmsg.as_string()
94 From: confirm-...@example.com
98 Email Address Registration Confirmation
100 Hello, this is the GNU Mailman server at example.com.
102 We have received a registration request for the email address
106 Before you can start using GNU Mailman at this site, you must first
107 confirm that this is your email address. You can do this by replying to
108 this message, keeping the Subject header intact. Or you can visit this
111 http://www.example.com/confirm/...
113 If you do not wish to register this email address simply disregard this
114 message. If you think you are being maliciously subscribed to the list, or
115 have any other questions, you may contact
117 postmaster@example.com
120 Once Anne confirms her registration, she will be made a member of the mailing
123 >>> token = str(qmsg['subject']).split()[1].strip()
124 >>> from mailman.interfaces.registrar import IRegistrar
125 >>> registrar = IRegistrar(config.domains['example.com'])
126 >>> registrar.confirm(token)
129 >>> user = config.db.user_manager.get_user(u'anne@example.com')
130 >>> print user.real_name
132 >>> list(user.addresses)
133 [<Address: Anne Person <anne@example.com> [verified] at ...>]