Skip to content

🚀 Feature: Support Microsoft Graph (OAuth2) as an outbound email provider #9771

Description

@Suvrakar

Problem

Plane's SMTP email integration (God Mode → Email settings) only supports basic SMTP authentication (host/port/username/password). Microsoft 365 tenants increasingly disable legacy/basic SMTP AUTH by default (Security Defaults / Conditional Access), which means self-hosted Plane instances using an Outlook/Microsoft 365 mailbox for outbound mail cannot authenticate at all — they hit 535 5.7.139 Authentication unsuccessful regardless of a correct password, and there is no way to send email through such a tenant today.

Proposal

Add Microsoft Graph API (/users/{mailbox}/sendMail) as an alternative email provider, authenticated via OAuth2 client-credentials (Azure AD app registration with Mail.Send application permission). This lets Plane send mail through Microsoft 365 mailboxes even when basic SMTP auth is disabled tenant-wide, without requiring any change to Plane's existing SMTP setup for everyone else.

Proposed approach:

  • New InstanceConfiguration keys: EMAIL_PROVIDER (SMTP default, or MICROSOFT_GRAPH), EMAIL_GRAPH_TENANT_ID, EMAIL_GRAPH_CLIENT_ID, EMAIL_GRAPH_CLIENT_SECRET (encrypted) — same pattern as the existing SMTP keys, editable via the instance configuration API.
  • A single EMAIL_BACKEND (PlaneEmailBackend) that transparently delegates to Django's existing SMTP backend unless EMAIL_PROVIDER is MICROSOFT_GRAPH, in which case it sends via Microsoft Graph's sendMail endpoint using a client-credentials token. This means every existing call site (magic link, invites, notifications, etc.) keeps working unchanged — nothing behaves differently unless an instance opts in.
  • No new required dependency (requests is already a dependency).

I have a working implementation (backend module, Graph API client, and unit tests) and would like to submit it as a PR referencing this issue, per the contributing guide. Not proposing any admin UI changes in this first pass — configuration would be via the existing instance-configuration API/DB rows, same as SMTP is today. Happy to adjust scope based on maintainer feedback.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions