feat: enforce Mail-owned campaign transport boundary
This commit is contained in:
@@ -124,11 +124,11 @@ def _mail_policy_user_text(policy: dict[str, Any]) -> tuple[str, str]:
|
||||
summary = "You can choose from approved mail servers, but you cannot add your own mail server for this tenant."
|
||||
body = "This is set by tenant policy. If the mail server you need is not offered, ask an administrator to add it as an approved mail profile."
|
||||
elif approved_profile_limit:
|
||||
summary = "You can use approved mail servers. Some local mail-server settings may also be allowed, depending on where you work."
|
||||
body = "The available choices are limited by tenant policy. If you are working in a user, group, or campaign area that allows local settings, GovOPlaN still checks the server, sender, recipient, and credential rules."
|
||||
summary = "You can use approved Mail profiles. Some scopes may also define additional reusable profiles."
|
||||
body = "The available profiles are limited by tenant policy. Campaigns select one profile by reference; SMTP/IMAP settings and credentials remain managed in Mail."
|
||||
elif lower_scopes:
|
||||
summary = "You may be able to add a mail server in selected areas, as long as it follows the active tenant rules."
|
||||
body = "GovOPlaN checks mail server settings before they are used. If a setting is blocked, it usually means the tenant has limited hosts, senders, recipients, or credentials."
|
||||
summary = "You may be able to define reusable Mail profiles in selected scopes, subject to tenant rules."
|
||||
body = "GovOPlaN checks each profile before use. Campaigns reference an available profile and never store its SMTP/IMAP settings or credentials."
|
||||
else:
|
||||
summary = "Mail servers are managed centrally for this tenant."
|
||||
body = "You cannot add a personal, group, or campaign mail server here. Choose one of the configured options or ask an administrator to add another approved profile."
|
||||
@@ -151,16 +151,16 @@ def _user_mail_policy_translations(policy: dict[str, Any]) -> dict[str, dict[str
|
||||
return {
|
||||
"de": {
|
||||
"title": "Mailserver auswaehlen",
|
||||
"summary": "Sie koennen freigegebene Mailserver nutzen. In manchen Bereichen koennen zusaetzliche lokale Einstellungen erlaubt sein.",
|
||||
"body": "Die Auswahl wird durch Tenant-Regeln begrenzt. Auch wenn lokale Einstellungen erlaubt sind, prueft GovOPlaN Server, Absender, Empfaenger und Zugangsdaten.",
|
||||
"summary": "Sie koennen freigegebene Mailprofile nutzen. In manchen Bereichen koennen weitere wiederverwendbare Profile angelegt werden.",
|
||||
"body": "Die Auswahl wird durch Tenant-Regeln begrenzt. Kampagnen speichern nur die Profilreferenz; SMTP-/IMAP-Einstellungen und Zugangsdaten verbleiben im Mail-Modul.",
|
||||
},
|
||||
}
|
||||
if lower_scopes:
|
||||
return {
|
||||
"de": {
|
||||
"title": "Mailserver auswaehlen",
|
||||
"summary": "In bestimmten Bereichen koennen Sie einen Mailserver eintragen, solange die aktiven Tenant-Regeln eingehalten werden.",
|
||||
"body": "GovOPlaN prueft Mailserver-Einstellungen, bevor sie verwendet werden. Wenn eine Einstellung blockiert wird, begrenzen die Tenant-Regeln meist Server, Absender, Empfaenger oder Zugangsdaten.",
|
||||
"summary": "In bestimmten Bereichen koennen Sie wiederverwendbare Mailprofile anlegen, solange die aktiven Tenant-Regeln eingehalten werden.",
|
||||
"body": "GovOPlaN prueft jedes Profil vor der Verwendung. Kampagnen referenzieren ein freigegebenes Profil und speichern keine SMTP-/IMAP-Einstellungen oder Zugangsdaten.",
|
||||
},
|
||||
}
|
||||
return {
|
||||
@@ -190,7 +190,11 @@ def _lower_scope_line(lower_scopes: tuple[str, ...]) -> str:
|
||||
def _credential_line(policy: dict[str, Any]) -> str:
|
||||
smtp_inherit = bool((policy.get("smtp_credentials") or {}).get("inherit", True))
|
||||
imap_inherit = bool((policy.get("imap_credentials") or {}).get("inherit", True))
|
||||
return f"Credential inheritance: SMTP {'inherits' if smtp_inherit else 'requires local credentials'}; IMAP {'inherits' if imap_inherit else 'requires local credentials'}."
|
||||
return (
|
||||
f"Credential inheritance: SMTP {'inherits' if smtp_inherit else 'requires local credentials'}; "
|
||||
f"IMAP {'inherits' if imap_inherit else 'requires local credentials'}. "
|
||||
"Campaign delivery is available only for protocols that inherit credentials from the selected Mail profile."
|
||||
)
|
||||
|
||||
|
||||
def _allowed_lower_scopes(policy: dict[str, Any]) -> tuple[str, ...]:
|
||||
|
||||
Reference in New Issue
Block a user