# 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 -r ea90162e210c -r f3837564ed03 contrib/patchbomb --- a/contrib/patchbomb Thu Sep 08 17:09:31 2005 -0700 +++ b/contrib/patchbomb Fri Sep 09 10:59:05 2005 -0700 @@ -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 @@ 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: