diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/kolab_smtp_access_policy.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py index bc53278..ed1ce21 100755 --- a/bin/kolab_smtp_access_policy.py +++ b/bin/kolab_smtp_access_policy.py @@ -1222,12 +1222,18 @@ def read_request_input(): containing the request. """ + start_time = time.time() + log.debug(_("Starting to loop for new request")) policy_request = {} end_of_request = False while not end_of_request: + if (time.time()-start_time) >= conf.timeout: + log.warning(_("Timeout for policy request reading exceeded")) + sys.exit(1) + request_line = sys.stdin.readline() if request_line.strip() == '': if policy_request.has_key('request'): @@ -1268,6 +1274,12 @@ if __name__ == "__main__": _("Access Policy Options") ) + access_policy_group.add_option( "--timeout", + dest = "timeout", + action = "store", + default = 10, + help = _("SMTP Policy request timeout.")) + access_policy_group.add_option( "--verify-recipient", dest = "verify_recipient", action = "store_true", |