diff options
| author | J08nY | 2017-06-27 15:50:33 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-27 15:50:33 +0200 |
| commit | a2f2b42cc5ba705463830d32a06ecd0b368d4c39 (patch) | |
| tree | f546587c077589e74dfb3f42dd094b02a6dea568 /src/mailman_pgp/rules | |
| parent | e2653d12da7c9fb15f9431419eff0ea1819ebb53 (diff) | |
| download | mailman-pgp-a2f2b42cc5ba705463830d32a06ecd0b368d4c39.tar.gz mailman-pgp-a2f2b42cc5ba705463830d32a06ecd0b368d4c39.tar.zst mailman-pgp-a2f2b42cc5ba705463830d32a06ecd0b368d4c39.zip | |
Diffstat (limited to 'src/mailman_pgp/rules')
| -rw-r--r-- | src/mailman_pgp/rules/encryption.py | 4 | ||||
| -rw-r--r-- | src/mailman_pgp/rules/signature.py | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/mailman_pgp/rules/encryption.py b/src/mailman_pgp/rules/encryption.py index cabd62c..8e4840d 100644 --- a/src/mailman_pgp/rules/encryption.py +++ b/src/mailman_pgp/rules/encryption.py @@ -30,8 +30,8 @@ class Encryption: name = 'encryption' description = _( - """A rule which jumps to the moderation chain, - when the incoming runner instructs it to.""") + "A rule which jumps to the moderation chain, " + "when the incoming runner instructs it to.") record = True def check(self, mlist, msg, msgdata): diff --git a/src/mailman_pgp/rules/signature.py b/src/mailman_pgp/rules/signature.py index 6bac3dc..02f13c1 100644 --- a/src/mailman_pgp/rules/signature.py +++ b/src/mailman_pgp/rules/signature.py @@ -44,14 +44,14 @@ class Signature: name = 'signature' description = _( - """A rule which enforces PGP enabled list signature configuration.""") + "A rule which enforces PGP enabled list signature configuration.") record = True def check(self, mlist, msg, msgdata): """See `IRule`.""" # Find the `PGPMailingList` this is for. enc_list = query(PGPMailingList).filter_by( - list_id=mlist.list_id).first() + list_id=mlist.list_id).first() if enc_list is None: raise ValueError('PGP enabled mailing list not found.') @@ -63,7 +63,7 @@ class Signature: action = enc_list.unsigned_msg_action if action != Action.defer: record_action(msgdata, action, msg.sender, - 'The message is unsigned.') + 'The message is unsigned.') return True # Take `inline_pgp_action` if inline signed. @@ -71,7 +71,7 @@ class Signature: action = enc_list.inline_pgp_action if action != Action.defer: record_action(msgdata, action, msg.sender, - 'Inline PGP is not allowed.') + 'Inline PGP is not allowed.') return True # Lookup the address by sender, and its corresponding `PGPAddress`. @@ -79,7 +79,7 @@ class Signature: sender = msg.sender address = user_manager.get_address(sender) enc_address = PGPAddress.query().filter_by( - email=address.email).first() + email=address.email).first() if enc_address is None: raise ValueError('PGP enabled address not found.') @@ -93,10 +93,9 @@ class Signature: action = enc_list.invalid_sig_action if action != Action.defer: record_action(msgdata, action, msg.sender, - 'Signature did not verify.') + 'Signature did not verify.') return True - # # TODO: handle more signatures here? # sig_obj = next(verification.good_signatures) # sig_key = sig_obj.by |
