diff options
author | drebs <drebs@leap.se> | 2015-03-24 15:09:18 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2015-03-25 17:06:25 -0300 |
commit | 5a45acd3486f4e7f830647953731353cda916d51 (patch) | |
tree | b25c6bc90b81b98348b289507cb5f674f4f5486e /src/leap/mx/check_recipient_access.py | |
parent | 938cada00298243f0cf51c9bfd460ecb16938b57 (diff) |
[feat] reject incoming mail if no pgp key found
Implement a PGP key lookup in the postfix smtp recipient restriction and
virtual alias mapping levels. If no PGP key is found, then the address is
rejected with a temporary error.
Closes: #6795
Diffstat (limited to 'src/leap/mx/check_recipient_access.py')
-rw-r--r-- | src/leap/mx/check_recipient_access.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/mx/check_recipient_access.py b/src/leap/mx/check_recipient_access.py index b80ccfd..d4ae339 100644 --- a/src/leap/mx/check_recipient_access.py +++ b/src/leap/mx/check_recipient_access.py @@ -32,8 +32,11 @@ class LEAPPostFixTCPMapserverAccess(postfix.PostfixTCPMapServer): # For more info, see: # http://www.postfix.org/tcp_table.5.html # http://www.postfix.org/access.5.html - if value is None: + uuid, pubkey = value + if uuid is None: self.sendCode(500, postfix.quote("REJECT")) + elif pubkey is None: + self.sendCode(400, postfix.quote("4.7.13 USER ACCOUNT DISABLED")) else: self.sendCode(200, postfix.quote("OK")) |