diff options
| author | Barry Warsaw | 2010-02-16 18:45:55 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2010-02-16 18:45:55 -0500 |
| commit | 006515005077b7b4b6fbb18d593800264ed307c4 (patch) | |
| tree | 53c04cdb1572e7d6683aebfd3fb58c526bf3f345 /src/mailman/chains/discard.py | |
| parent | 24631a0aad7c1be8b71303b509552f69240743b5 (diff) | |
| download | mailman-006515005077b7b4b6fbb18d593800264ed307c4.tar.gz mailman-006515005077b7b4b6fbb18d593800264ed307c4.tar.zst mailman-006515005077b7b4b6fbb18d593800264ed307c4.zip | |
Diffstat (limited to 'src/mailman/chains/discard.py')
| -rw-r--r-- | src/mailman/chains/discard.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mailman/chains/discard.py b/src/mailman/chains/discard.py index a5eeabc89..1c4d396c6 100644 --- a/src/mailman/chains/discard.py +++ b/src/mailman/chains/discard.py @@ -22,12 +22,14 @@ from __future__ import absolute_import, unicode_literals __metaclass__ = type __all__ = [ 'DiscardChain', + 'DiscardNotification', ] import logging +from zope.event import notify -from mailman.chains.base import TerminalChainBase +from mailman.chains.base import ChainNotification, TerminalChainBase from mailman.core.i18n import _ @@ -35,6 +37,11 @@ log = logging.getLogger('mailman.vette') +class DiscardNotification(ChainNotification): + """A notification event signaling that a message is being discarded.""" + + + class DiscardChain(TerminalChainBase): """Discard a message.""" @@ -42,6 +49,11 @@ class DiscardChain(TerminalChainBase): description = _('Discard a message and stop processing.') def _process(self, mlist, msg, msgdata): - """See `TerminalChainBase`.""" + """See `TerminalChainBase`. + + This writes a log message, fires a Zope event and then throws the + message away. + """ log.info('DISCARD: %s', msg.get('message-id', 'n/a')) + notify(DiscardNotification(mlist, msg, msgdata, self)) # Nothing more needs to happen. |
