[PATCH 1 of 1] Support for SMTP TLS and login authentication for patchbomb

Lee Cantey lcantey at gmail.com
Fri Sep 9 10:03:52 CDT 2005


# HG changeset patch
# User Lee Cantey <lcantey at gmail.com>
# Node ID 9bef2390ade73f2507e23071bec05fec44ac59d2
# Parent  9d6023aa8650960d6c0d112438bfb3db9a85abfb
Support for SMTP TLS and login authentication for patchbomb.

Uses new tls(int), username, and password variables in the smtp section of the
configuration file.  Note that the password is stored in plaintext.

* patchbomb (patchbomb): Support for SMTP TLS and login authentication.

diff -r 9d6023aa8650 -r 9bef2390ade7 contrib/patchbomb
--- a/contrib/patchbomb	Fri Sep  9 06:57:40 2005
+++ b/contrib/patchbomb	Fri Sep  9 08:06:02 2005
@@ -209,6 +209,14 @@
         s = smtplib.SMTP()
         s.connect(host = ui.config('smtp', 'host', 'mail'),
                   port = int(ui.config('smtp', 'port', 25)))
+	if int(ui.config('smtp', 'tls', 0)):
+		s.ehlo()
+		s.starttls()
+		s.ehlo()
+	username = ui.config('smtp', 'username', '')
+	password = ui.config('smtp', 'password', '')
+	if username and password:
+		s.login(username, password)
 
     parent = None
     tz = time.strftime('%z')


More information about the Mercurial mailing list