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']
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>
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, {})
33 >>> mlist.max_num_recipients = 6
34 >>> rule.check(mlist, msg, {})
37 Zero means any number of recipients are allowed.
39 >>> mlist.max_num_recipients = 0
40 >>> rule.check(mlist, msg, {})