summaryrefslogtreecommitdiff
path: root/Mailman/rules/emergency.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-12-27 23:04:08 -0500
committerBarry Warsaw2007-12-27 23:04:08 -0500
commit13dea3a6736834e19ad569b5e3d70a79e096a55e (patch)
treeab8448fd114436cd1dc9a1754ce8c9c7dfc865d4 /Mailman/rules/emergency.py
parent7923b90f0349f9e2dc891082e2e1c3bf23b4d79c (diff)
downloadmailman-13dea3a6736834e19ad569b5e3d70a79e096a55e.tar.gz
mailman-13dea3a6736834e19ad569b5e3d70a79e096a55e.tar.zst
mailman-13dea3a6736834e19ad569b5e3d70a79e096a55e.zip
Diffstat (limited to 'Mailman/rules/emergency.py')
-rw-r--r--Mailman/rules/emergency.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/Mailman/rules/emergency.py b/Mailman/rules/emergency.py
new file mode 100644
index 000000000..088ba4ec8
--- /dev/null
+++ b/Mailman/rules/emergency.py
@@ -0,0 +1,44 @@
+# Copyright (C) 2007 by the Free Software Foundation, Inc.
+#
+# This program 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 2
+# of the License, or (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+"""The emergency hold rule."""
+
+__all__ = ['Emergency']
+__metaclass__ = type
+
+
+from zope.interface import implements
+
+from Mailman.i18n import _
+from Mailman.interfaces import IRule
+
+
+
+class Emergency:
+ implements(IRule)
+
+ name = 'emergency'
+ description = _("""\
+The mailing list is in emergency hold and this message was not pre-approved by
+the list administrator.""")
+
+ def check(self, mlist, msg, msgdata):
+ """See `IRule`."""
+ return mlist.emergency and not msgdata.get('adminapproved')
+
+
+emergency_rule = Emergency()