[Debexpo-devel] [debexpo] 16/32: Enable to customize SMTP port

Kentaro Hayashi kenhys-guest at moszumanska.debian.org
Sat Aug 19 06:51:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

kenhys-guest pushed a commit to branch master
in repository debexpo.

commit c7428195e860d654fef4d03ea15bf5ca10646d74
Author: Kentaro Hayashi <kenhys at gmail.com>
Date:   Sun Jun 12 15:42:43 2016 +0900

    Enable to customize SMTP port
---
 debexpo/lib/email.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/debexpo/lib/email.py b/debexpo/lib/email.py
index 039a7eb..70a1763 100644
--- a/debexpo/lib/email.py
+++ b/debexpo/lib/email.py
@@ -80,6 +80,10 @@ class Email(object):
         """
         self.template = template
         self.server = pylons.config['global_conf']['smtp_server']
+        if 'smtp_port' in pylons.config['global_conf']:
+            self.port = pylons.config['global_conf']['smtp_port']
+        else:
+            self.port = smtplib.SMTP_PORT
         self.auth = None
 
         # Look whether auth is required.
@@ -146,8 +150,8 @@ class Email(object):
 
         pylons.url._pop_object()
 
-        log.debug('Starting SMTP session to %s' % self.server)
-        session = smtplib.SMTP(self.server)
+        log.debug('Starting SMTP session to %s:%s' % (self.server, self.port))
+        session = smtplib.SMTP(self.server, self.port)
 
         if self.auth:
             log.debug('Authentication requested; logging in')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debexpo/debexpo.git



More information about the Debexpo-devel mailing list