##// END OF EJS Templates
patchbomb: add TLS and SMTP AUTH support....
Bryan O'Sullivan -
r1226:f3837564 default
parent child Browse files
Show More
@@ -35,6 +35,9 b''
35 # [smtp]
35 # [smtp]
36 # host = my_mail_host
36 # host = my_mail_host
37 # port = 1025
37 # port = 1025
38 # tls = yes # or omit if not needed
39 # username = user # if SMTP authentication required
40 # password = password # if SMTP authentication required - PLAINTEXT
38 #
41 #
39 # To configure other defaults, add a section like this to your hgrc
42 # To configure other defaults, add a section like this to your hgrc
40 # file:
43 # file:
@@ -209,7 +212,14 b' def patchbomb(ui, repo, *revs, **opts):'
209 s = smtplib.SMTP()
212 s = smtplib.SMTP()
210 s.connect(host = ui.config('smtp', 'host', 'mail'),
213 s.connect(host = ui.config('smtp', 'host', 'mail'),
211 port = int(ui.config('smtp', 'port', 25)))
214 port = int(ui.config('smtp', 'port', 25)))
212
215 if ui.configbool('smtp', 'tls'):
216 s.ehlo()
217 s.starttls()
218 s.ehlo()
219 username = ui.config('smtp', 'username')
220 password = ui.config('smtp', 'password')
221 if username and password:
222 s.login(username, password)
213 parent = None
223 parent = None
214 tz = time.strftime('%z')
224 tz = time.strftime('%z')
215 for m in msgs:
225 for m in msgs:
General Comments 0
You need to be logged in to leave comments. Login now