mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
parent
b14534db2c
commit
51a7dbfa52
2 changed files with 11 additions and 0 deletions
|
@ -292,6 +292,10 @@ def send_email(
|
|||
msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
|
||||
)
|
||||
|
||||
# add DKIM
|
||||
email_domain = SUPPORT_EMAIL[SUPPORT_EMAIL.find("@") + 1 :]
|
||||
add_dkim_signature(msg, email_domain)
|
||||
|
||||
msg_raw = to_bytes(msg)
|
||||
|
||||
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
||||
|
|
|
@ -90,6 +90,7 @@ from app.email.rate_limit import rate_limited
|
|||
from app.email.spam import get_spam_score
|
||||
from app.email_utils import (
|
||||
send_email,
|
||||
add_dkim_signature,
|
||||
add_or_replace_header,
|
||||
delete_header,
|
||||
render,
|
||||
|
@ -103,6 +104,7 @@ from app.email_utils import (
|
|||
to_bytes,
|
||||
send_email_at_most_times,
|
||||
is_valid_alias_address_domain,
|
||||
should_add_dkim_signature,
|
||||
add_header,
|
||||
get_header_unicode,
|
||||
generate_reply_email,
|
||||
|
@ -826,6 +828,8 @@ def forward_email_to_mailbox(
|
|||
msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
|
||||
)
|
||||
|
||||
add_dkim_signature(msg, EMAIL_DOMAIN)
|
||||
|
||||
LOG.d(
|
||||
"Forward mail from %s to %s, mail_options:%s, rcpt_options:%s ",
|
||||
contact.website_email,
|
||||
|
@ -1058,6 +1062,9 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
|||
envelope.rcpt_options,
|
||||
)
|
||||
|
||||
if should_add_dkim_signature(alias_domain):
|
||||
add_dkim_signature(msg, alias_domain)
|
||||
|
||||
# generate a mail_from for VERP
|
||||
verp_mail_from = f"{BOUNCE_PREFIX_FOR_REPLY_PHASE}+{email_log.id}+@{alias_domain}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue