incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [26/50] git commit: [#6186] make SMTP timeouts configurable
Date Fri, 03 May 2013 21:57:56 GMT
[#6186] make SMTP timeouts configurable


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/404b1528
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/404b1528
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/404b1528

Branch: refs/heads/db/6007
Commit: 404b152838b0ba65de2adc59f721c0a0c291302a
Parents: d34331e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed May 1 18:33:57 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed May 1 18:33:57 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/mail_util.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/404b1528/Allura/allura/lib/mail_util.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/mail_util.py b/Allura/allura/lib/mail_util.py
index 166bc92..db7ddb3 100644
--- a/Allura/allura/lib/mail_util.py
+++ b/Allura/allura/lib/mail_util.py
@@ -218,11 +218,15 @@ class SMTPClient(object):
         if asbool(tg.config.get('smtp_ssl', False)):
             smtp_client = smtplib.SMTP_SSL(
                 tg.config.get('smtp_server', 'localhost'),
-                asint(tg.config.get('smtp_port', 25)))
+                asint(tg.config.get('smtp_port', 25)),
+                timeout=float(tg.config.get('smtp_timeout', 10)),
+            )
         else:
             smtp_client = smtplib.SMTP(
                 tg.config.get('smtp_server', 'localhost'),
-                asint(tg.config.get('smtp_port', 465)))
+                asint(tg.config.get('smtp_port', 465)),
+                timeout=float(tg.config.get('smtp_timeout', 10)),
+            )
         if tg.config.get('smtp_user', None):
             smtp_client.login(tg.config['smtp_user'], tg.config['smtp_password'])
         if asbool(tg.config.get('smtp_tls', False)):


Mime
View raw message