mercurial/mail.py
changeset 13244 d8f92c3a17d6
parent 13201 f05250572467
child 14234 600e64004eb5
equal deleted inserted replaced
13243:159651b3c9ec 13244:d8f92c3a17d6
    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"))