Merge with Laurent Bigonville's patch to allow to choose a SMTP port.

This commit is contained in:
Siegfried-Angel Gevatter Pujals (RainCT) 2007-10-06 21:39:08 +02:00
commit b3e31310db
2 changed files with 15 additions and 1 deletions

4
debian/changelog vendored
View File

@ -1,7 +1,11 @@
ubuntu-dev-tools (0.19) UNRELEASED; urgency=low
[ Siegfried-Angel Gevatter Pujals (RainCT) ]
* requestsync: allow to customize the SMTP server (LP: #144244)
* Add a short description for requestsync to the README file.
[ Laurent Bigonville ]
* requestsync: allow to customize the SMTP port
-- Siegfried-Angel Gevatter Pujals (RainCT) <siggi.gevatter@gmail.com> Mon, 1 Oct 2007 18:04:14 +0200

View File

@ -202,8 +202,15 @@ if mailserver:
else :
mailserver = 'fiordland.ubuntu.com'
# get server port
mailserver_port = os.getenv('DEBSMTP_PORT')
if mailserver_port:
print 'Using custom SMTP port:', mailserver_port
else:
mailserver_port = 25
# connect to the server
s = smtplib.SMTP(mailserver)
s = smtplib.SMTP(mailserver, mailserver_port)
# authenticate to the server
mailserver_user = os.getenv('DEBSMTP_USER')
@ -214,6 +221,9 @@ if mailserver_user and mailserver_pass:
except smtplib.SMTPAuthenticationError:
print 'Error authenticating to the server: invalid username and password.'
s.quit(); sys.exit(1)
except:
print 'Unknown SMTP error.'
s.quit(); sys.exit(1)
s.sendmail(myemailaddr, to, mail)