diff options
| author | Barry Warsaw | 2012-07-02 16:08:58 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-07-02 16:08:58 -0400 |
| commit | 3e2231b8835820d240112e7e07cff2a369f178f2 (patch) | |
| tree | 513c973ae93f36efe969793e1a8abb28efbfc7bd /src/mailman/rules/docs | |
| parent | 762af9a7d81fe88327c37f29c851a4d6f7bdaa45 (diff) | |
| download | mailman-3e2231b8835820d240112e7e07cff2a369f178f2.tar.gz mailman-3e2231b8835820d240112e7e07cff2a369f178f2.tar.zst mailman-3e2231b8835820d240112e7e07cff2a369f178f2.zip | |
Diffstat (limited to 'src/mailman/rules/docs')
| -rw-r--r-- | src/mailman/rules/docs/approved.rst | 4 | ||||
| -rw-r--r-- | src/mailman/rules/docs/header-matching.rst | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/mailman/rules/docs/approved.rst b/src/mailman/rules/docs/approved.rst index 7f0714e17..3f3d54455 100644 --- a/src/mailman/rules/docs/approved.rst +++ b/src/mailman/rules/docs/approved.rst @@ -20,8 +20,8 @@ which is shared among all the administrators. This password will not be stored in clear text, so it must be hashed using the configured hash protocol. - >>> from mailman.utilities.passwords import encrypt - >>> mlist.moderator_password = encrypt('super secret') + >>> mlist.moderator_password = config.password_context.encrypt( + ... 'super secret') The ``approved`` rule determines whether the message contains the proper approval or not. diff --git a/src/mailman/rules/docs/header-matching.rst b/src/mailman/rules/docs/header-matching.rst index 021974e69..20e55fadd 100644 --- a/src/mailman/rules/docs/header-matching.rst +++ b/src/mailman/rules/docs/header-matching.rst @@ -74,17 +74,19 @@ The header may exist and match the pattern. By default, when the header matches, it gets held for moderator approval. :: + >>> from mailman.interfaces.chain import ChainEvent >>> from mailman.testing.helpers import event_subscribers >>> def handler(event): - ... print event.__class__.__name__, \ - ... event.chain.name, event.msg['message-id'] + ... if isinstance(event, ChainEvent): + ... print event.__class__.__name__, \ + ... event.chain.name, event.msg['message-id'] >>> del msg['x-spam-score'] >>> msg['X-Spam-Score'] = '*****' >>> msgdata = {} >>> with event_subscribers(handler): ... process(mlist, msg, msgdata, 'header-match') - HoldNotification hold <ant> + HoldEvent hold <ant> >>> hits_and_misses(msgdata) Rule hits: @@ -100,7 +102,7 @@ discard such messages. >>> with event_subscribers(handler): ... with configuration('antispam', jump_chain='discard'): ... process(mlist, msg, msgdata, 'header-match') - DiscardNotification discard <ant> + DiscardEvent discard <ant> These programmatically added headers can be removed by flushing the chain. Now, nothing with match this message. |
