[PATCH] mail: pass ui to sslutil.wrapsocket() even if verifycert is off (issue4713)

Yuya Nishihara yuya at tcha.org
Sat Jun 6 20:27:38 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1433637015 -32400
#      Sun Jun 07 09:30:15 2015 +0900
# Node ID b414c113dd8d96a7084edcb614a78d140aacb504
# Parent  6fabde6ef4453ee6c2aa964184f6cf2c54483621
mail: pass ui to sslutil.wrapsocket() even if verifycert is off (issue4713)

21b536f01eda made 'ui' argument is passed via sslutil.sslkwargs(), but mailer
doesn't call sslkwargs() if smtp.verifycert is off. So we have to put it in
sslkwargs manually.

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -104,7 +104,8 @@ def _smtp(ui):
     if (starttls or smtps) and verifycert:
         sslkwargs = sslutil.sslkwargs(ui, mailhost)
     else:
-        sslkwargs = {}
+        # 'ui' is required by sslutil.wrapsocket() and set by sslkwargs()
+        sslkwargs = {'ui': ui}
     if smtps:
         ui.note(_('(using smtps)\n'))
         s = SMTPS(sslkwargs, local_hostname=local_hostname)


More information about the Mercurial-devel mailing list