mercurial/mail.py
changeset 46907 ffd3e823a7e5
parent 46819 d4ba4d51f85f
child 46982 d467bae86b2d
equal deleted inserted replaced
46906:33524c46a092 46907:ffd3e823a7e5
    32     util,
    32     util,
    33 )
    33 )
    34 from .utils import (
    34 from .utils import (
    35     procutil,
    35     procutil,
    36     stringutil,
    36     stringutil,
       
    37     urlutil,
    37 )
    38 )
    38 
    39 
    39 if pycompat.TYPE_CHECKING:
    40 if pycompat.TYPE_CHECKING:
    40     from typing import Any, List, Tuple, Union
    41     from typing import Any, List, Tuple, Union
    41 
    42 
   137         s = smtplib.SMTP(local_hostname=local_hostname)
   138         s = smtplib.SMTP(local_hostname=local_hostname)
   138     if smtps:
   139     if smtps:
   139         defaultport = 465
   140         defaultport = 465
   140     else:
   141     else:
   141         defaultport = 25
   142         defaultport = 25
   142     mailport = util.getport(ui.config(b'smtp', b'port', defaultport))
   143     mailport = urlutil.getport(ui.config(b'smtp', b'port', defaultport))
   143     ui.note(_(b'sending mail: smtp host %s, port %d\n') % (mailhost, mailport))
   144     ui.note(_(b'sending mail: smtp host %s, port %d\n') % (mailhost, mailport))
   144     s.connect(host=mailhost, port=mailport)
   145     s.connect(host=mailhost, port=mailport)
   145     if starttls:
   146     if starttls:
   146         ui.note(_(b'(using starttls)\n'))
   147         ui.note(_(b'(using starttls)\n'))
   147         s.ehlo()
   148         s.ehlo()