Relayway: SMTP Relay for Microsoft Graph
A local SMTP relay that bridges legacy applications to Microsoft Graph after Microsoft removed basic authentication from Exchange Online.
When Microsoft disabled basic authentication for Exchange Online, legacy applications lost the ability to send through Office 365. Relayway is a local SMTP server that accepts plain-auth connections on port 2525, then forwards mail via the Microsoft Graph API using OAuth 2.0 client credentials, so the upstream application requires no changes and no awareness of the modern auth flow.
Setup
Azure App Registration
1. Create a new App Registration (default settings)
2. Add API permissions: Mail.Send, User.Read.All, Mail.ReadWrite (Application type)
3. Grant admin consent for your tenant
4. Create a client secret (24 months recommended)
5. Note the Client ID, Tenant ID, and Client Secret
Configuration
{
"Graph": {
"ClientId": "your-app-client-id",
"TenantId": "your-tenant-id",
"ClientSecret": "your-client-secret"
},
"SendFrom": "[email protected]",
"Smtp": { "Host": "localhost", "Port": 2525 }
}
Deploy
# Docker
docker run -d --name relayway \
-p 127.0.0.1:2525:2525 \
-e RELAYWAY_TENANT_ID="your-tenant" \
-e RELAYWAY_CLIENT_ID="your-client" \
-e RELAYWAY_CLIENT_SECRET="your-secret" \
-e RELAYWAY_SEND_FROM="[email protected]" \
ghcr.io/melosso/relayway
Source code and documentation
Full source, Windows Service install guide, and examples on GitHub.