makeplane / makeplane/plane

SMTP Email Configuration Fails with Brevo/Sendinblue Due to SSL Hostname Mismatch

Open
#8,971 2 comments 0 reactions 1 assignee View on GitHub

@sangeethailango is already working on this.

Since Apr 29, 2026.

Dominant language
TypeScript
Stars
59.6k
Forks
5.8k
Avg merge
1d 22h
Merged PRs (30d)
49

Description

Bug Description

When configuring SMTP email settings in self-hosted Plane instances using Brevo (formerly Sendinblue) as the SMTP provider, the email credentials test always fails with a 400 error. The root cause is an SSL hostname mismatch between the DNS name (smtp-relay.brevo.com) and the server certificate (smtp-relay-offshore-southamerica-east-v2.sendinblue.com).

Steps to Reproduce

  1. Deploy a self-hosted Plane instance
  2. Navigate to God Mode → Email → SMTP Settings
  3. Configure with Brevo SMTP:
    • Host: smtp-relay.brevo.com
    • Port: 587
    • Username: {Brevo_smtp_key_id}@smtp-brevo.com
    • Password: {Brevo_SMTP_key}
    • Email security: TLS
  4. Click "Send test email"
  5. Observe: Returns 400 error with no detailed message

Technical Analysis

The issue occurs in Django's SMTPEmailBackend.ssl_context property (django/core/mail/backends/smtp.py). When using STARTTLS (port 587) or SSL (port 465), Django creates a default SSL context with hostname verification enabled by default. Brevo's load-balanced SMTP infrastructure presents a certificate for a regional hostname that differs from the DNS-resolvable hostname, causing Python's SSL stack to reject the connection with:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'smtp-relay.brevo.com'.

This is not a misconfiguration — Brevo explicitly supports connecting via smtp-relay.brevo.com as documented, but the certificate is issued for the underlying regional server.

Suggested Fix

Modify the ssl_context property in django/core/mail/backends/smtp.py to provide an option to disable hostname verification for SMTP servers that use certificates from a shared infrastructure. Alternatively, add a configuration flag like EMAIL_SSL_HOSTNAME_VERIFY that defaults to True but can be set to False for providers like Brevo.

Environment

  • Plane version: stable (v1.3.0+)
  • Deployment method: Docker Compose
  • SMTP Provider: Brevo (Sendinblue)
  • Python version: 3.12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.