equal
deleted
inserted
replaced
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() |