4.63.0
All checks were successful
Build-Release-Image / Build-Image (linux/amd64) (push) Successful in 3m54s
Build-Release-Image / Build-Image (linux/arm64) (push) Successful in 23m12s
Build-Release-Image / Merge-Images (push) Successful in 46s
Build-Release-Image / Create-Release (push) Successful in 9s
Build-Release-Image / Notify (push) Successful in 3s

This commit is contained in:
2025-01-20 12:00:06 +00:00
parent 33f0eb6c41
commit 664cd32f81
17 changed files with 1083 additions and 184 deletions

View File

@ -549,7 +549,7 @@ def test_create_contact_route_free_users(flask_client):
assert r.status_code == 201
# End trial and disallow for new free users. Config should allow it
user.flags = User.FLAG_DISABLE_CREATE_CONTACTS
user.flags = User.FLAG_FREE_DISABLE_CREATE_CONTACTS
Session.commit()
r = flask_client.post(
url_for("api.create_contact_route", alias_id=alias.id),

View File

@ -135,7 +135,7 @@ def test_create_contact_free_user():
assert result.contact is not None
assert not result.contact.automatic_created
# Free users with the flag should be able to still create automatic emails
user.flags = User.FLAG_DISABLE_CREATE_CONTACTS
user.flags = User.FLAG_FREE_DISABLE_CREATE_CONTACTS
Session.flush()
result = create_contact(random_email(), alias, automatic_created=True)
assert result.error is None

View File

@ -2,6 +2,7 @@ import random
from email.message import EmailMessage
from typing import List
import arrow
import pytest
from aiosmtpd.smtp import Envelope
@ -387,3 +388,15 @@ def test_preserve_headers(flask_client):
msg = sent_mails[0].msg
for header in headers_to_keep:
assert msg[header] == header + "keep"
def test_not_send_to_pending_to_delete_users(flask_client):
user = create_new_user()
alias = Alias.create_new_random(user)
user.delete_on = arrow.utcnow()
envelope = Envelope()
envelope.mail_from = "somewhere@lo.cal"
envelope.rcpt_tos = [alias.email]
msg = EmailMessage()
result = email_handler.handle(envelope, msg)
assert result == status.E504