diff --git a/debian/changelog b/debian/changelog index b030127..25cb793 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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) Mon, 1 Oct 2007 18:04:14 +0200 diff --git a/requestsync b/requestsync index 3107802..64da9a4 100755 --- a/requestsync +++ b/requestsync @@ -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)