Cleanup.
[mailman.git] / src / mailman / rules / docs / recipients.txt
blob344a5f95f1d9800bd7b778eb027b794c36a3250d
1 ============================
2 Maximum number of recipients
3 ============================
5 The 'max-recipients' rule matches when there are more than the maximum allowed
6 number of explicit recipients addressed by the message.
8     >>> mlist = create_list('_xtest@example.com')
9     >>> rule = config.rules['max-recipients']
10     >>> print rule.name
11     max-recipients
13 In this case, we'll create a message with 5 recipients.  These include all
14 addresses in the To and CC headers.
16     >>> msg = message_from_string("""\
17     ... From: aperson@example.com
18     ... To: _xtest@example.com, bperson@example.com
19     ... Cc: cperson@example.com
20     ... Cc: dperson@example.com (Dan Person)
21     ... To: Elly Q. Person <eperson@example.com>
22     ...
23     ... Hey folks!
24     ... """)
26 For backward compatibility, the message must have fewer than the maximum
27 number of explicit recipients.
29     >>> mlist.max_num_recipients = 5
30     >>> rule.check(mlist, msg, {})
31     True
33     >>> mlist.max_num_recipients = 6
34     >>> rule.check(mlist, msg, {})
35     False
37 Zero means any number of recipients are allowed.
39     >>> mlist.max_num_recipients = 0
40     >>> rule.check(mlist, msg, {})
41     False