[Python-checkins] hooks: add support for logging in

benjamin.peterson python-checkins at python.org
Fri Sep 12 20:13:37 CEST 2014


http://hg.python.org/hooks/rev/2a814d66b1e9
changeset:   91:2a814d66b1e9
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Sep 12 17:56:46 2014 +0000
summary:
  add support for logging in

files:
  mail.py |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/mail.py b/mail.py
--- a/mail.py
+++ b/mail.py
@@ -151,6 +151,9 @@
     host = ui.config('smtp', 'host', '')
     port = int(ui.config('smtp', 'port', 0))
     smtp = smtplib.SMTP(host, port)
+    username = ui.config('smtp', 'username', '')
+    if username:
+        smtp.login(username, ui.config('smtp', 'password', ''))
     send(smtp, subj, sender, to, '\n'.join(body) + '\n')
     smtp.close()
 

-- 
Repository URL: http://hg.python.org/hooks


More information about the Python-checkins mailing list