summaryrefslogtreecommitdiff
path: root/src/mailman/chains/owner.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-22 23:15:15 -0400
committerBarry Warsaw2012-03-22 23:15:15 -0400
commit3e8f20cd4d543bdbd575b9c61748e4a815f5e0ea (patch)
tree2447b5073b0e8826ee0ccfb2166c6786d2b4841e /src/mailman/chains/owner.py
parent1317dadb98e422a05342009d85ab1adfb79f86f2 (diff)
downloadmailman-3e8f20cd4d543bdbd575b9c61748e4a815f5e0ea.tar.gz
mailman-3e8f20cd4d543bdbd575b9c61748e4a815f5e0ea.tar.zst
mailman-3e8f20cd4d543bdbd575b9c61748e4a815f5e0ea.zip
Diffstat (limited to 'src/mailman/chains/owner.py')
-rw-r--r--src/mailman/chains/owner.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/mailman/chains/owner.py b/src/mailman/chains/owner.py
new file mode 100644
index 000000000..ad0a04cea
--- /dev/null
+++ b/src/mailman/chains/owner.py
@@ -0,0 +1,56 @@
+# Copyright (C) 2012 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+"""The standard -owner posting chain."""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+ 'BuiltInOwnerChain',
+ ]
+
+
+import logging
+
+from zope.event import notify
+
+from mailman.chains.base import ChainNotification, TerminalChainBase
+from mailman.config import config
+from mailman.core.i18n import _
+
+
+log = logging.getLogger('mailman.vette')
+
+
+
+class OwnerNotification(ChainNotification):
+ """An event signaling that a message is accepted to the -owner address."""
+
+
+
+class BuiltInOwnerChain(TerminalChainBase):
+ """Default built-in -owner address chain."""
+
+ name = 'default-owner-chain'
+ description = _('The built-in -owner posting chain.')
+
+ def _process(self, mlist, msg, msgdata):
+ # At least for now, everything posted to -owners goes through.
+ config.switchboards['pipeline'].enqueue(msg, msgdata)
+ log.info('OWNER: %s', msg.get('message-id', 'n/a'))
+ notify(OwnerNotification(mlist, msg, msgdata, self))