Skip to content

todo: Better support of SMTP_ONLY=1 (send-only / null-mailer) #3477

@polarathene

Description

@polarathene

Description

Recently there has been more engagement from the community interested in configuring DMS for the purpose of only sending (or relaying/forwarding) mail, never storing it. This is partially supported from features contributed by a user many years ago, but poorly documented / tested.

I have detailed some insights from a recent discussion on the topic. It should be helpful for anyone looking to tackle this.

  • SMTP_ONLY=1 should probably opt-out of features / services intended for receiving mail to store (via Dovecot). Our docs have a user example guide (LDAP forwarding server) which mentions a few ENV related to this, however in some scenarios it may be desirable to have DMS filter out mail being relayed / submitted, thus could just suggest relevant ENV in docs example admonition.
  • ENABLE_SASLAUTHD=1 may be required to ensure users can authenticate to send mail. Could be bypassed with mynetworks? (eg: via PERMIT_DOCKER) This feature lacks docs too, IIRC it was contributed by a user wanting to pair SMTP_ONLY=1 with LDAP instead of Dovecot for user management.

For send-only setup, the DNS MX record is configured for a different mail service, and without SMTP_ONLY=1 users have found it problematic to send mail from DMS (as sender [email protected]) to another account of the same domain ([email protected]) as it requires an account to send (setup email add ...), but that is managed via SASL by default with Dovecot, which Postfix also will be configure Dovecot for as the virtual_transport, recognizing mail for that account domain part as belonging to DMS as a result, then performing a check for the recipient account (which may not exist in Dovecot, but does in the third-party mail service).. thus failing and bouncing the mail submitted to Postfix (over 587/465).

This is a task anyone is welcome to contribute a PR for, fully or partially. Documentation contributing to the "Examples" section as a guide would be helpful and easiest, although code + tests would be great too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions