Mail relay: docs, agent guide, skills, changelog draft; test against the real service code; starter offers the mail service

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 20:53:38 +01:00
co-authored by Claude Fable 5.2
parent 533f571d4d
commit dd3792cbc7
25 changed files with 991 additions and 167 deletions
+8 -1
View File
@@ -27,6 +27,7 @@ type GraphIntegrations = {
smtpFromName?: null | string
}
/** @deprecated Microsoft Graph as an e-mail transport is deprecated since 1.17.0 and removed in 2.0 (docs/email.md, "Moving off Microsoft Graph"). */
export type GraphAdapterArgs = {
/** Waits before the sent copy of a large-attachment message is deleted from the mailbox (ms). Default 2 s, 5 s, 15 s, 60 s. */
cleanupDelaysMs?: number[]
@@ -91,7 +92,10 @@ function readGraphEnv(): GraphEnv | null {
*/
const tokenCache = new Map<string, { expiresAt: number; token: string }>()
/** Forgets cached Graph tokens (after rotating the client secret in a running process; tests). */
/**
* Forgets cached Graph tokens (after rotating the client secret in a running process; tests).
* @deprecated With the Graph transport: removed in 2.0.
*/
export const clearGraphTokenCache = (): void => tokenCache.clear()
async function getAccessToken(env: GraphEnv, fetchImpl: typeof fetch = fetch): Promise<string> {
@@ -150,6 +154,9 @@ function toRecipients(value: SendEmailOptions['to']): { emailAddress: { address:
* Azure setup (one-time, our side): App registration → Mail.Send APPLICATION
* permission → admin consent → in Exchange, grant the app "Send As" on the
* shared mailbox GRAPH_SENDER.
*
* @deprecated Since 1.17.0; removed in 2.0. A site without SMTP sends through the Intecion
* Notifications Webservice instead (docs/email.md, "Moving off Microsoft Graph").
*/
export const graphAdapter =
(args: GraphAdapterArgs = {}): PayloadEmailAdapter =>