diff --git a/app/config.py b/app/config.py index 9d08083e..d095380b 100644 --- a/app/config.py +++ b/app/config.py @@ -75,6 +75,16 @@ BOUNCE_PREFIX = os.environ.get("BOUNCE_PREFIX") or "bounce+" BOUNCE_SUFFIX = os.environ.get("BOUNCE_SUFFIX") or f"+@{EMAIL_DOMAIN}" BOUNCE_EMAIL = BOUNCE_PREFIX + "{}" + BOUNCE_SUFFIX +# Used for VERP during reply phase. It's similar to BOUNCE_PREFIX. +# It's needed when sending emails from custom domain to respect DMARC. +# BOUNCE_PREFIX_FOR_REPLY_PHASE should never be used in any existing alias +# and can't be used for creating a new alias on custom domain +# Note BOUNCE_PREFIX_FOR_REPLY_PHASE doesn't have the trailing plus sign (+) as BOUNCE_PREFIX +BOUNCE_PREFIX_FOR_REPLY_PHASE = ( + os.environ.get("BOUNCE_PREFIX_FOR_REPLY_PHASE") or "bounce_reply" +) + + # VERP for transactional email: mail_from set to BOUNCE_PREFIX + email_log.id + BOUNCE_SUFFIX TRANSACTIONAL_BOUNCE_PREFIX = ( os.environ.get("TRANSACTIONAL_BOUNCE_PREFIX") or "transactional+" diff --git a/example.env b/example.env index a2d1963d..72c1adf7 100644 --- a/example.env +++ b/example.env @@ -44,6 +44,8 @@ SUPPORT_NAME=Son from SimpleLogin # prefix must end with + and suffix must start with + # BOUNCE_PREFIX = "bounces+" # BOUNCE_SUFFIX = "+@sl.local" +# same as BOUNCE_PREFIX but used for reply phase. Note it doesn't have the plus sign (+) at the end. +# BOUNCE_PREFIX_FOR_REPLY_PHASE = "bounce_reply" # to receive general stats. # ADMIN_EMAIL=admin@sl.local