summaryrefslogtreecommitdiff
path: root/src/mailman/mta/docs
diff options
context:
space:
mode:
authorBarry Warsaw2009-11-01 15:23:56 -0500
committerBarry Warsaw2009-11-01 15:23:56 -0500
commit0f03599f841388c066232cdbfd417d69e57b312d (patch)
tree43530b74248c0a9e5ee6e0798095f44192f18fb6 /src/mailman/mta/docs
parentc05caff08e5229e7f16ca02aaa4eed78a74a4999 (diff)
downloadmailman-0f03599f841388c066232cdbfd417d69e57b312d.tar.gz
mailman-0f03599f841388c066232cdbfd417d69e57b312d.tar.zst
mailman-0f03599f841388c066232cdbfd417d69e57b312d.zip
Add full personalization delivery mechanism.
Diffstat (limited to 'src/mailman/mta/docs')
-rw-r--r--src/mailman/mta/docs/personalized.txt137
-rw-r--r--src/mailman/mta/docs/verp.txt9
2 files changed, 141 insertions, 5 deletions
diff --git a/src/mailman/mta/docs/personalized.txt b/src/mailman/mta/docs/personalized.txt
new file mode 100644
index 000000000..c1c590479
--- /dev/null
+++ b/src/mailman/mta/docs/personalized.txt
@@ -0,0 +1,137 @@
+===========================
+Fully personalized delivery
+===========================
+
+Fully personalized mail delivery is an enhancement over VERP_ delivery where
+the To field of the message is replaced with the recipient's address. A
+typical email message is sent to the mailing list's posting address and copied
+to the list membership that way. Some people like the more personal address.
+
+.. _VERP: verp.txt
+
+Personalized delivery still does VERP.
+
+ >>> from mailman.mta.personalized import PersonalizedDelivery
+ >>> personalized = PersonalizedDelivery()
+
+Delivery strategies must implement the proper interface.
+
+ >>> from mailman.interfaces.mta import IMailTransportAgentDelivery
+ >>> from zope.interface.verify import verifyObject
+ >>> verifyObject(IMailTransportAgentDelivery, personalized)
+ True
+
+
+To header
+=========
+
+The To header is replaced with the recipient's address and name.
+
+ >>> mlist = create_list('test@example.com')
+ >>> msg = message_from_string("""\
+ ... From: aperson@example.org
+ ... To: test@example.com
+ ... Subject: test one
+ ... Message-ID: <aardvark>
+ ...
+ ... This is a test.
+ ... """)
+
+ >>> recipients = set([
+ ... 'aperson@example.com',
+ ... 'bperson@example.com',
+ ... 'cperson@example.com',
+ ... ])
+
+ >>> personalized.deliver(mlist, msg, dict(recipients=recipients))
+ {}
+ >>> messages = list(smtpd.messages)
+ >>> len(messages)
+ 3
+
+ >>> from operator import itemgetter
+ >>> for message in sorted(messages, key=itemgetter('to')):
+ ... print message.as_string()
+ ... print '----------'
+ From: aperson@example.org
+ To: aperson@example.com
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+aperson=example.com@example.com
+ X-RcptTo: aperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
+ From: aperson@example.org
+ To: bperson@example.com
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+bperson=example.com@example.com
+ X-RcptTo: bperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
+ From: aperson@example.org
+ To: cperson@example.com
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+cperson=example.com@example.com
+ X-RcptTo: cperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
+
+If the recipient is a user registered with Mailman, and the user has an
+associated real name, then this name also shows up in the To header.
+
+ >>> from zope.component import getUtility
+ >>> from mailman.interfaces.usermanager import IUserManager
+ >>> user_manager = getUtility(IUserManager)
+
+ >>> bill = user_manager.create_user('bperson@example.com', 'Bill Person')
+ >>> cate = user_manager.create_user('cperson@example.com', 'Cate Person')
+ >>> transaction.commit()
+
+ >>> personalized.deliver(mlist, msg, dict(recipients=recipients))
+ {}
+ >>> messages = list(smtpd.messages)
+ >>> len(messages)
+ 3
+
+ >>> from operator import itemgetter
+ >>> for message in sorted(messages, key=itemgetter('x-rcptto')):
+ ... print message.as_string()
+ ... print '----------'
+ From: aperson@example.org
+ To: aperson@example.com
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+aperson=example.com@example.com
+ X-RcptTo: aperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
+ From: aperson@example.org
+ To: Bill Person <bperson@example.com>
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+bperson=example.com@example.com
+ X-RcptTo: bperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
+ From: aperson@example.org
+ To: Cate Person <cperson@example.com>
+ Subject: test one
+ Message-ID: <aardvark>
+ X-Peer: ...
+ X-MailFrom: test-bounces+cperson=example.com@example.com
+ X-RcptTo: cperson@example.com
+ <BLANKLINE>
+ This is a test.
+ ----------
diff --git a/src/mailman/mta/docs/verp.txt b/src/mailman/mta/docs/verp.txt
index ac8d70e29..11157d363 100644
--- a/src/mailman/mta/docs/verp.txt
+++ b/src/mailman/mta/docs/verp.txt
@@ -2,13 +2,11 @@
Standard VERP delivery
======================
-'VERP' delivery is an alternative to bulk_ delivery, where an individual
-message is crafted uniquely for each recipient. Our use of the term `VERP`_
-is actually incorrect, since the term is narrowly defined by the technique of
-setting the return path so that bounces can be unambiguously decoded.
+Variable Envelope Return Path (VERP_) delivery is an alternative to bulk_
+delivery, where an individual message is crafted uniquely for each recipient.
-.. _bulk: bulk.txt
.. _VERP: http://en.wikipedia.org/wiki/Variable_envelope_return_path
+.. _bulk: bulk.txt
The cost of enabling VERP is that Mailman must send to the upstream MTA, one
message per recipient. Under bulk delivery, an exact copy of one message can
@@ -78,6 +76,7 @@ intended recipient's delivery address.
... ])
>>> verp.deliver(mlist, msg, dict(recipients=recipients))
+ {}
>>> messages = list(smtpd.messages)
>>> len(messages)
3