+
+
diff --git a/app/templates/emails/transactional/subscription-end.html b/app/templates/emails/transactional/subscription-end.html
index deccfb5..324db2a 100644
--- a/app/templates/emails/transactional/subscription-end.html
+++ b/app/templates/emails/transactional/subscription-end.html
@@ -6,6 +6,7 @@
{{ render_text("Your subscription will end on " + next_bill_date + ".") }}
{{ render_text("When the subscription ends:") }}
{{ render_text("- All aliases/domains/directories you have created are kept and continue working normally.") }}
+ {{ render_text("- You cannot create new reverse aliases.") }}
{% call text() %}
- You cannot create new aliases if you exceed the free plan limit, i.e. have more than {{ MAX_NB_EMAIL_FREE_PLAN }} aliases.
{% endcall %}
diff --git a/app/templates/emails/transactional/subscription-end.txt b/app/templates/emails/transactional/subscription-end.txt
index 0d72abf..84e9281 100644
--- a/app/templates/emails/transactional/subscription-end.txt
+++ b/app/templates/emails/transactional/subscription-end.txt
@@ -9,6 +9,7 @@ When the subscription ends:
- All aliases/domains/directories you have created are kept and continue working.
- You cannot create new aliases if you exceed the free plan limit, i.e. have more than {{MAX_NB_EMAIL_FREE_PLAN}} aliases.
+- You cannot create new reverse aliases.
- As features like "catch-all" or "directory" allow you to create aliases on-the-fly,
those aliases cannot be automatically created if you have more than {{MAX_NB_EMAIL_FREE_PLAN}} aliases.
- You cannot add new domain or directory.
diff --git a/app/templates/emails/transactional/trial-end.html b/app/templates/emails/transactional/trial-end.html
index 3cf0170..6dc45f2 100644
--- a/app/templates/emails/transactional/trial-end.html
+++ b/app/templates/emails/transactional/trial-end.html
@@ -14,6 +14,7 @@
{{ render_text("- You cannot add new domain or directory.") }}
{{ render_text("- You cannot add new mailbox.") }}
+{{ render_text("- You cannot create new reverse aliases.") }}
{{ render_text("- If you enable PGP Encryption, forwarded emails are not encrypted anymore.") }}
{{ render_text('You can upgrade today to continue using all these Premium features (and much more coming).') }}
{{ render_button("Upgrade your account", URL ~ "/dashboard/pricing") }}
diff --git a/app/templates/emails/transactional/trial-end.txt.jinja2 b/app/templates/emails/transactional/trial-end.txt.jinja2
index 789a33c..d2a827b 100644
--- a/app/templates/emails/transactional/trial-end.txt.jinja2
+++ b/app/templates/emails/transactional/trial-end.txt.jinja2
@@ -8,6 +8,7 @@ When the trial ends:
- All aliases/domains/directories you have created are kept and continue working.
- You cannot create new aliases if you exceed the free plan limit, i.e. have more than {{MAX_NB_EMAIL_FREE_PLAN}} aliases.
- You cannot add new domain or directory.
+- You cannot create new reverse aliases.
- You cannot add new mailbox.
- If you enable PGP Encryption, forwarded emails are not encrypted anymore.
diff --git a/app/tests/models/test_alias.py b/app/tests/models/test_alias.py
index 3354b8b..c11b596 100644
--- a/app/tests/models/test_alias.py
+++ b/app/tests/models/test_alias.py
@@ -1,5 +1,5 @@
from app.db import Session
-from app.models import Alias, Mailbox, AliasMailbox
+from app.models import Alias, Mailbox, AliasMailbox, User
from tests.utils import create_new_user, random_email
@@ -15,3 +15,17 @@ def test_duplicated_mailbox_is_returned_only_once():
alias_mailbox_id = [mailbox.id for mailbox in alias_mailboxes]
assert user.default_mailbox_id in alias_mailbox_id
assert other_mailbox.id in alias_mailbox_id
+
+
+def test_alias_create_from_partner_flags_also_the_user():
+ user = create_new_user()
+ Session.flush()
+ email = random_email()
+ alias = Alias.create(
+ user_id=user.id,
+ email=email,
+ mailbox_id=user.default_mailbox_id,
+ flags=Alias.FLAG_PARTNER_CREATED,
+ flush=True,
+ )
+ assert alias.user.flags & User.FLAG_CREATED_ALIAS_FROM_PARTNER > 0
diff --git a/app/tests/test_email_utils.py b/app/tests/test_email_utils.py
index 726ab97..7e133f1 100644
--- a/app/tests/test_email_utils.py
+++ b/app/tests/test_email_utils.py
@@ -9,6 +9,7 @@ import pytest
from app import config
from app.config import MAX_ALERT_24H, ROOT_DIR
from app.db import Session
+from app.email import headers
from app.email_utils import (
get_email_domain_part,
can_create_directory_for_address,
@@ -354,6 +355,33 @@ def test_is_valid_email():
assert not is_valid_email("emoji👌@gmail.com")
+def test_add_subject_prefix():
+ msg = email.message_from_string(
+ """Subject: Potato
+Content-Transfer-Encoding: 7bit
+
+hello
+"""
+ )
+ new_msg = add_header(msg, "text header", "html header", subject_prefix="[TEST]")
+ assert "text header" in new_msg.as_string()
+ assert "html header" not in new_msg.as_string()
+ assert new_msg[headers.SUBJECT] == "[TEST] Potato"
+
+
+def test_add_subject_prefix_with_no_header():
+ msg = email.message_from_string(
+ """Content-Transfer-Encoding: 7bit
+
+hello
+"""
+ )
+ new_msg = add_header(msg, "text header", "html header", subject_prefix="[TEST]")
+ assert "text header" in new_msg.as_string()
+ assert "html header" not in new_msg.as_string()
+ assert new_msg[headers.SUBJECT] == "[TEST]"
+
+
def test_add_header_plain_text():
msg = email.message_from_string(
"""Content-Type: text/plain; charset=us-ascii