diff options
author | Isis Lovecruft <isis@torproject.org> | 2013-04-15 19:35:47 +0000 |
---|---|---|
committer | Isis Lovecruft <isis@torproject.org> | 2013-04-15 19:35:47 +0000 |
commit | 8646cf310a34828920f9cbf36c1f4c3da3cb6f9d (patch) | |
tree | 88be26f20190d4ff84622333a8e3383958457d25 /src/leap | |
parent | e17f2beb230b3276473d77957e4d6a3f4da2c814 (diff) |
Fix logic for return of Postfix TCP map responses in alias_resolver.StatusCodes
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/mx/alias_resolver.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/leap/mx/alias_resolver.py b/src/leap/mx/alias_resolver.py index 4fc20f5..48e7a85 100644 --- a/src/leap/mx/alias_resolver.py +++ b/src/leap/mx/alias_resolver.py @@ -146,11 +146,15 @@ class StatusCodes(object): """ if status_code: if isinstance(status_code, str): - return status_code, getattr(self, status_code.upper(), None) + if status_code.upper() in self.SMTPStrings.keys(): + return self.SMTPStrings[status_code], getattr( + self, status_code.upper(), '') + else: + return 500, self.FAIL elif isinstance(status_code, int): - for k, v in self.fake_smtp_codes.items(): - ## we want to return None if it's 550 - if k == str(status_code) and k != '550': + for k, v in self.SMTPCodes.items(): + ## we want to return None if it's 500 + if k == str(status_code) and k != '500': return status_code, v log.debug("%s" % self.NOKEY) return None, '' |