# HG changeset patch # User Bryan O'Sullivan # Date 1126288745 25200 # Node ID f3837564ed038a0ba03aee8b9194633a8d496eef # Parent ea90162e210cb3a95ed3cd1eaba8862e372524d9 patchbomb: add TLS and SMTP AUTH support. Original patch from Lee Cantey . diff --git a/contrib/patchbomb b/contrib/patchbomb --- a/contrib/patchbomb +++ b/contrib/patchbomb @@ -35,6 +35,9 @@ # [smtp] # host = my_mail_host # port = 1025 +# tls = yes # or omit if not needed +# username = user # if SMTP authentication required +# password = password # if SMTP authentication required - PLAINTEXT # # To configure other defaults, add a section like this to your hgrc # file: @@ -209,7 +212,14 @@ def patchbomb(ui, repo, *revs, **opts): s = smtplib.SMTP() s.connect(host = ui.config('smtp', 'host', 'mail'), port = int(ui.config('smtp', 'port', 25))) - + if ui.configbool('smtp', 'tls'): + 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') for m in msgs: