parent
b14534db2c
commit
51a7dbfa52
|
@ -292,6 +292,10 @@ def send_email(
|
||||||
msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
|
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)
|
msg_raw = to_bytes(msg)
|
||||||
|
|
||||||
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
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.spam import get_spam_score
|
||||||
from app.email_utils import (
|
from app.email_utils import (
|
||||||
send_email,
|
send_email,
|
||||||
|
add_dkim_signature,
|
||||||
add_or_replace_header,
|
add_or_replace_header,
|
||||||
delete_header,
|
delete_header,
|
||||||
render,
|
render,
|
||||||
|
@ -103,6 +104,7 @@ from app.email_utils import (
|
||||||
to_bytes,
|
to_bytes,
|
||||||
send_email_at_most_times,
|
send_email_at_most_times,
|
||||||
is_valid_alias_address_domain,
|
is_valid_alias_address_domain,
|
||||||
|
should_add_dkim_signature,
|
||||||
add_header,
|
add_header,
|
||||||
get_header_unicode,
|
get_header_unicode,
|
||||||
generate_reply_email,
|
generate_reply_email,
|
||||||
|
@ -826,6 +828,8 @@ def forward_email_to_mailbox(
|
||||||
msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
|
msg, "List-Unsubscribe-Post", "List-Unsubscribe=One-Click"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_dkim_signature(msg, EMAIL_DOMAIN)
|
||||||
|
|
||||||
LOG.d(
|
LOG.d(
|
||||||
"Forward mail from %s to %s, mail_options:%s, rcpt_options:%s ",
|
"Forward mail from %s to %s, mail_options:%s, rcpt_options:%s ",
|
||||||
contact.website_email,
|
contact.website_email,
|
||||||
|
@ -1058,6 +1062,9 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
||||||
envelope.rcpt_options,
|
envelope.rcpt_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if should_add_dkim_signature(alias_domain):
|
||||||
|
add_dkim_signature(msg, alias_domain)
|
||||||
|
|
||||||
# generate a mail_from for VERP
|
# generate a mail_from for VERP
|
||||||
verp_mail_from = f"{BOUNCE_PREFIX_FOR_REPLY_PHASE}+{email_log.id}+@{alias_domain}"
|
verp_mail_from = f"{BOUNCE_PREFIX_FOR_REPLY_PHASE}+{email_log.id}+@{alias_domain}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue