PHPackages                             codeq/oauthsymfonymailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. codeq/oauthsymfonymailer

ActiveNeos-package[Authentication &amp; Authorization](/categories/authentication)

codeq/oauthsymfonymailer
========================

0.1.0(8mo ago)0673↓33.3%GPL-3.0-or-laterPHP

Since Sep 4Pushed 8mo agoCompare

[ Source](https://github.com/code-q-web-factory/oauthsymfonymailer)[ Packagist](https://packagist.org/packages/codeq/oauthsymfonymailer)[ RSS](/packages/codeq-oauthsymfonymailer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

CodeQ.OAuthSymfonyMailer
========================

[](#codeqoauthsymfonymailer)

Integrates Symfony Mailer in Neos CMS with Office 365 OAuth2 (client credentials) using XOAUTH2.

This package provides:

- Office365OAuthTokenProvider to fetch and cache access tokens
- XOAuth2Authenticator for SMTP AUTH XOAUTH2
- OAuthEsmtpTransportFactory to enable an `oauth://` DSN such as `oauth://user@example.com:@office365`

Requirements
------------

[](#requirements)

- Neos/Flow 7.3 or 8.x
- PHP 8.1+

Installation
------------

[](#installation)

Run `composer require codeq/oauthsymfonymailer` to install the package in your project.

Configuration
-------------

[](#configuration)

1. Set the DSN to use the custom OAuth transport

Configure the DSN in your project Settings to use the `oauth://` scheme. Replace `user@example.com` with the mailbox you want to send as. Leave the trailing `:` before the `@` to indicate an empty password.

```
CodeQ:
  OAuthSymfonyMailer:
    mailer:
      dsn: 'oauth://user:@example.com@office365'
```

Notes:

- The special host `office365` is mapped to `smtp.office365.com` internally and connects via STARTTLS (port 587).
- The mailer will authenticate with XOAUTH2 using the access token from Microsoft Entra ID (Azure AD).

2. Configure CodeQ.OAuthSymfonyMailer settings

Provide your Microsoft Entra ID tenant, application (client) ID and client secret. You can configure it here:

```
CodeQ:
  OAuthSymfonyMailer:
    office365OAuthTokenProvider:
      # Microsoft 365 tenant ID (GUID or domain)
      tenant: 'YOUR_TENANT_ID'
      # Application (client) ID
      clientId: 'YOUR_CLIENT_ID'
      # Client secret
      clientSecret: 'YOUR_CLIENT_SECRET'
```

3. Configure the token cache

The token is cached for performance reasons. The cache identifier must match the `CACHE_KEY` constant used by the token provider (`CodeQ_OAuthSymfonyMailer_TokenCache`). Feel free to switch to a different backend in your project configuration.

```
CodeQ_OAuthSymfonyMailer_TokenCache:
  frontend: Neos\Cache\Frontend\VariableFrontend
  backend: ...
```

How it works
------------

[](#how-it-works)

- The OAuthEsmtpTransportFactory handles `oauth://` DSNs and internally creates a standard SMTP transport to Office 365.
- The XOAuth2Authenticator performs SMTP `AUTH XOAUTH2` using the access token.
- The Office365OAuthTokenProvider fetches tokens from `https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token` with the scope `https://outlook.office365.com/.default` using the client credentials flow and caches the token until near expiry.

Troubleshooting
---------------

[](#troubleshooting)

- Ensure the app registration has the appropriate application permissions (e.g. `SMTP.Send` or Graph `Mail.Send` depending on your scenario) and admin consent was granted.
- Verify the mailbox (`user@example.com`) is licensed and allowed to use SMTP AUTH. Some tenants disable SMTP AUTH by default; enable per mailbox if needed.
- Run `./flow flow:cache:flush --force` and `./flow flow:package:rescan` after configuration changes if Flow doesn’t pick them up immediately.

Credits
-------

[](#credits)

This package is heavily inspired by the existing [Neos.SymfonyMailer](https://github.com/neos/symfonymailer) and this [Gist](https://gist.github.com/dbu/3094d7569aebfc94788b164bd7e59acc).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance60

Regular maintenance activity

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

256d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c898f86932821ebd9add02d4f01864bd4804e1a620083fbc5951af0bb3e9c850?d=identicon)[codeq](/maintainers/codeq)

---

Top Contributors

[![gradinarufelix](https://avatars.githubusercontent.com/u/4405087?v=4)](https://github.com/gradinarufelix "gradinarufelix (2 commits)")

### Embed Badge

![Health badge](/badges/codeq-oauthsymfonymailer/health.svg)

```
[![Health](https://phpackages.com/badges/codeq-oauthsymfonymailer/health.svg)](https://phpackages.com/packages/codeq-oauthsymfonymailer)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[simplesamlphp/saml2

SAML2 PHP library from SimpleSAMLphp

30317.2M40](/packages/simplesamlphp-saml2)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[league/oauth2-server-bundle

Symfony bundle .

2344.7M6](/packages/league-oauth2-server-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
