Show More
@@ -708,13 +708,7 b' def email(ui, repo, *revs, **opts):' | |||
|
708 | 708 | fp.close() |
|
709 | 709 | else: |
|
710 | 710 | if not sendmail: |
|
711 | verifycert = ui.config('smtp', 'verifycert', 'strict') | |
|
712 | if opts.get('insecure'): | |
|
713 | ui.setconfig('smtp', 'verifycert', 'loose', 'patchbomb') | |
|
714 | try: | |
|
715 | sendmail = mail.connect(ui, mbox=mbox) | |
|
716 | finally: | |
|
717 | ui.setconfig('smtp', 'verifycert', verifycert, 'patchbomb') | |
|
711 | sendmail = mail.connect(ui, mbox=mbox) | |
|
718 | 712 | ui.status(_('sending '), subj, ' ...\n') |
|
719 | 713 | ui.progress(_('sending'), i, item=subj, total=len(msgs), |
|
720 | 714 | unit=_('emails')) |
@@ -1486,16 +1486,6 b' Configuration for extensions that need t' | |||
|
1486 | 1486 | Optional. Method to enable TLS when connecting to mail server: starttls, |
|
1487 | 1487 | smtps or none. (default: none) |
|
1488 | 1488 | |
|
1489 | ``verifycert`` | |
|
1490 | Optional. Verification for the certificate of mail server, when | |
|
1491 | ``tls`` is starttls or smtps. "strict", "loose" or False. For | |
|
1492 | "strict" or "loose", the certificate is verified as same as the | |
|
1493 | verification for HTTPS connections (see ``[hostfingerprints]`` and | |
|
1494 | ``[web] cacerts`` also). For "strict", sending email is also | |
|
1495 | aborted, if there is no configuration for mail server in | |
|
1496 | ``[hostfingerprints]`` and ``[web] cacerts``. --insecure for | |
|
1497 | :hg:`email` overwrites this as "loose". (default: strict) | |
|
1498 | ||
|
1499 | 1489 | ``username`` |
|
1500 | 1490 | Optional. User name for authenticating with the SMTP server. |
|
1501 | 1491 | (default: None) |
@@ -106,13 +106,6 b' def _smtp(ui):' | |||
|
106 | 106 | mailhost = ui.config('smtp', 'host') |
|
107 | 107 | if not mailhost: |
|
108 | 108 | raise error.Abort(_('smtp.host not configured - cannot send mail')) |
|
109 | verifycert = ui.config('smtp', 'verifycert', 'strict') | |
|
110 | if verifycert not in ['strict', 'loose']: | |
|
111 | if util.parsebool(verifycert) is not False: | |
|
112 | raise error.Abort(_('invalid smtp.verifycert configuration: %s') | |
|
113 | % (verifycert)) | |
|
114 | verifycert = False | |
|
115 | ||
|
116 | 109 | if smtps: |
|
117 | 110 | ui.note(_('(using smtps)\n')) |
|
118 | 111 | s = SMTPS(ui, local_hostname=local_hostname, host=mailhost) |
@@ -133,9 +126,9 b' def _smtp(ui):' | |||
|
133 | 126 | s.ehlo() |
|
134 | 127 | s.starttls() |
|
135 | 128 | s.ehlo() |
|
136 |
if |
|
|
129 | if starttls or smtps: | |
|
137 | 130 | ui.note(_('(verifying remote certificate)\n')) |
|
138 |
sslutil.validatesocket(s.sock |
|
|
131 | sslutil.validatesocket(s.sock) | |
|
139 | 132 | username = ui.config('smtp', 'username') |
|
140 | 133 | password = ui.config('smtp', 'password') |
|
141 | 134 | if username and not password: |
General Comments 0
You need to be logged in to leave comments.
Login now