log how much time to get a smtp connection

This commit is contained in:
Son 2021-12-30 11:28:50 +01:00
parent c2e95f0853
commit b3469ba9d4
1 changed files with 3 additions and 0 deletions

View File

@ -1297,6 +1297,7 @@ def sl_sendmail(
return
try:
start = time.time()
if POSTFIX_SUBMISSION_TLS:
smtp_port = 587
else:
@ -1306,6 +1307,8 @@ def sl_sendmail(
if POSTFIX_SUBMISSION_TLS:
smtp.starttls()
LOG.d("getting a smtp connection takes seconds %s", time.time() - start)
# smtp.send_message has UnicodeEncodeError
# encode message raw directly instead
LOG.d(