4 Suspicious headers are a way for Mailman to hold messages that match a
5 particular regular expression. This mostly historical feature is fairly
6 confusing to users, and the list attribute that controls this is misnamed.
8 >>> from Mailman.configuration import config
9 >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
10 >>> from Mailman.app.rules import find_rule
11 >>> rule = find_rule('suspicious-header')
15 Set the so-called suspicious header configuration variable.
17 >>> mlist.bounce_matching_headers = u'From: .*person@(blah.)?example.com'
18 >>> msg = message_from_string(u"""\
19 ... From: aperson@example.com
20 ... To: _xtest@example.com
21 ... Subject: An implicit message
24 >>> rule.check(mlist, msg, {})
27 But if the header doesn't match the regular expression, the rule won't match.
28 This one comes from a .org address.
30 >>> msg = message_from_string(u"""\
31 ... From: aperson@example.org
32 ... To: _xtest@example.com
33 ... Subject: An implicit message
36 >>> rule.check(mlist, msg, {})