Skip to content

Lambda Functions

ServerlessInbox runs on a set of purpose-built Lambda functions. They are grouped below by functional area.

Values that CloudFormation resolves at deployment time are shown in ${…} placeholders rather than as literal strings, because they differ per deployment:

NotationMeaning
${AWS::AccountId}, ${AWS::Region}, ${AWS::Partition}, ${AWS::StackName}, ${AWS::StackId}The CloudFormation pseudo-parameters of your deployment
${SomeLogicalId.SomeAttribute}An attribute of another resource in the same stack, resolved at deploy time
${Select(…)}, ${Split(…)}A value CloudFormation computes from the values it encloses

Everything else is literal — in particular, a * is a real wildcard in the granted ARN and is shown exactly where the policy has one. Where a statement carries IAM conditions, they are listed beside it; a grant that looks broad in its Actions or Resources column is often narrowed to this stack’s resources by a tag condition, and the condition is the part that does the narrowing.

Environment variables marked resolved at deploy time take their value from a stack parameter or another resource, and the template does not carry a literal for them.


These Lambdas handle synchronous HTTP and authentication requests.

The core user-facing API. Implements the JMAP protocol for email read, write, thread, search, and submission. Sits behind HTTP API Gateway and is used by the Webmail UI and any JMAP-capable email client. Full-text search runs in-process here via a CGO bridge to Tantivy, reading each account’s search index directly from the Email bucket — see Search Architecture.

Trigger: HTTP API Gateway

Environment variables (16)
VariableValue
API_BASE_URLresolved at deploy time
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CDN_HOSTresolved at deploy time
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
EMAIL_SUBMISSION_QUEUE_URLresolved at deploy time
IDENTITY_PROVISIONER_FUNCTION_NAMEresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
OAUTH_HANDLER_CONFIG{"scopeMap":{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}}
OAUTH_PROTECTED_RESOURCE_URLresolved at deploy time
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
SERVICE_NAMEjmap-api
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
WEBSOCKET_URLresolved at deploy time
AWS resource access (18 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:UpdateItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = TENANT#*#ACCOUNT#*
ForAllValues:StringEquals dynamodb:Attributes = pk, sk, activeSieveScriptId
ForAllValues:StringEquals dynamodb:ReturnValues = NONE
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = hmac
dynamodb:GetItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = TENANT#*PAT_OWNER#*
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
s3:DeleteObject
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
s3:ListBucket${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}StringLike s3:prefix = tenants/*/accounts/*/emails/*
s3:DeleteObject
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/uploads/*—
s3:DeleteObject
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/contacts/*—
s3:DeleteObject
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/sieve/*—
s3:DeleteObject
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/principals/*—
s3:GetObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/search-indexes/*—
sqs:SendMessage${mailboxemailemailsendingemailsubmissionsqueueC553C8C2.Arn}—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
lambda:InvokeFunction${mailboxauthidentityprovisionerD2F3DDF7.Arn}
${mailboxauthidentityprovisionerD2F3DDF7.Arn}:*
—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/grant-resource
arn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/revoke-resource
—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

The administrative backend. Handles tenant management, user provisioning, domain and identity configuration, audit log queries, suppression list management, and addon operations. Used exclusively by the Admin UI and programmatic admin tooling.

Trigger: HTTP API Gateway

Environment variables (19)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUDIT_LOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn))))}
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
EMAIL_SUBMISSION_QUEUE_URLresolved at deploy time
IDENTITY_PROVISIONER_FUNCTION_NAMEresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
MAIL_FEEDBACK_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn))))}
MAIL_LOG_TABLE_NAMEresolved at deploy time
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
ROOT_STACK_ID${Select(2, Split("/", AWS::StackId))}
SERVICE_NAMEadmin-api
SES_CONFIG_SET_NAMEresolved at deploy time
SES_RULE_SET_NAMEresolved at deploy time
STACK_IDENTITY_TAG_KEYserverless-inbox:root-stack
STACK_IDENTITY_TAG_VALUEresolved at deploy time
SYSTEM_SENDER_ADDRESSresolved at deploy time
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (28 statements)
ActionsResourcesConditions
lambda:GetAccountSettings
sts:GetCallerIdentity
*—
ses:CreateEmailIdentity
ses:DeleteEmailIdentity
ses:GetEmailIdentity
ses:PutEmailIdentityDkimSigningAttributes
arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/*—
ses:TagResourcearn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/*StringEquals aws:RequestTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:root-stack, serverless-inbox:root-stack-id
ses:TagResourcearn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/*StringEquals aws:RequestTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:RequestTag/serverless-inbox:root-stack-id = true
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:root-stack, serverless-inbox:root-stack-id
ses:SendEmailarn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/*
arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:configuration-set/${mailboxemailseseventprocessingsesconfigurationsetC81015C1}
—
ses:GetAccount
ses:GetSendStatistics
ses:ListEmailIdentities
*—
route53:ChangeResourceRecordSetsarn:${AWS::Partition}:route53:::hostedzone/*ForAllValues:StringLike route53:ChangeResourceRecordSetsNormalizedRecordNames = *._domainkey.*, _dmarc.*
ForAllValues:StringEquals route53:ChangeResourceRecordSetsRecordTypes = CNAME, TXT
ForAllValues:StringEquals route53:ChangeResourceRecordSetsActions = UPSERT, DELETE
Null route53:ChangeResourceRecordSetsNormalizedRecordNames = ${false}
Null route53:ChangeResourceRecordSetsRecordTypes = ${false}
Null route53:ChangeResourceRecordSetsActions = ${false}
route53:ChangeResourceRecordSetsarn:${AWS::Partition}:route53:::hostedzone/*ForAllValues:StringEquals route53:ChangeResourceRecordSetsRecordTypes = MX, TXT
ForAllValues:StringEquals route53:ChangeResourceRecordSetsActions = UPSERT, DELETE
Null route53:ChangeResourceRecordSetsRecordTypes = ${false}
Null route53:ChangeResourceRecordSetsActions = ${false}
route53:ListResourceRecordSetsarn:${AWS::Partition}:route53:::hostedzone/*—
route53:ListHostedZonesByName*—
servicequotas:ListServiceQuotas
servicequotas:RequestServiceQuotaIncrease
*—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/grant-resource
arn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/revoke-resource
—
ses:DescribeActiveReceiptRuleSet*—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn}/index/*
—
dynamodb:GetItem
dynamodb:Query
${mailboxemailmaillogtable788E1311.Arn}
${mailboxemailmaillogtable788E1311.Arn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
dynamodb:Query${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}/index/gsi1
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
s3:DeleteObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/sieve/*—
s3:ListBucket${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}StringLike s3:prefix = tenants/*/accounts/*/sieve/*
sqs:SendMessage${mailboxemailemailsendingemailsubmissionsqueueC553C8C2.Arn}—
lambda:InvokeFunction${mailboxauthidentityprovisionerD2F3DDF7.Arn}
${mailboxauthidentityprovisionerD2F3DDF7.Arn}:*
—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

A JWT authorizer invoked by API Gateway before routing a request to jmap-api. Validates the bearer token against the cached public keys, then enforces the audience, scope, and group requirements configured for the JMAP API.

Trigger: API Gateway Lambda authorizer (JMAP API)

Environment variables (9)
VariableValue
ALLOW_ANONYMOUS_ROUTESGET /.well-known/jmap
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
AUTH_POLICY_NAMEJMAP_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_SCOPE_MAP{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
PRINCIPAL_LOOKUPoff
SERVICE_NAMEauthorizer-jmap-api
AWS resource access (5 statements)
ActionsResourcesConditions
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = jwks
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:GetItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
dynamodb:UpdateItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
ForAllValues:StringEquals dynamodb:Attributes = pk, sk, lastUsedAt
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

Serves the User API at /user: per-user settings that follow the account, currently the webmail theme and language. Every signed-in user can read and change their own; nothing here is administrative.

Trigger: HTTP API Gateway

Environment variables (13)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
BLOB_STORAGE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
IMPORT_JOBS_QUEUE_URLresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
MAIL_IMPORT_RUNNER_FUNCTION_NAMEresolved at deploy time
OAUTH_HANDLER_CONFIG{"scopeMap":{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}}
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
SERVICE_NAMEuser-api
SYSTEM_SENDER_ADDRESSresolved at deploy time
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (12 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = connection-key-public
sqs:SendMessage${mailboxjobsimportjobsqueue2310C747.Arn}—
lambda:InvokeFunction${mailboxjobsmailimportrunnerB153C54B.Arn}
${mailboxjobsmailimportrunnerB153C54B.Arn}:*
—
dynamodb:ConditionCheckItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}—
dynamodb:Query${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}/index/gsi1
—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

The JWT authorizer in front of the User API. It enforces the same audience, scope and group requirements as the JMAP API.

Trigger: API Gateway Lambda authorizer (User API)

Environment variables (9)
VariableValue
ALLOW_ANONYMOUS_ROUTES“
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
AUTH_POLICY_NAMEJMAP_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_SCOPE_MAP{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
PRINCIPAL_LOOKUPoff
SERVICE_NAMEauthorizer-user-api
AWS resource access (5 statements)
ActionsResourcesConditions
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = jwks
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:GetItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
dynamodb:UpdateItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
ForAllValues:StringEquals dynamodb:Attributes = pk, sk, lastUsedAt
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

The JWT authorizer in front of the Admin API’s own endpoint, configured independently of the JMAP authorizer — its own audience, scope, and authorization group requirements.

Trigger: API Gateway Lambda authorizer (Admin API)

Environment variables (9)
VariableValue
ALLOW_ANONYMOUS_ROUTES“
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
AUTH_POLICY_NAMEADMIN_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_SCOPE_MAP{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
PRINCIPAL_LOOKUPoff
SERVICE_NAMEauthorizer-admin-api
AWS resource access (5 statements)
ActionsResourcesConditions
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = jwks
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:GetItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
dynamodb:UpdateItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = PAT#*
ForAllValues:StringEquals dynamodb:Attributes = pk, sk, lastUsedAt
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

Authorizes the routes that Admin API addons add. Resolves the caller’s principal, passes it on to the addon, and blocks a request that has none.

Trigger: API Gateway Lambda authorizer (Admin API addon routes)

Environment variables (7)
VariableValue
ALLOW_ANONYMOUS_ROUTES“
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
AUTH_POLICY_NAMEADMIN_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_SCOPE_MAP{"si/mail.read":["mail/readItems"],"si/mail.write":["mail/addItems","mail/removeItems","mail/setSeen","mail/setKeywords","mail/createChild","mail/rename","mail/delete","import/read","import/write"],"si/mail.send":["mail/submit"],"si/account.read":[],"si/alias.read":[],"si/alias.write":[],"si/user.read":["preferences/read"],"si/preferences.read":["preferences/read"],"si/preferences.write":["preferences/write"],"si/contacts.read":["contacts/read"],"si/contacts.write":["contacts/write","contacts/delete"],"si/sieve.read":["sieve/read"],"si/sieve.write":["sieve/write"],"si/admin":["admin"],"si/tokens.manage":["tokens/manage"],"si/push.manage":["push/manage"]}
PRINCIPAL_LOOKUPon
SERVICE_NAMEauthorizer-admin-api-lookup
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = jwks
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—

Handles token federation for the Admin UI — exchanging a token issued by an external identity provider for one that satisfies the Admin API’s audience and scope requirements.

Trigger: HTTP API Gateway

Environment variables (5)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_POLICY_NAMEADMIN_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_CLIENT_NAMEADMIN_UI
SERVICE_NAMEidp-token-exchange-admin-ui
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

The same token exchange, deployed a second time for the Webmail UI. It is configured with the Webmail UI’s OAuth client and exchanges tokens for user-level rather than admin-level scope.

Trigger: HTTP API Gateway

Environment variables (5)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
AUTH_POLICY_NAMEJMAP_API
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
OAUTH_CLIENT_NAMEWEBMAIL_UI
SERVICE_NAMEidp-token-exchange-webmail-ui
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

These Lambdas handle the inbound and outbound email flows. See the Email Processing Pipeline and Email Sending Pipeline for full flow details.

Receives inbound email receipt notifications from SES and forwards them to the email processing queue, triggering the email-processor Lambda. Acts as the entry point for all inbound email.

Trigger: SES receipt rule (activated by the bootstrap Lambda)

Environment variables (2)
VariableValue
EMAIL_PROCESSOR_QUEUE_URLresolved at deploy time
SERVICE_NAMEses-receipt-forwarder
AWS resource access (1 statements)
ActionsResourcesConditions
sqs:SendMessage${mailboxemailsesrulesemailprocessingqueue29F58F1E.Arn}—

Processes raw incoming emails from the queue. Resolves the recipient to a tenant mailbox (handling plus-addressing and alias lookup), stores the message, records it in DynamoDB, and triggers real-time push notifications to connected WebSocket clients.

Trigger: SQS (email processing queue, fed by the SES receipt rule)

Environment variables (8)
VariableValue
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
MAIL_LOG_TABLE_NAMEresolved at deploy time
SERVICE_NAMEemail-processor
SYSTEM_SENDER_ADDRESSresolved at deploy time
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (8 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
dynamodb:PutItem${mailboxemailmaillogtable788E1311.Arn}—
s3:DeleteObject
s3:GetObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/incoming-emails/*—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
sqs:DeleteMessage
sqs:GetQueueAttributes
sqs:ReceiveMessage
${mailboxemailsesrulesemailprocessingqueue29F58F1E.Arn}—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

Sends queued outbound email submissions. Fetches the stored MIME message, injects server-side signatures, tags the message, and dispatches it via SES.

Trigger: SQS (email submission queue)

Environment variables (7)
VariableValue
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
SERVICE_NAMEemail-sender
SES_CONFIG_SET_NAMEresolved at deploy time
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (7 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
s3:GetObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
ses:SendRawEmailarn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/*
arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:configuration-set/${mailboxemailseseventprocessingsesconfigurationsetC81015C1}
—
sqs:DeleteMessage
sqs:GetQueueAttributes
sqs:ReceiveMessage
${mailboxemailemailsendingemailsubmissionsqueueC553C8C2.Arn}—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

Receives delivery feedback from SES — bounces, complaints, rejections, and delivery confirmations. Updates item state, records feedback, maintains the suppression list, and emits audit events.

Trigger: SQS (fed by SNS from the SES event destination)

Environment variables (8)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
MAIL_FEEDBACK_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn))))}
SERVICE_NAMEsqs-ses-event-processor
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (8 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.mailFeedbackTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
sqs:DeleteMessage
sqs:GetQueueAttributes
sqs:ReceiveMessage
${mailboxemailseseventprocessingseseventqueueAC4EE0B2.Arn}—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

Runs the mail imports users start from webmail (see Import Mail from Another Provider). It consumes the import jobs queue and copies mail from the old IMAP server into the destination account in batches, pushing a WebSocket state change after each saved batch so progress shows up live. It also serves the synchronous inspect call that checks a remote connection and lists its folders before an import is started.

Trigger: SQS (import jobs queue), plus a synchronous invoke to inspect a remote connection

Environment variables (9)
VariableValue
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
BLOB_STORE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
IMPORT_JOBS_QUEUE_URLresolved at deploy time
IMPORT_MESSAGES_PER_SECOND5
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
SERVICE_NAMEmail-import-runner
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (8 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
sqs:DeleteMessage
sqs:GetQueueAttributes
sqs:ReceiveMessage
${mailboxjobsimportjobsqueue2310C747.Arn}—
sqs:SendMessage${mailboxjobsimportjobsqueue2310C747.Arn}—
dynamodb:GetItem${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = connection-key-private
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

Retires everything that has an expiry. Every 15 minutes it runs four passes: it ends running import jobs that have been stale for two hours and queued jobs that are overdue; it removes expired remote connections that have no active job; it warns the owners of personal access tokens that are about to expire and retires the tokens that have, once a day; and it removes expired push subscriptions. A problem in one pass does not hold up the others.

Trigger: EventBridge scheduled rule (every 15 minutes)

Environment variables (11)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
BLOB_STORAGE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
JOB_STALE_AFTER7200s
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
SERVICE_NAMEexpiry-sweeper
SWEEP_INTERVAL900s
SYSTEM_SENDER_ADDRESSresolved at deploy time
WEBSOCKET_BROADCAST_FUNCTION_NAMEresolved at deploy time
AWS resource access (8 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:Query${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}/index/gsi2—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = TENANT#*PAT_OWNER#*
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
lambda:InvokeFunction${mailboxapisstatechangefanout4C9AB9B3.Arn}
${mailboxapisstatechangefanout4C9AB9B3.Arn}:*
—

Maintains per-account full-text search indexes. On each run, compares the changelog state recorded at the account’s last index build against the current changelog state; accounts with no changes are skipped, and accounts with changes get an incremental update — fetching changed items, updating the Tantivy index, and writing the updated archive back to S3. Runs with elevated memory to handle batch indexing efficiently. See Search Architecture for how this interacts with query-time search.

Trigger: EventBridge (scheduled rule, every 6 hours)

Environment variables (5)
VariableValue
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
INDEX_BUCKET_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
SERVICE_NAMEtantivy-indexer
AWS resource access (4 statements)
ActionsResourcesConditions
s3:GetObject
s3:PutObject
${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/search-indexes/*—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—

These four Lambdas together implement the real-time push channel. See the explanation pages for Email Processing and Email Sending for how push notifications are emitted.

Invoked when a client opens a WebSocket connection, after the authorizer on the $connect route has already validated the client’s token. It records the connection registration so the system can push to it, and does nothing else — which is why it holds no access to the auth key store.

Trigger: WebSocket API Gateway ($connect route)

Environment variables (3)
VariableValue
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
CONNECTIONS_TABLE_NAMEresolved at deploy time
SERVICE_NAMEwebsocket-connect
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:GetItem
dynamodb:PutItem
${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—

Invoked when a WebSocket connection closes, either by the client or due to timeout. Removes the stored connection registration.

Trigger: WebSocket API Gateway ($disconnect route)

Environment variables (2)
VariableValue
CONNECTIONS_TABLE_NAMEresolved at deploy time
SERVICE_NAMEwebsocket-disconnect
AWS resource access (1 statements)
ActionsResourcesConditions
dynamodb:DeleteItem
dynamodb:Query
${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}—

Handles messages sent by connected clients over the WebSocket channel. A client subscribes by sending a message naming an account and the change types it wants; this function checks that the authenticated caller may access that account — as owner, through a direct grant, or via group membership — rejects requests asking for more types than the configured maximum, and records the subscription against the connection. It replies on the same connection with a confirmation, or with a structured error when the message is malformed, unauthorized or the account is unknown.

Trigger: WebSocket API Gateway (default route)

Environment variables (6)
VariableValue
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
CONNECTIONS_TABLE_NAMEresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
MAX_SUBSCRIPTIONS10
SERVICE_NAMEwebsocket-message
WEBSOCKET_API_ENDPOINTresolved at deploy time
AWS resource access (4 statements)
ActionsResourcesConditions
dynamodb:GetItem
dynamodb:PutItem
${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
execute-api:ManageConnectionsarn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${mailboxapiswebsocketpushwebsocketapi1D06C761}/prod/POST/@connections/*—

Delivers state-change notifications for a given account. It pushes to all registered WebSocket connections for the account and, when the tenant has JMAP PushSubscription registrations, sends a StateChange POST to each confirmed subscription created by a user who can read the account — encrypted when the subscription supplied keys. It also sends the one-time verification request for a newly created subscription. Invoked directly (not via API Gateway) by other Lambdas that record data changes — for example, after a new email arrives or a message is marked as read. See Push Notifications & Real-Time Updates for the delivery rules.

Trigger: Direct Lambda invocation (from email-processor, email-sender, sqs-ses-event-processor, jmap-api, admin-api)

Environment variables (6)
VariableValue
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
CONNECTIONS_TABLE_NAMEresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
PAT_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn))))}
SERVICE_NAMEstate-change-fanout
WEBSOCKET_API_ENDPOINTresolved at deploy time
AWS resource access (7 statements)
ActionsResourcesConditions
dynamodb:Query${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}
${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}/index/*
—
dynamodb:DeleteItem
dynamodb:Query
${mailboxapiswebsocketpushwebsocket2954CBE6.Arn}—
execute-api:ManageConnectionsarn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${mailboxapiswebsocketpushwebsocketapi1D06C761}/prod/POST/@connections/*—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:DeleteItem
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = TENANT#*#PUSH_SUB_OWNER#*, TENANT#*#PUSH_TENANT_COUNT
dynamodb:GetItem${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.patTableArn}ForAllValues:StringLike dynamodb:LeadingKeys = TENANT#*PAT_OWNER#*

These Lambdas handle deployment-time setup, background maintenance, and operational tasks.

A CloudFormation custom resource that runs when the stack is created and when it is updated to a different release. Seeds the Config table with the platform configuration: OIDC provider settings, auth policies, OAuth client definitions, and API endpoint metadata. Other stack operations leave it untouched; it is designed to be idempotent. It also activates the SES receipt rule set if configured, registers the domain with SES, and configures hosted zone records if enabled.

Trigger: CloudFormation custom resource (on stack create/update)

Environment variables (9)
VariableValue
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
ROOT_STACK_ID${Select(2, Split("/", AWS::StackId))}
SERVICE_NAMEbootstrap
SES_RECEIVING_MODEon
SES_RULE_SET_NAMEresolved at deploy time
SES_SEND_ENABLEDon
STACK_IDENTITY_TAG_KEYserverless-inbox:root-stack
STACK_IDENTITY_TAG_VALUEresolved at deploy time
AWS resource access (10 statements)
ActionsResourcesConditions
iam:CreateServiceLinkedRole*StringEquals iam:AWSServiceName = servicequotas.amazonaws.com
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:GetItem
dynamodb:PutItem
${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = hmac
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/bootstrap
arn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/grant-resource
arn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/revoke-resource
—
ses:DescribeActiveReceiptRuleSet
ses:SetActiveReceiptRuleSet
*—
route53:ChangeResourceRecordSets
route53:GetHostedZone
arn:${AWS::Partition}:route53:::hostedzone/${hostedZoneId}—
ses:CreateEmailIdentity
ses:GetEmailIdentity
ses:PutEmailIdentityDkimSigningAttributes
arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${hostedzoneresource87BCC632.domainName}—
ses:TagResourcearn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${hostedzoneresource87BCC632.domainName}StringEquals aws:RequestTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:root-stack, serverless-inbox:root-stack-id
ses:TagResourcearn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${hostedzoneresource87BCC632.domainName}StringEquals aws:RequestTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:RequestTag/serverless-inbox:root-stack-id = true
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:root-stack, serverless-inbox:root-stack-id
cloudformation:DescribeStacks${AWS::StackId}—

Provisions user identities when invoked by the Admin API or an identity provider webhook. Writes user records, provisions default mailboxes, records the creation event for auditing, and sends welcome emails via SES.

Trigger: Direct invocation (from admin-api or an IdP webhook)

Environment variables (10)
VariableValue
ADMIN_UI_URLresolved at deploy time
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
BLOB_STORAGE_NAME${Select(0, Split("/", Select(5, Split(":", mailboxdatadatadeployerresourceB59B417A.blobStoreArn))))}
CHANGELOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn))))}
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
EMAIL_SUBMISSION_QUEUE_URLresolved at deploy time
ITEM_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn))))}
SERVICE_NAMEidentity-provisioner
SES_CONFIG_SET_NAMEresolved at deploy time
SYSTEM_SENDER_ADDRESSresolved at deploy time
AWS resource access (7 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.itemTableArn}/index/*
—
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.changelogTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
s3:PutObject${mailboxdatadatadeployerresourceB59B417A.blobStoreArn}/tenants/*/accounts/*/emails/*—
sqs:SendMessage${mailboxemailemailsendingemailsubmissionsqueueC553C8C2.Arn}—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/grant-resource
arn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/revoke-resource
—

Periodically fetches the JWKS (JSON Web Key Set) from the configured OIDC issuer and stores the public keys in the auth key store table. This lets the API authorizers — and jmap-api itself — validate JWTs locally without making an outbound call to the IdP on every request. WebSocket connections are covered by the same keys: the $connect route is protected by the same authorizer as the JMAP HTTP API, so the token is validated before the connect handler runs.

The outbound HTTPS call to each issuer’s discovery endpoint needs no IAM permission, so it does not appear in the access table below.

Trigger: EventBridge scheduled rule

Environment variables (3)
VariableValue
AUTH_KEY_STORE_TABLE_NAMEresolved at deploy time
ISSUERSresolved at deploy time
SERVICE_NAMEauth-key-store-updater
AWS resource access (4 statements)
ActionsResourcesConditions
dynamodb:GetItem
dynamodb:PutItem
${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = hmac
dynamodb:GetItem
dynamodb:PutItem
${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = jwks
dynamodb:GetItem
dynamodb:PutItem
${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = connection-key-public
dynamodb:DeleteItem
dynamodb:PutItem
dynamodb:Query
${mailboxauthauthkeystore60D0E9D3.Arn}ForAllValues:StringEquals dynamodb:LeadingKeys = connection-key-private

Consumes audit events from the shared audit SQS queue and writes them to the Audit log table. By routing audit writes through a queue, business-logic Lambdas can emit audit events fire-and-forget without blocking on persistence.

Trigger: SQS (audit events queue)

Environment variables (2)
VariableValue
AUDIT_LOG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn))))}
SERVICE_NAMEaudit-writer
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.auditLogTableArn}/index/*
—
sqs:DeleteMessage
sqs:GetQueueAttributes
sqs:ReceiveMessage
${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—

Periodically fetches the vendor license status and updates the Config table. Allows the system to validate license tier, feature eligibility, and seat counts on a schedule.

Trigger: EventBridge scheduled rule

Environment variables (3)
VariableValue
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
CORE_DOMAINresolved at deploy time
SERVICE_NAMElicense-refresher
AWS resource access (2 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/refresh-license—

Watches for the root stack’s terminal CloudFormation events and reports failures to the vendor. Triggered by stack status changes after deployment operations complete.

Trigger: EventBridge rule (CloudFormation stack status changes)

Environment variables (2)
VariableValue
INFRA_LOG_GROUP_NAMEresolved at deploy time
SERVICE_NAMEstack-failure-detector
AWS resource access (4 statements)
ActionsResourcesConditions
cloudformation:DescribeStackEvents
cloudformation:DescribeStacks
${AWS::StackId}—
logs:CreateLogStream
logs:PutLogEvents
${sharedloggroupinfra0E6EFFD7.Arn}—
logs:FilterLogEvents${sharedloggroupinfra0E6EFFD7.Arn}
arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:${sharedloggroupinfra0E6EFFD7}
—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/issue-stack-failure-upload—

Starts the async cleanup of retained resources (ACM certificates, Lambda@Edge functions, and stack-failure-detector resources) after stack deletion or update. Invoked via a CloudFormation custom resource, it kicks off the sweeper Step Functions state machine and does not perform any cleanup itself.

Trigger: CloudFormation custom resource (on stack delete/update)

Environment variables (2)
VariableValue
MAILBOX_SWEEPER_STATE_MACHINE_ARNresolved at deploy time
SERVICE_NAMEresource-sweeper-starter
AWS resource access (3 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
states:StartExecutionarn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:mailbox-sweeper-867e750f-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—
states:ListExecutions
states:StopExecution
arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:mailbox-sweeper-867e750f-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—

Performs the individual resource cleanups the sweeper state machine schedules. This is the half of the sweeper pair that holds the delete permissions; they are tag-scoped to the resources of the root stack being swept.

Trigger: Step Functions state machine invocation (sweeper workflow)

Environment variables (1)
VariableValue
SERVICE_NAMEresource-sweeper-worker
AWS resource access (18 statements)
ActionsResourcesConditions
acm:DescribeCertificate
acm:ListTagsForCertificate
arn:${AWS::Partition}:acm:${AWS::Region}:${AWS::AccountId}:certificate/*—
acm:DeleteCertificatearn:${AWS::Partition}:acm:${AWS::Region}:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
acm:DeleteCertificatearn:${AWS::Partition}:acm:${AWS::Region}:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
lambda:GetFunctionarn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*—
lambda:DeleteFunctionarn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
lambda:DeleteFunctionarn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
events:DescribeRule
events:ListTagsForResource
events:ListTargetsByRule
arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/*—
events:DeleteRule
events:RemoveTargets
arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
events:DeleteRule
events:RemoveTargets
arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
lambda:GetFunctionarn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*—
lambda:DeleteFunctionarn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
lambda:DeleteFunctionarn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
iam:ListRoleTagsarn:${AWS::Partition}:iam::${AWS::AccountId}:role/mailbox-diag-role-*-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—
iam:DeleteRole
iam:DeleteRolePolicy
arn:${AWS::Partition}:iam::${AWS::AccountId}:role/mailbox-diag-role-*-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—
iam:ListRoleTagsarn:${AWS::Partition}:iam::${AWS::AccountId}:role/mailbox-sweeper-worker-*-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—
iam:DeleteRole
iam:DeleteRolePolicy
arn:${AWS::Partition}:iam::${AWS::AccountId}:role/mailbox-sweeper-worker-*-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—
logs:CreateLogGrouparn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:${sharedloggroupinfra0E6EFFD7}—
logs:CreateLogStream
logs:PutLogEvents
${sharedloggroupinfra0E6EFFD7.Arn}—

A CloudFormation custom resource that creates the initial admin user in Cognito during stack deployment, so that there is an account able to sign in to the Admin UI.

Trigger: CloudFormation custom resource (on user pool creation)

Environment variables (1)
VariableValue
SERVICE_NAMEcognito-bootstrap-user
AWS resource access (2 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
cognito-idp:AdminAddUserToGroup
cognito-idp:AdminCreateUser
${userpoolcognitodeployerresource47EBE664.userPoolArn}—

Provides an admin API for managing Cognito user pool users and groups. Called by the Admin API to provision users via external identity providers or programmatically.

Trigger: HTTP API Gateway (via the Admin API)

Environment variables (6)
VariableValue
ADMIN_GROUPS["admin"]
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
IDENTITY_PROVISIONER_FUNCTION_NAMEresolved at deploy time
SERVICE_NAMEcognito-idp-users-api
USER_GROUPS["user"]
USER_POOL_ID${Select(1, Split("/", Select(5, Split(":", userpoolcognitodeployerresource47EBE664.userPoolArn))))}
AWS resource access (3 statements)
ActionsResourcesConditions
cognito-idp:AdminAddUserToGroup
cognito-idp:AdminCreateUser
cognito-idp:AdminDeleteUser
cognito-idp:AdminDisableUser
cognito-idp:AdminEnableUser
cognito-idp:AdminGetUser
cognito-idp:AdminSetUserPassword
cognito-idp:ListUsers
${userpoolcognitodeployerresource47EBE664.userPoolArn}—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
lambda:InvokeFunction${mailboxauthidentityprovisionerD2F3DDF7.Arn}
${mailboxauthidentityprovisionerD2F3DDF7.Arn}:*
—

Handles JMAP OAuth 2.0 Dynamic Client Registration (RFC 7591). Allows clients to register themselves as OAuth clients without pre-configuration, enabling third-party client applications to obtain credentials for accessing user mailboxes.

Trigger: HTTP API Gateway

Environment variables (3)
VariableValue
IDENTITY_PROVISIONER_FUNCTION_NAMEresolved at deploy time
SERVICE_NAMEjmap-oauth-dcr
USER_POOL_ID${Select(1, Split("/", Select(5, Split(":", userpoolcognitodeployerresource47EBE664.userPoolArn))))}
AWS resource access (2 statements)
ActionsResourcesConditions
lambda:InvokeFunction${mailboxauthidentityprovisionerD2F3DDF7.Arn}
${mailboxauthidentityprovisionerD2F3DDF7.Arn}:*
—
cognito-idp:CreateUserPoolClient
cognito-idp:DeleteUserPoolClient
${userpoolcognitodeployerresource47EBE664.userPoolArn}—

These optional Lambdas provide vendor-facing operations. They are only deployed when explicitly enabled or when required addon providers are configured.

Provides a vendor-facing API for initiating stack updates — moving the CloudFormation stack to a different release template. It drives the update through a Step Functions workflow rather than calling CloudFormation directly for the whole operation.

Trigger: HTTP API Gateway (Admin API integration)

Environment variables (8)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
POINTER_BUCKETresolved at deploy time
POINTER_KEYserverlessinbox/templates/mail-server-standard/releases/stable.json
ROOT_STACK_ARNresolved at deploy time
SERVICE_NAMEstack-update-api
TEMPLATE_URL_TEMPLATEresolved at deploy time
TEMPLATE_VERSION_PARAM_NAMEresolved at deploy time
AWS resource access (5 statements)
ActionsResourcesConditions
cloudformation:CreateChangeSet
cloudformation:DeleteChangeSet
cloudformation:DescribeChangeSet
cloudformation:DescribeStackEvents
cloudformation:DescribeStacks
cloudformation:GetTemplate
cloudformation:ListChangeSets
${AWS::StackId}—
s3:GetObjectarn:aws:s3:::mailbox-artifacts-*/serverlessinbox/templates/*/releases/*—
dynamodb:BatchGetItem
dynamodb:GetItem
dynamodb:Query
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
ssm:DescribeParameters
ssm:GetParameter
ssm:GetParameterHistory
ssm:GetParameters
arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${mailboxapisstackupdateaddontemplateversionC693154D}—

Provides a vendor-facing API for support operations, so vendor engineers can work a support case against your deployment.

This function does not itself hold the diagnostic access a support engineer uses. That access belongs to separate support roles, and is switched on and off by tagging them — which is why this function’s IAM permissions are limited to tagging one specific role, with an aws:TagKeys condition restricting which tags it may set. Read the access table below as the boundary of what the support addon can reach on its own.

Trigger: HTTP API Gateway (Admin API integration)

Environment variables (9)
VariableValue
AUDIT_EVENTS_QUEUE_URLresolved at deploy time
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
SERVICE_NAMEsupport-api
STACK_IDresolved at deploy time
SUPPORT_CONFIG_READ_ROLE_ARNresolved at deploy time
SUPPORT_CONFIG_READ_TAG_KEYserverless-inbox:support:config-read
SUPPORT_DIAG_ROLE_ARNresolved at deploy time
SUPPORT_DIAG_TAG_KEYserverless-inbox:support:diag
SUPPORT_HOP_ROLE_ARNresolved at deploy time
AWS resource access (5 statements)
ActionsResourcesConditions
iam:TagRole
iam:UntagRole
arn:${AWS::Partition}:iam::${AWS::AccountId}:role/support-hop-9da399db-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}ForAllValues:StringEquals aws:TagKeys = serverless-inbox:support:diag, serverless-inbox:support:config-read
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
sqs:SendMessage${mailboxdataauditwritingauditeventsqueue6FE4B54B.Arn}—
cloudtrail:LookupEvents*—
execute-api:Invokearn:${AWS::Partition}:execute-api:*:791990038981:*/*/POST/support-case-sync—

A scheduled Lambda that collects cross-account role assumption events for support role tracking. Used alongside support-api to maintain an audit trail of vendor access.

Trigger: EventBridge scheduled rule

Environment variables (7)
VariableValue
CONFIG_TABLE_NAME${Select(1, Split("/", Select(5, Split(":", mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn))))}
SERVICE_NAMEsupport-role-assumption-collector
SUPPORT_CONFIG_READ_ROLE_ARNresolved at deploy time
SUPPORT_CONFIG_READ_TAG_KEYserverless-inbox:support:config-read
SUPPORT_DIAG_ROLE_ARNresolved at deploy time
SUPPORT_DIAG_TAG_KEYserverless-inbox:support:diag
SUPPORT_HOP_ROLE_ARNresolved at deploy time
AWS resource access (4 statements)
ActionsResourcesConditions
dynamodb:BatchGetItem
dynamodb:DeleteItem
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:UpdateItem
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}
${mailboxdatadatadeployeroverrideresolverresourceF9D9522A.configTableArn}/index/*
—
cloudtrail:LookupEvents*—
iam:TagRole
iam:UntagRole
arn:${AWS::Partition}:iam::${AWS::AccountId}:role/support-hop-9da399db-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}ForAllValues:StringEquals aws:TagKeys = serverless-inbox:support:diag, serverless-inbox:support:config-read
iam:ListRoleTagsarn:${AWS::Partition}:iam::${AWS::AccountId}:role/support-hop-9da399db-${Select(0, Split("-", Select(2, Split("/", AWS::StackId))))}—

These TypeScript Lambdas are deployed as CloudFormation custom resource handlers and Step Functions workers. They are part of the deployment machinery rather than the mail path, and are invoked only during stack create/update/delete operations or on-demand by other infrastructure components.

Handles self-update of Lambda code and UI bundles. Fetches updated artifacts from the artifact store and creates Lambda code updates, replicating changes to Lambda@Edge functions as needed. Its Lambda and CloudFront statements are narrowed by a condition on the root-stack tag, so they only reach resources belonging to its own deployment.

Trigger: CloudFormation custom resource, EventBridge scheduled rule, or HTTP API Gateway

Environment variables (7)
VariableValue
ARTIFACT_BUCKET_BASEmailbox-artifacts
DIST_TAGstable
GRANULARITYresolved at deploy time
PROJECTserverlessinbox
ROOT_STACK_ID${Select(2, Split("/", AWS::StackId))}
ROOT_STACK_TAG_VALUEresolved at deploy time
SERVICE_NAMEartifact-updater
AWS resource access (21 statements)
ActionsResourcesConditions
tag:GetResources*—
lambda:GetFunction
lambda:GetFunctionConfiguration
lambda:InvokeFunction
lambda:UpdateFunctionCode
arn:${AWS::Partition}:lambda:*:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
lambda:GetFunction
lambda:GetFunctionConfiguration
lambda:InvokeFunction
lambda:UpdateFunctionCode
arn:${AWS::Partition}:lambda:*:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
lambda:TagResourcearn:${AWS::Partition}:lambda:*:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:artifact-version
lambda:TagResourcearn:${AWS::Partition}:lambda:*:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:artifact-version
lambda:GetFunctionConfiguration
lambda:PublishVersion
arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
lambda:GetFunctionConfiguration
lambda:PublishVersion
arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
cloudfront:CreateInvalidation
cloudfront:GetDistributionConfig
cloudfront:UpdateDistribution
arn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
cloudfront:CreateInvalidation
cloudfront:GetDistributionConfig
cloudfront:UpdateDistribution
arn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
cloudfront:TagResourcearn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:artifact-version
cloudfront:TagResourcearn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
ForAllValues:StringEquals aws:TagKeys = serverless-inbox:artifact-version
s3:GetObjectarn:${AWS::Partition}:s3:::mailbox-artifacts-*/serverlessinbox/packages/*/releases/*—
cloudformation:DescribeStacks${AWS::StackId}—
s3:DeleteObject
s3:PutObject
${mailboxuiadminuiuiadminui2E4AC371.Arn}/content/*—
s3:DeleteObject
s3:PutObject
${mailboxuiadminuiuiadminui2E4AC371.Arn}/config/*—
s3:ListBucket${mailboxuiadminuiuiadminui2E4AC371.Arn}StringLike s3:prefix = content/*
s3:ListBucket${mailboxuiadminuiuiadminui2E4AC371.Arn}StringLike s3:prefix = config/*
s3:DeleteObject
s3:PutObject
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}/content/*—
s3:DeleteObject
s3:PutObject
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}/config/*—
s3:ListBucket${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}StringLike s3:prefix = content/*
s3:ListBucket${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}StringLike s3:prefix = config/*

A CloudFormation custom resource that resolves data table names and other environment configuration at deploy time. Most Lambdas on this page take their table names from its outputs, which is why their environment values resolve through it.

Trigger: CloudFormation custom resource (on stack create/update)

Environment variables (1)
VariableValue
SERVICE_NAMEdata-override-resolver
AWS resource access (1 statements)
ActionsResourcesConditions
dynamodb:DescribeTablearn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*—

A CloudFormation custom resource that empties S3 buckets on stack deletion. Needed because CloudFormation cannot delete a non-empty S3 bucket.

Trigger: CloudFormation custom resource (on stack delete)

Environment variables (1)
VariableValue
SERVICE_NAMEbucket-auto-empty
AWS resource access (7 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
s3:ListBucket
s3:ListBucketVersions
${sharedpublicstaticassets97AAF7EA.Arn}—
s3:DeleteObject
s3:DeleteObjectVersion
${sharedpublicstaticassets97AAF7EA.Arn}/*—
s3:ListBucket
s3:ListBucketVersions
${mailboxuiadminuiuiadminui2E4AC371.Arn}—
s3:DeleteObject
s3:DeleteObjectVersion
${mailboxuiadminuiuiadminui2E4AC371.Arn}/*—
s3:ListBucket
s3:ListBucketVersions
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}—
s3:DeleteObject
s3:DeleteObjectVersion
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}/*—

A CloudFormation custom resource that deploys UI bundle content (HTML, CSS, JavaScript and other assets) into the CloudFront-backed S3 buckets, and invalidates the distribution afterwards.

Trigger: CloudFormation custom resource (on stack create/update)

Environment variables (1)
VariableValue
SERVICE_NAMEcontent-deployer
AWS resource access (13 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
s3:DeleteObject
s3:PutObject
${sharedpublicstaticassets97AAF7EA.Arn}/.well-known/openid-configuration—
s3:DeleteObject
s3:PutObject
${mailboxuiadminuiuiadminui2E4AC371.Arn}/content/*—
s3:ListBucket${mailboxuiadminuiuiadminui2E4AC371.Arn}—
s3:GetObject
s3:GetObjectVersion
arn:${AWS::Partition}:s3:::mailbox-artifacts-${AWS::Region}/serverlessinbox/packages/mail-server-admin-ui/releases/v0.1.3/admin-ui.zip—
s3:DeleteObject
s3:PutObject
${mailboxuiadminuiuiadminui2E4AC371.Arn}/config/config.json—
cloudfront:CreateInvalidationarn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/${mailboxuiadminuidistribution9EDF9DAA}—
s3:DeleteObject
s3:PutObject
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}/content/*—
s3:ListBucket${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}—
s3:GetObject
s3:GetObjectVersion
arn:${AWS::Partition}:s3:::mailbox-artifacts-${AWS::Region}/serverlessinbox/packages/mail-server-webmail-ui/releases/v0.0.39/webmail-ui.zip—
s3:DeleteObject
s3:PutObject
${mailboxuiwebmailuiuiwebmailuiCD23BF7D.Arn}/config/config.json—
cloudfront:CreateInvalidationarn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/${mailboxuiwebmailuidistribution82B7033A}—
s3:DeleteObject
s3:PutObject
${sharedpublicstaticassets97AAF7EA.Arn}/.well-known/oauth-protected-resource—

A CloudFormation custom resource that derives stack names, domain names, and other configuration values at deploy time from hosted zone and parameter data. Centralizes environment-specific resolution logic.

Trigger: CloudFormation custom resource (on stack create/update)

Environment variables (1)
VariableValue
SERVICE_NAMEstack-helpers
AWS resource access (2 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
route53:GetHostedZonearn:${AWS::Partition}:route53:::hostedzone/${hostedZoneId}—

Starts the asynchronous deployment of the nested edge stack (the us-east-1 CloudFront and Lambda@Edge resources). Invoked as a custom resource, it starts the edge deployer state machine and polls it for completion; it holds no CloudFormation permissions of its own.

Trigger: CloudFormation custom resource (on stack create/update/delete)

Environment variables (2)
VariableValue
MAILBOX_STACK_DEPLOYER_STATE_MACHINE_ARNresolved at deploy time
SERVICE_NAMEstack-deployer-edge-starter
AWS resource access (4 statements)
ActionsResourcesConditions
states:StartExecution${mailboxedgestackdeployerinfraworkflow26959DC8}—
states:DescribeExecutionarn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:execution:${Select(6, Split(":", mailboxedgestackdeployerinfraworkflow26959DC8))}:*—
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:DescribeStacksarn:${AWS::Partition}:cloudformation:us-east-1:${AWS::AccountId}:stack/${AWS::StackName}-edge-*/*—

