mirror of
https://github.com/simple-login/app.git
synced 2025-11-10 01:40:49 +08:00
use POSTFIX_PORT instead of 25 if it's set
This commit is contained in:
parent
817e4e0f87
commit
a512fbc6e5
2 changed files with 4 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ from app.config import (
|
||||||
MAX_NB_EMAIL_FREE_PLAN,
|
MAX_NB_EMAIL_FREE_PLAN,
|
||||||
DISPOSABLE_EMAIL_DOMAINS,
|
DISPOSABLE_EMAIL_DOMAINS,
|
||||||
MAX_ALERT_24H,
|
MAX_ALERT_24H,
|
||||||
|
POSTFIX_PORT,
|
||||||
)
|
)
|
||||||
from app.dns_utils import get_mx_domains
|
from app.dns_utils import get_mx_domains
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
|
@ -197,7 +198,7 @@ def send_email(
|
||||||
smtp = SMTP(POSTFIX_SERVER, 587)
|
smtp = SMTP(POSTFIX_SERVER, 587)
|
||||||
smtp.starttls()
|
smtp.starttls()
|
||||||
else:
|
else:
|
||||||
smtp = SMTP(POSTFIX_SERVER, 25)
|
smtp = SMTP(POSTFIX_SERVER, POSTFIX_PORT or 25)
|
||||||
|
|
||||||
if bounced_email:
|
if bounced_email:
|
||||||
msg = MIMEMultipart("mixed")
|
msg = MIMEMultipart("mixed")
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ from app.config import (
|
||||||
ALERT_BOUNCE_EMAIL,
|
ALERT_BOUNCE_EMAIL,
|
||||||
ALERT_SPAM_EMAIL,
|
ALERT_SPAM_EMAIL,
|
||||||
ALERT_SPF,
|
ALERT_SPF,
|
||||||
|
POSTFIX_PORT,
|
||||||
)
|
)
|
||||||
from app.email_utils import (
|
from app.email_utils import (
|
||||||
send_email,
|
send_email,
|
||||||
|
|
@ -1018,7 +1019,7 @@ class MailHandler:
|
||||||
smtp = SMTP(POSTFIX_SERVER, 587)
|
smtp = SMTP(POSTFIX_SERVER, 587)
|
||||||
smtp.starttls()
|
smtp.starttls()
|
||||||
else:
|
else:
|
||||||
smtp = SMTP(POSTFIX_SERVER, 25)
|
smtp = SMTP(POSTFIX_SERVER, POSTFIX_PORT or 25)
|
||||||
|
|
||||||
app = new_app()
|
app = new_app()
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue