diff options
Diffstat (limited to 'Mailman/docs/calc-recips.txt')
| -rw-r--r-- | Mailman/docs/calc-recips.txt | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/Mailman/docs/calc-recips.txt b/Mailman/docs/calc-recips.txt index e2a01fa8a..c36841d1c 100644 --- a/Mailman/docs/calc-recips.txt +++ b/Mailman/docs/calc-recips.txt @@ -5,25 +5,20 @@ Every message that makes it through to the list membership gets sent to a set of recipient addresses. These addresses are calculated by one of the handler modules and depends on a host of factors. - >>> from email import message_from_string - >>> from Mailman.Message import Message >>> from Mailman.Handlers.CalcRecips import process >>> from Mailman.configuration import config - >>> from Mailman.database import flush - >>> mlist = config.db.list_manager.create('_xtest@example.com') - >>> flush() - + >>> mlist = config.db.list_manager.create(u'_xtest@example.com') Recipients are calculate from the list members, so add a bunch of members to start out with. First, create a bunch of addresses... >>> usermgr = config.db.user_manager - >>> address_a = usermgr.create_address('aperson@example.com') - >>> address_b = usermgr.create_address('bperson@example.com') - >>> address_c = usermgr.create_address('cperson@example.com') - >>> address_d = usermgr.create_address('dperson@example.com') - >>> address_e = usermgr.create_address('eperson@example.com') - >>> address_f = usermgr.create_address('fperson@example.com') + >>> address_a = usermgr.create_address(u'aperson@example.com') + >>> address_b = usermgr.create_address(u'bperson@example.com') + >>> address_c = usermgr.create_address(u'cperson@example.com') + >>> address_d = usermgr.create_address(u'dperson@example.com') + >>> address_e = usermgr.create_address(u'eperson@example.com') + >>> address_f = usermgr.create_address(u'fperson@example.com') ...then subscribe these addresses to the mailing list as members... @@ -41,7 +36,6 @@ start out with. First, create a bunch of addresses... >>> member_d.preferences.delivery_mode = DeliveryMode.plaintext_digests >>> member_e.preferences.delivery_mode = DeliveryMode.mime_digests >>> member_f.preferences.delivery_mode = DeliveryMode.summary_digests - >>> flush() Short-circuiting @@ -55,12 +49,12 @@ but not all of the recipients. ... From: Xavier Person <xperson@example.com> ... ... Something of great import. - ... """, Message) - >>> recips = set(('qperson@example.com', 'zperson@example.com')) + ... """) + >>> recips = set((u'qperson@example.com', u'zperson@example.com')) >>> msgdata = dict(recips=recips) >>> process(mlist, msg, msgdata) >>> sorted(msgdata['recips']) - ['qperson@example.com', 'zperson@example.com'] + [u'qperson@example.com', u'zperson@example.com'] Regular delivery recipients @@ -72,21 +66,20 @@ soon as they are posted. In other words, these folks are not digest members. >>> msgdata = {} >>> process(mlist, msg, msgdata) >>> sorted(msgdata['recips']) - ['aperson@example.com', 'bperson@example.com', 'cperson@example.com'] + [u'aperson@example.com', u'bperson@example.com', u'cperson@example.com'] Members can elect not to receive a list copy of their own postings. >>> member_c.preferences.receive_own_postings = False - >>> flush() >>> msg = message_from_string("""\ ... From: Claire Person <cperson@example.com> ... ... Something of great import. - ... """, Message) + ... """) >>> msgdata = {} >>> process(mlist, msg, msgdata) >>> sorted(msgdata['recips']) - ['aperson@example.com', 'bperson@example.com'] + [u'aperson@example.com', u'bperson@example.com'] Members can also elect not to receive a list copy of any message on which they are explicitly named as a recipient. However, see the AvoidDuplicates handler |
