mirror of
https://github.com/simple-login/app.git
synced 2026-06-06 19:37:35 +00:00
use _ instead of . in reverse alias
to avoid AC_FROM_MANY_DOTS SpamAssassin rule
This commit is contained in:
+3
-1
@@ -1078,7 +1078,9 @@ def generate_reply_email(contact_email: str, user: User) -> str:
|
||||
contact_email = convert_to_id(contact_email)
|
||||
contact_email = sanitize_email(contact_email)
|
||||
contact_email = contact_email[:45]
|
||||
contact_email = contact_email.replace("@", ".at.")
|
||||
# use _ instead of . to avoid AC_FROM_MANY_DOTS SpamAssassin rule
|
||||
contact_email = contact_email.replace("@", "_at_")
|
||||
contact_email = contact_email.replace(".", "_")
|
||||
contact_email = convert_to_alphanumeric(contact_email)
|
||||
|
||||
# not use while to avoid infinite loop
|
||||
|
||||
@@ -500,18 +500,18 @@ def test_generate_reply_email_include_sender_in_reverse_alias(flask_client):
|
||||
user.include_sender_in_reverse_alias = True
|
||||
|
||||
reply_email = generate_reply_email("test@example.org", user)
|
||||
assert reply_email.startswith("test.at.example.org")
|
||||
assert reply_email.startswith("test_at_example_org")
|
||||
assert reply_email.endswith(EMAIL_DOMAIN)
|
||||
|
||||
reply_email = generate_reply_email("", user)
|
||||
assert reply_email.endswith(EMAIL_DOMAIN)
|
||||
|
||||
reply_email = generate_reply_email("👌汉字@example.org", user)
|
||||
assert reply_email.startswith("yizi.at.example.org")
|
||||
assert reply_email.startswith("yizi_at_example_org")
|
||||
|
||||
# make sure reply_email only contain lowercase
|
||||
reply_email = generate_reply_email("TEST@example.org", user)
|
||||
assert reply_email.startswith("test.at.example.org")
|
||||
assert reply_email.startswith("test_at_example_org")
|
||||
|
||||
|
||||
def test_normalize_reply_email(flask_client):
|
||||
|
||||
Reference in New Issue
Block a user