aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/rules
diff options
context:
space:
mode:
authorJ08nY2017-06-27 17:53:02 +0200
committerJ08nY2017-06-27 17:53:02 +0200
commit750eb6716d7cc603ae877a484a02bc1b420eb2c5 (patch)
tree960185d61ee52cc231596d7cb83f09d7d95a75d3 /src/mailman_pgp/rules
parentfc513a7842fdc19317c3ffdd5ec75a00db24a7bf (diff)
downloadmailman-pgp-750eb6716d7cc603ae877a484a02bc1b420eb2c5.tar.gz
mailman-pgp-750eb6716d7cc603ae877a484a02bc1b420eb2c5.tar.zst
mailman-pgp-750eb6716d7cc603ae877a484a02bc1b420eb2c5.zip
Diffstat (limited to 'src/mailman_pgp/rules')
-rw-r--r--src/mailman_pgp/rules/signature.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mailman_pgp/rules/signature.py b/src/mailman_pgp/rules/signature.py
index 02f13c1..126ac84 100644
--- a/src/mailman_pgp/rules/signature.py
+++ b/src/mailman_pgp/rules/signature.py
@@ -16,6 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
"""Signature checking rule for the pgp-posting-chain."""
+import logging
from mailman.core.i18n import _
from mailman.interfaces.action import Action
@@ -30,9 +31,13 @@ from mailman_pgp.model.address import PGPAddress
from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.pgp.wrapper import PGPWrapper
+log = logging.getLogger('mailman.plugin.pgp')
-def record_action(msgdata, action, sender, reason):
- msgdata['moderation_action'] = action
+
+def record_action(msg, msgdata, action, sender, reason):
+ log.info('[pgp] {}{}: {}'.format(
+ action.name, msg.get('message-id', 'n/a'), reason))
+ msgdata['moderation_action'] = action.name
msgdata['moderation_sender'] = sender
msgdata.setdefault('moderation_reasons', []).append(reason)
@@ -62,7 +67,7 @@ class Signature:
if not wrapped.is_signed():
action = enc_list.unsigned_msg_action
if action != Action.defer:
- record_action(msgdata, action, msg.sender,
+ record_action(msg, msgdata, action, msg.sender,
'The message is unsigned.')
return True
@@ -70,7 +75,7 @@ class Signature:
if wrapped.inline.is_signed():
action = enc_list.inline_pgp_action
if action != Action.defer:
- record_action(msgdata, action, msg.sender,
+ record_action(msg, msgdata, action, msg.sender,
'Inline PGP is not allowed.')
return True
@@ -92,7 +97,7 @@ class Signature:
if not wrapped.verifies(key):
action = enc_list.invalid_sig_action
if action != Action.defer:
- record_action(msgdata, action, msg.sender,
+ record_action(msg, msgdata, action, msg.sender,
'Signature did not verify.')
return True