Performs the CloudFormation work for the nested edge stack — creating, updating, deleting, and polling it — and handles rollback. This is the half of the pair that carries the deployment permissions for the edge stack and the certificates, Lambda@Edge functions and roles it creates. Several of its statements are narrowed by a name prefix or a root-stack tag condition rather than by a fully specific ARN; the access table shows which.

Trigger: Step Functions state machine invocation (edge deployer workflow)

Environment variables (1)
VariableValue
SERVICE_NAMEstack-deployer-edge-worker
AWS resource access (25 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:CreateStack
cloudformation:DeleteStack
cloudformation:DescribeStackEvents
cloudformation:DescribeStacks
cloudformation:GetStackPolicy
cloudformation:GetTemplateSummary
cloudformation:SetStackPolicy
cloudformation:UpdateStack
arn:${AWS::Partition}:cloudformation:us-east-1:${AWS::AccountId}:stack/${AWS::StackName}-edge-*/*—
s3:GetObject
s3:GetObjectVersion
arn:aws:s3:::mailbox-artifacts-us-east-1/serverlessinbox/packages/mail-server-cdk-edge/releases/v0.5.11/edge-stack-template.json—
s3:GetObject
s3:GetObjectVersion
arn:aws:s3:::mailbox-artifacts-us-east-1/serverlessinbox/packages/mail-server-cdk-edge/releases/v0.5.11/lambdas/jmap-blob-download.zip—
tag:GetResources*—
tag:TagResources
tag:UntagResources
*ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, serverless-inbox:edge, serverless-inbox:root-region, aws:cloudformation:*
acm:RequestCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*—
acm:DescribeCertificate
acm:ListTagsForCertificate
arn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*—
acm:AddTagsToCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:RequestTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
acm:AddTagsToCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:RequestTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:RequestTag/serverless-inbox:root-stack-id = true
acm:AddTagsToCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
acm:RemoveTagsFromCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
acm:DeleteCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
acm:AddTagsToCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
acm:RemoveTagsFromCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
acm:DeleteCertificatearn:${AWS::Partition}:acm:us-east-1:${AWS::AccountId}:certificate/*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
lambda:CreateFunction
lambda:DeleteFunction
lambda:GetFunction
lambda:ListVersionsByFunction
lambda:PublishVersion
lambda:TagResource
lambda:UntagResource
lambda:UpdateFunctionCode
lambda:UpdateFunctionConfiguration
arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:${AWS::StackName}-edge-*—
lambda:CreateFunction
lambda:DeleteFunction
lambda:GetFunction
lambda:ListVersionsByFunction
lambda:PublishVersion
lambda:TagResource
lambda:UntagResource
lambda:UpdateFunctionCode
lambda:UpdateFunctionConfiguration
*StringLike lambda:FunctionName = ${AWS::StackName}-edge-*
lambda:DeleteFunction
lambda:GetFunction
lambda:ListVersionsByFunction
lambda:PublishVersion
lambda:TagResource
lambda:UntagResource
lambda:UpdateFunctionCode
lambda:UpdateFunctionConfiguration
arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
StringEquals aws:ResourceTag/serverless-inbox:edge = true
lambda:DeleteFunction
lambda:GetFunction
lambda:ListVersionsByFunction
lambda:PublishVersion
lambda:TagResource
lambda:UntagResource
lambda:UpdateFunctionCode
lambda:UpdateFunctionConfiguration
arn:${AWS::Partition}:lambda:us-east-1:${AWS::AccountId}:function:*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
StringEquals aws:ResourceTag/serverless-inbox:edge = true
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
iam:PassRole${mailboxedgestackdeployerjmapblobdownloadrole20737A6F.Arn}StringEquals iam:PassedToService = lambda.amazonaws.com, edgelambda.amazonaws.com
resource-groups:CreateGroup*—
resource-groups:DeleteGroup
resource-groups:GetGroup
resource-groups:GetGroupConfiguration
resource-groups:GetGroupQuery
resource-groups:GetTags
resource-groups:Tag
resource-groups:Untag
resource-groups:UpdateGroup
resource-groups:UpdateGroupQuery
arn:${AWS::Partition}:resource-groups:us-east-1:${AWS::AccountId}:group/${AWS::StackName}-edge-*-serverless-inbox—
route53:ChangeResourceRecordSets
route53:ListResourceRecordSets
arn:${AWS::Partition}:route53:::hostedzone/${hostedZoneId}—
route53:GetChangearn:${AWS::Partition}:route53:::change/*—

Starts the asynchronous deployment of the nested data stack, which owns the DynamoDB tables and the email blob store. Like the other starters it only starts the state machine and watches the execution.

Trigger: CloudFormation custom resource (on stack create/update/delete)

Environment variables (2)
VariableValue
MAILBOX_STACK_DEPLOYER_STATE_MACHINE_ARNresolved at deploy time
SERVICE_NAMEstack-deployer-data-starter
AWS resource access (4 statements)
ActionsResourcesConditions
states:StartExecution${mailboxdatadatadeployerinfraworkflow48B64ECE}—
states:DescribeExecutionarn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:execution:${Select(6, Split(":", mailboxdatadatadeployerinfraworkflow48B64ECE))}:*—
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:DescribeStacksarn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}-data/*—

Performs the CloudFormation work for the nested data stack. Because the data stack creates the tables and the blob store, this worker holds the DynamoDB and S3 lifecycle permissions for them — scoped by name prefix to the data stack’s own resources. Deploying the data stack separately is what lets the tables and bucket survive a replacement of the main stack.

Trigger: Step Functions state machine invocation (data deployer workflow)

Environment variables (1)
VariableValue
SERVICE_NAMEstack-deployer-data-worker
AWS resource access (9 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:CreateStack
cloudformation:DeleteStack
cloudformation:DescribeStackEvents
cloudformation:DescribeStacks
cloudformation:GetStackPolicy
cloudformation:GetTemplateSummary
cloudformation:SetStackPolicy
cloudformation:UpdateStack
arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}-data/*—
cloudformation:ValidateTemplate*—
s3:GetObject
s3:GetObjectVersion
arn:aws:s3:::mailbox-artifacts-${AWS::Region}/serverlessinbox/packages/mail-server-cdk/releases/v0.5.11/data-stack-template.json—
tag:GetResources*—
tag:TagResources
tag:UntagResources
*ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
dynamodb:CreateTable
dynamodb:DeleteTable
dynamodb:DescribeContinuousBackups
dynamodb:DescribeTable
dynamodb:DescribeTableReplicaAutoScaling
dynamodb:DescribeTimeToLive
dynamodb:ListTagsOfResource
dynamodb:TagResource
dynamodb:UntagResource
dynamodb:UpdateContinuousBackups
dynamodb:UpdateTable
dynamodb:UpdateTimeToLive
arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${AWS::AccountId}-${mailboxdatastackhelpers2FE97920.s3SafeDataStackName}-*—
s3:CreateBucket
s3:DeleteBucket
s3:DeleteBucketPolicy
s3:GetBucketLocation
s3:GetBucketOwnershipControls
s3:GetBucketPolicy
s3:GetBucketPublicAccessBlock
s3:GetBucketTagging
s3:GetBucketVersioning
s3:GetEncryptionConfiguration
s3:GetLifecycleConfiguration
s3:PutBucketOwnershipControls
s3:PutBucketPolicy
s3:PutBucketPublicAccessBlock
s3:PutBucketTagging
s3:PutBucketVersioning
s3:PutEncryptionConfiguration
s3:PutLifecycleConfiguration
arn:${AWS::Partition}:s3:::${AWS::AccountId}-${mailboxdatastackhelpers2FE97920.s3SafeDataStackName}-*—
kms:CreateGrant
kms:DescribeKey
arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:alias/aws/dynamodb
arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:alias/aws/s3
arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/*
Bool kms:GrantIsForAWSResource = true

Starts the asynchronous deployment of the nested Cognito stack, which owns the user pool when the built-in identity provider is used. It only starts the state machine and watches the execution.

Trigger: CloudFormation custom resource (on stack create/update/delete)

Environment variables (2)
VariableValue
MAILBOX_STACK_DEPLOYER_STATE_MACHINE_ARNresolved at deploy time
SERVICE_NAMEstack-deployer-cognito-starter
AWS resource access (4 statements)
ActionsResourcesConditions
states:StartExecution${userpoolcognitodeployerinfraworkflow211968FD}—
states:DescribeExecutionarn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:execution:${Select(6, Split(":", userpoolcognitodeployerinfraworkflow211968FD))}:*—
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:DescribeStacksarn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}-cognito/*—

Performs the CloudFormation work for the nested Cognito stack, and therefore holds the user pool lifecycle permissions. Keeping the user pool in its own nested stack is what lets it survive a replacement of the main stack, so that existing sign-ins are not invalidated by an update.

Trigger: Step Functions state machine invocation (Cognito deployer workflow)

Environment variables (1)
VariableValue
SERVICE_NAMEstack-deployer-cognito-worker
AWS resource access (21 statements)
ActionsResourcesConditions
cloudformation:DescribeStacks${AWS::StackId}—
cloudformation:CreateStack
cloudformation:DeleteStack
cloudformation:DescribeStackEvents
cloudformation:DescribeStacks
cloudformation:GetStackPolicy
cloudformation:GetTemplateSummary
cloudformation:SetStackPolicy
cloudformation:UpdateStack
arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}-cognito/*—
cloudformation:GetTemplatearn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${AWS::StackName}-cognito/*—
cloudformation:ValidateTemplate*—
s3:GetObject
s3:GetObjectVersion
arn:aws:s3:::mailbox-artifacts-${AWS::Region}/serverlessinbox/packages/mail-server-cognito/releases/v0.5.11/cognito-data-stack-template.json—
tag:GetResources*—
tag:TagResources
tag:UntagResources
*ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
cognito-idp:CreateUserPool*—
cognito-idp:DeleteUserPool
cognito-idp:DescribeUserPool
cognito-idp:GetUserPoolMfaConfig
cognito-idp:ListTagsForResource
cognito-idp:SetUserPoolMfaConfig
cognito-idp:UntagResource
cognito-idp:UpdateUserPool
*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
cognito-idp:DeleteUserPool
cognito-idp:DescribeUserPool
cognito-idp:GetUserPoolMfaConfig
cognito-idp:ListTagsForResource
cognito-idp:SetUserPoolMfaConfig
cognito-idp:UntagResource
cognito-idp:UpdateUserPool
*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
cognito-idp:TagResource*StringEquals aws:RequestTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
cognito-idp:TagResource*StringEquals aws:RequestTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:RequestTag/serverless-inbox:root-stack-id = true
ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
cognito-idp:TagResource*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
cognito-idp:TagResource*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
ForAllValues:StringLike aws:TagKeys = serverless-inbox:product, serverless-inbox:root-stack, serverless-inbox:root-stack-id, serverless-inbox:stack, serverless-inbox:component, serverless-inbox:deployer_type, Name, serverless-inbox:description, aws:cloudformation:*
cognito-idp:CreateUserPoolDomain
cognito-idp:DeleteUserPoolDomain
cognito-idp:UpdateUserPoolDomain
*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
cognito-idp:CreateUserPoolDomain
cognito-idp:DeleteUserPoolDomain
cognito-idp:UpdateUserPoolDomain
*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
cognito-idp:DescribeUserPoolDomain*—
cognito-idp:CreateResourceServer
cognito-idp:DeleteResourceServer
cognito-idp:DescribeResourceServer
cognito-idp:UpdateResourceServer
*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
cognito-idp:CreateResourceServer
cognito-idp:DeleteResourceServer
cognito-idp:DescribeResourceServer
cognito-idp:UpdateResourceServer
*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true
cognito-idp:CreateGroup
cognito-idp:DeleteGroup
cognito-idp:GetGroup
cognito-idp:UpdateGroup
*StringEquals aws:ResourceTag/serverless-inbox:root-stack-id = ${Select(2, Split("/", AWS::StackId))}
cognito-idp:CreateGroup
cognito-idp:DeleteGroup
cognito-idp:GetGroup
cognito-idp:UpdateGroup
*StringEquals aws:ResourceTag/serverless-inbox:root-stack = ${AWS::StackName}
Null aws:ResourceTag/serverless-inbox:root-stack-id = true

Implements the Model Context Protocol (MCP), allowing AI agents and LLM applications to interact with mailbox data and operations. It requires an Advanced license tier and is gated behind the enableMcp property of the MailServer construct.

The standard app does not set that property, so mcp-api is not part of the template the tables above are generated from and therefore has no entry on this page. A deployment that enables it gets an additional function whose permissions are not documented here.

All Go lambdas use a buffered logging strategy designed to keep CloudWatch Logs quiet during normal operation while retaining full diagnostic context for failures. Behaviour is controlled by a LOG_LEVEL environment variable. The standard template does not set LOG_LEVEL on any function, which is why it does not appear in the environment tables above — the unset default described below applies everywhere.

Default behaviour (no LOG_LEVEL set): the emit level defaults to error. Debug, info, and warn messages are written into a 1000-entry in-memory ring buffer instead of CloudWatch. Only error-level messages are emitted immediately. When an error occurs and the lambda calls Flush(), the entire ring buffer is dumped retroactively — giving you the debug trail leading up to the failure without paying the CloudWatch cost on every successful invocation. If the buffer fills (more than 1000 entries), the oldest entries are silently dropped to make room.

LOG_LEVEL values:

ValueBehaviour
(unset)Equivalent to error — only errors emitted immediately; everything else buffered
errorSame as above
warnWarn and error emitted immediately; debug and info buffered
infoInfo, warn, and error emitted immediately; debug buffered
debugAll messages emitted immediately; buffering disabled

Setting LOG_LEVEL=debug or LOG_LEVEL=info disables buffering for the corresponding levels, which is useful during development or active incident investigation but increases CloudWatch volume in production.