mirror of
https://github.com/simple-login/app.git
synced 2025-09-06 14:44:20 +08:00
Add connect timeout
This commit is contained in:
parent
0dedb6ae9c
commit
7347fc75d4
2 changed files with 4 additions and 1 deletions
|
@ -160,6 +160,7 @@ else:
|
|||
default_postfix_port = 25
|
||||
POSTFIX_PORT = int(os.environ.get("POSTFIX_PORT", default_postfix_port))
|
||||
POSTFIX_TIMEOUT = int(os.environ.get("POSTFIX_TIMEOUT", 3))
|
||||
POSTFIX_CONNECT_TIMEOUT = float(os.environ.get("POSTFIX_CONNECT_TIMEOUT", 1))
|
||||
|
||||
# ["domain1.com", "domain2.com"]
|
||||
OTHER_ALIAS_DOMAINS = sl_getenv("OTHER_ALIAS_DOMAINS", list)
|
||||
|
|
|
@ -194,7 +194,9 @@ class MailSender:
|
|||
else:
|
||||
server_host = server_split[0]
|
||||
server_port = server_split[1]
|
||||
with SMTP(host=server_host, port=server_port) as smtp:
|
||||
with SMTP(
|
||||
host=server_host, port=server_port, timeout=config.POSTFIX_CONNECT_TIMEOUT
|
||||
) as smtp:
|
||||
smtp.timeout = config.POSTFIX_TIMEOUT
|
||||
|
||||
if config.POSTFIX_SUBMISSION_TLS:
|
||||
|
|
Loading…
Add table
Reference in a new issue