summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2009-12-12 23:57:10 -0500
committerBarry Warsaw2009-12-12 23:57:10 -0500
commit4d9afb3d1d4ae87bda4b833f6e46660722147f18 (patch)
treee2baf3c1c2fce181305f649e2f3c520e233476d8
parent88b9da7001a2f55465a16d299b021f1143857655 (diff)
downloadmailman-4d9afb3d1d4ae87bda4b833f6e46660722147f18.tar.gz
mailman-4d9afb3d1d4ae87bda4b833f6e46660722147f18.tar.zst
mailman-4d9afb3d1d4ae87bda4b833f6e46660722147f18.zip
-rw-r--r--src/mailman/config/schema.cfg23
-rw-r--r--src/mailman/docs/registration.txt11
-rw-r--r--src/mailman/mta/connection.py4
-rw-r--r--src/mailman/mta/docs/connection.txt7
4 files changed, 24 insertions, 21 deletions
diff --git a/src/mailman/config/schema.cfg b/src/mailman/config/schema.cfg
index 89898f441..9a7ca4047 100644
--- a/src/mailman/config/schema.cfg
+++ b/src/mailman/config/schema.cfg
@@ -21,13 +21,6 @@
# options. See <https://launchpad.net/lazr.config> for details.
[mailman]
-# Setting devmode to true enables certain safeguards and other behavior
-# changes that make developing Mailman easier. For example, it forces the
-# SMTP RCPT TO recipients to be a test address so that no messages are
-# accidentally sent to real addresses. All devmode variables in other
-# sections begin with 'devmode_' for easy searching.
-devmode: false
-
# This address is the "site owner" address. Certain messages which must be
# delivered to a human, but which can't be delivered to a list owner (e.g. a
# bounce from a list owner), will be sent to this address. It should point to
@@ -70,6 +63,18 @@ pre_hook:
post_hook:
+[devmode]
+# Setting enabled to true enables certain safeguards and other behavior
+# changes that make developing Mailman easier. For example, it forces the
+# SMTP RCPT TO recipients to be a test address so that no messages are
+# accidentally sent to real addresses.
+enabled: no
+
+# Set this to an address to force the SMTP RCPT TO recipents when devmode is
+# enabled. This way messages can't be accidentally sent to real addresses.
+recipient:
+
+
[passwords]
# When Mailman generates them, this is the default length of member passwords.
member_password_length: 8
@@ -268,10 +273,6 @@ chain: hold
[mta]
-# Set this to an address to force the SMTP RCPT TO recipents when devmode is
-# enabled. This way messages can't be accidentally sent to real addresses.
-devmode_recipient:
-
# The class defining the interface to the incoming mail transport agent.
incoming: mailman.mta.postfix.LMTP
diff --git a/src/mailman/docs/registration.txt b/src/mailman/docs/registration.txt
index 8f473403e..a3dfc7004 100644
--- a/src/mailman/docs/registration.txt
+++ b/src/mailman/docs/registration.txt
@@ -29,7 +29,7 @@ Here is a helper function to extract tokens from confirmation messages.
>>> import re
>>> cre = re.compile('http://lists.example.com/confirm/(.*)')
>>> def extract_token(msg):
- ... mo = cre.search(qmsg.get_payload())
+ ... mo = cre.search(msg.get_payload())
... return mo.group(1)
@@ -157,18 +157,18 @@ The confirmation token shows up in several places, each of which provides an
easy way for the user to complete the confirmation. The token will always
appear in a URL in the body of the message.
- >>> sent_token = extract_token(qmsg)
+ >>> sent_token = extract_token(items[0].msg)
>>> sent_token == token
True
The same token will appear in the From header.
- >>> qmsg['from'] == 'alpha-confirm+' + token + '@example.com'
+ >>> items[0].msg['from'] == 'alpha-confirm+' + token + '@example.com'
True
It will also appear in the Subject header.
- >>> qmsg['subject'] == 'confirm ' + token
+ >>> items[0].msg['subject'] == 'confirm ' + token
True
The user would then validate their registered address by clicking on a url or
@@ -260,6 +260,9 @@ mind about registering. When discarded, no IAddress or IUser is created.
>>> print user_manager.get_user('eperson@example.com')
None
+ # Clear the virgin queue of all the preceding confirmation messages.
+ >>> ignore = get_queue_messages('virgin')
+
Registering a new address for an existing user
==============================================
diff --git a/src/mailman/mta/connection.py b/src/mailman/mta/connection.py
index 9e8f5cbc6..d2744a741 100644
--- a/src/mailman/mta/connection.py
+++ b/src/mailman/mta/connection.py
@@ -67,10 +67,10 @@ class Connection:
def sendmail(self, envsender, recipients, msgtext):
"""Mimic `smtplib.SMTP.sendmail`."""
- if as_boolean(config.mailman.devmode):
+ if as_boolean(config.devmode.enabled):
# Force the recipients to the specified address, but still deliver
# to the same number of recipients.
- recipients = [config.mta.devmode_recipient] * len(recipients)
+ recipients = [config.devmode.recipient] * len(recipients)
if self._connection is None:
self._connect()
try:
diff --git a/src/mailman/mta/docs/connection.txt b/src/mailman/mta/docs/connection.txt
index c79120eba..a15dc4c6b 100644
--- a/src/mailman/mta/docs/connection.txt
+++ b/src/mailman/mta/docs/connection.txt
@@ -165,10 +165,9 @@ given hard-coded address. This allows you to test Mailman without worrying
about accidental deliveries to unintended recipients.
>>> config.push('devmode', """
- ... [mailman]
- ... devmode: true
- ... [mta]
- ... devmode_recipient: zperson@example.com
+ ... [devmode]
+ ... enabled: yes
+ ... recipient: zperson@example.com
... """)
>>> smtpd.clear()