equal
deleted
inserted
replaced
31 email.Header.Header.__dict__['__init__'] = _unifiedheaderinit |
31 email.Header.Header.__dict__['__init__'] = _unifiedheaderinit |
32 |
32 |
33 def _smtp(ui): |
33 def _smtp(ui): |
34 '''build an smtp connection and return a function to send mail''' |
34 '''build an smtp connection and return a function to send mail''' |
35 local_hostname = ui.config('smtp', 'local_hostname') |
35 local_hostname = ui.config('smtp', 'local_hostname') |
36 tls = ui.config('smtp', 'tls') |
36 tls = ui.config('smtp', 'tls', 'none') |
37 # backward compatible: when tls = true, we use starttls. |
37 # backward compatible: when tls = true, we use starttls. |
38 starttls = tls == 'starttls' or util.parsebool(tls) |
38 starttls = tls == 'starttls' or util.parsebool(tls) |
39 smtps = tls == 'smtps' |
39 smtps = tls == 'smtps' |
40 if (starttls or smtps) and not hasattr(socket, 'ssl'): |
40 if (starttls or smtps) and not hasattr(socket, 'ssl'): |
41 raise util.Abort(_("can't use TLS: Python SSL support not installed")) |
41 raise util.Abort(_("can't use TLS: Python SSL support not installed")) |