##// END OF EJS Templates
mail.py: don't try to use TLS if python doesn't have SSL support...
Alexis S. L. Carvalho -
r4093:669f99f7 default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7
7
8 from i18n import gettext as _
8 from i18n import gettext as _
9 from demandload import *
9 from demandload import *
10 demandload(globals(), "os re smtplib templater util")
10 demandload(globals(), "os re smtplib templater util socket")
11
11
12 def _smtp(ui):
12 def _smtp(ui):
13 '''send mail using smtp.'''
13 '''send mail using smtp.'''
@@ -22,6 +22,9 b' def _smtp(ui):'
22 (mailhost, mailport))
22 (mailhost, mailport))
23 s.connect(host=mailhost, port=mailport)
23 s.connect(host=mailhost, port=mailport)
24 if ui.configbool('smtp', 'tls'):
24 if ui.configbool('smtp', 'tls'):
25 if not hasattr(socket, 'ssl'):
26 raise util.Abort(_("can't use TLS: Python SSL support "
27 "not installed"))
25 ui.note(_('(using tls)\n'))
28 ui.note(_('(using tls)\n'))
26 s.ehlo()
29 s.ehlo()
27 s.starttls()
30 s.starttls()
General Comments 0
You need to be logged in to leave comments. Login now