mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 06:55:59 +08:00
More rebase fixes
This commit is contained in:
parent
dce9e633bf
commit
451e69a3c4
|
@ -1474,7 +1474,7 @@ def get_spamd_result(msg: Message) -> Optional[SpamdResult]:
|
|||
|
||||
|
||||
def generate_verp_email(
|
||||
verp_type: VerpType, object_id: int, sender_domain: Optional[str]
|
||||
verp_type: VerpType, object_id: int, sender_domain: Optional[str] = None
|
||||
) -> str:
|
||||
# Encoded as a list to minimize size of email address
|
||||
data = [verp_type.bounce_forward.value, object_id, int(time.time())]
|
||||
|
|
|
@ -157,7 +157,8 @@ from app.models import (
|
|||
DomainDeletedAlias,
|
||||
Notification,
|
||||
DmarcCheckResult,
|
||||
SPFCheckResult, VerpType,
|
||||
SPFCheckResult,
|
||||
VerpType,
|
||||
)
|
||||
from app.pgp_utils import PGPException, sign_data_with_pgpy, sign_data
|
||||
from app.utils import sanitize_email
|
||||
|
|
|
@ -3,15 +3,15 @@ from email.message import EmailMessage
|
|||
from aiosmtpd.smtp import Envelope
|
||||
|
||||
import email_handler
|
||||
from app.config import BOUNCE_EMAIL
|
||||
from app.email import headers, status
|
||||
from app.email_utils import generate_verp_email
|
||||
from app.models import (
|
||||
User,
|
||||
Alias,
|
||||
AuthorizedAddress,
|
||||
IgnoredEmail,
|
||||
EmailLog,
|
||||
Notification,
|
||||
Notification, VerpType,
|
||||
)
|
||||
from email_handler import (
|
||||
get_mailbox_from_mail_from,
|
||||
|
@ -127,7 +127,7 @@ def test_prevent_5xx_from_spf(flask_client):
|
|||
{"alias_email": alias.email, "spf_result": "R_SPF_FAIL"},
|
||||
)
|
||||
envelope = Envelope()
|
||||
envelope.mail_from = BOUNCE_EMAIL.format(999999999999999999)
|
||||
envelope.mail_from = generate_verp_email(VerpType.bounce_forward, 99999999999999)
|
||||
envelope.rcpt_tos = [msg["to"]]
|
||||
result = email_handler.MailHandler()._handle(envelope, msg)
|
||||
assert result == status.E216
|
||||
|
@ -141,7 +141,7 @@ def test_preserve_5xx_with_valid_spf(flask_client):
|
|||
{"alias_email": alias.email, "spf_result": "R_SPF_ALLOW"},
|
||||
)
|
||||
envelope = Envelope()
|
||||
envelope.mail_from = BOUNCE_EMAIL.format(999999999999999999)
|
||||
envelope.mail_from = generate_verp_email(VerpType.bounce_forward, 99999999999999)
|
||||
envelope.rcpt_tos = [msg["to"]]
|
||||
result = email_handler.MailHandler()._handle(envelope, msg)
|
||||
assert result == status.E512
|
||||
|
@ -155,7 +155,7 @@ def test_preserve_5xx_with_no_header(flask_client):
|
|||
{"alias_email": alias.email},
|
||||
)
|
||||
envelope = Envelope()
|
||||
envelope.mail_from = BOUNCE_EMAIL.format(999999999999999999)
|
||||
envelope.mail_from = generate_verp_email(VerpType.bounce_forward, 99999999999999)
|
||||
envelope.rcpt_tos = [msg["to"]]
|
||||
result = email_handler.MailHandler()._handle(envelope, msg)
|
||||
assert result == status.E512
|
||||
|
|
Loading…
Reference in a new issue