Skip to content

Email: Outbound (Messages API → Brevo)

Outbound email takes two paths:

Path 1: Messages Backend → Brevo (Direct)

The Messages Django backend sends emails directly to Brevo, bypassing MTA-out:

Messages Backend → smtp-relay.brevo.com:587
MTA_OUT_MODE=relay
MTA_OUT_RELAY_HOST=smtp-relay.brevo.com:587
MTA_OUT_RELAY_USERNAME=<brevo-username>
MTA_OUT_RELAY_PASSWORD=<brevo-password>
MTA_OUT_SMTP_TLS_SECURITY_LEVEL=may

This avoids TLS issues with MTA-out's self-signed snakeoil certificate.

Path 2: Calendars → Messages API → Brevo

When a calendar is linked to a Messages mailbox, invitations use this path:

Calendars Backend → POST https://api.messages.<domain>/api/v1.0/submit/
                      (X-API-Key + X-Channel-Id authentication)
                  Messages Backend → Brevo SMTP

This preserves the mailbox sender identity. The email appears to come from the user's mailbox address.

Why Not Through MTA-out?

MTA-out uses self-signed TLS certificates. The Python smtplib client (used by both backends) fails the TLS handshake:

SSL_accept error: tlsv1 alert unknown ca
lost connection after STARTTLS

Both backends connect directly to Brevo (port 587, proper TLS) instead.

Port Requirements

  • Outbound port 25: NOT required (Brevo uses 587)
  • Outbound port 587: Must be open (usually is by default)