Skip to content

feat: support generic SMTP for outgoing email (production currently requires Proton Bridge) #191

Description

@dholbach

Problem

Production email only works through Proton Bridge. app/config/settings.py:197-213 offers exactly two paths:

  • USE_PROTON_BRIDGE=truemy_practice.email_backend.ProtonBridgeEmailBackend, a custom backend whose whole purpose is to accept Proton Bridge's self-signed localhost certificate
  • otherwise → console backend (dev only)

A self-hoster with a normal SMTP provider (their own mail server, Mailbox.org, a practice domain at some hoster) has no supported way to send invoices by email. Worse, pointing the Proton backend at an external SMTP host would silently disable TLS certificate verification — it should never be used for anything but localhost bridges.

Proposal

  • Add a generic SMTP configuration path using Django's stock django.core.mail.backends.smtp.EmailBackend, driven by env vars (EMAIL_HOST, EMAIL_PORT, EMAIL_USE_TLS/EMAIL_USE_SSL, credentials, DEFAULT_FROM_EMAIL)
  • Keep USE_PROTON_BRIDGE=true as an opt-in special case; consider guarding the cert-ignoring backend so it refuses non-localhost hosts
  • Document both paths in .env.example and the self-hosting docs

Found during a review of setup-specific assumptions (2026-07-06).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions