diff --git a/helm/charts/smtp-server/README.md b/helm/charts/smtp-server/README.md index 588711a..8b31a11 100644 --- a/helm/charts/smtp-server/README.md +++ b/helm/charts/smtp-server/README.md @@ -28,6 +28,10 @@ This is the third of four Pingmailer mail-plane charts. Install order: start && sleep infinity`). - A `Service` on port 25 (SMTP). Port 587 (submission, STARTTLS-enforced) is added when `postfix.submission.enabled=true` (the default). +- When submission is enabled, `main.cf` sets `smtpd_sender_login_maps` (inline + `regexp`) and `smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch`, + so an authenticated client can only use its own address in `MAIL FROM`. + Unauthenticated port-25 traffic and null senders (bounces) are unchanged. - A `PersistentVolumeClaim` for `/var/spool/postfix` — the mail queue must survive pod restarts so in-flight messages aren't dropped. - An optional TLS `Secret` mount: when `tlsSecret.name` is set, the chart diff --git a/helm/charts/smtp-server/templates/configmap.yaml b/helm/charts/smtp-server/templates/configmap.yaml index 96e107b..9c5700c 100644 --- a/helm/charts/smtp-server/templates/configmap.yaml +++ b/helm/charts/smtp-server/templates/configmap.yaml @@ -71,6 +71,13 @@ data: check_recipient_access hash:/etc/postfix/recipient_access {{- end }} reject + {{- if .Values.postfix.submission.enabled }} + + # Bind MAIL FROM to the raven-approved SASL login; $$ escapes Postfix macros. + smtpd_sender_login_maps = regexp:{ {/^(.+)$$/ $${1}} } + smtpd_sender_restrictions = + reject_authenticated_sender_login_mismatch + {{- end }} # --- Rate limits --- smtpd_client_connection_rate_limit = {{ .Values.postfix.rateLimits.connectionPerClient }}