From 5e7fdbb97435fd823290c4040f01d1fe8481b9f7 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" Date: Thu, 8 Mar 2012 10:03:20 +0000 Subject: Fix the empty recipient inserting at the data request state --- bin/kolab_smtp_access_policy.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py index a74d506..9f7a206 100755 --- a/bin/kolab_smtp_access_policy.py +++ b/bin/kolab_smtp_access_policy.py @@ -183,7 +183,8 @@ class PolicyRequest(object): setattr(self, key, policy_request[key]) else: - self.recipients.append(policy_request['recipient']) + if not policy_request['recipient'].strip() == '': + self.recipients.append(policy_request['recipient']) def add_request(self, policy_request={}): """ @@ -213,7 +214,8 @@ class PolicyRequest(object): policy_request['recipient'] ) - self.recipients.append(policy_request['recipient']) + if not policy_request['recipient'].strip() == '': + self.recipients.append(policy_request['recipient']) def parse_ldap_dn(self, dn): """ @@ -1231,7 +1233,7 @@ def read_request_input(): containing the request. """ - log.debug(_("Reading request")) + log.debug(_("Starting to loop for new request")) policy_request = {} @@ -1240,10 +1242,11 @@ def read_request_input(): request_line = sys.stdin.readline() if request_line.strip() == '': if policy_request.has_key('request'): - log.debug(_("End of request")) + log.debug(_("End of current request"), level=8) end_of_request = True else: request_line = request_line.strip() + log.debug(_("Getting line: %s") %(request_line), level=8) policy_request[request_line.split('=')[0]] = \ '='.join(request_line.split('=')[1:]).lower() @@ -1323,6 +1326,8 @@ if __name__ == "__main__": # set to a non-zero value and the protocol_state being set to 'data'. # Note that the input we're getting is a string, not an integer. else: + log.debug(_("Request instance %s reached DATA state") %(instance)) + sender_allowed = False recipient_allowed = False -- cgit v1.1