SMTP Relay Landing Zone
br/innofactor:avm/ptn/lz/smtp-relay:0.2.0
README
SMTP Relay (Landing Zone Pattern) [Lz/SmtpRelay]
A managed SMTP relay: Postfix on N hosts behind an internal load balancer, delivering mail through Microsoft Graph, with its own network, Key Vault, monitoring and payload alerts. Subscription-scope wrapper: it creates ONE resource group, then invokes smtp-relay.bicep, which renders the compose file from parameters and calls the container-appliance pattern module (avm/ptn/lz/container-appliance) in loadBalanced mode.
All parameters pass straight through. The hub side is a prerequisite this module does not write: a firewall DNAT rule to the load balancer address, and hub return routes for the relay subnet (workload-networking hubReturnRoutes). See the Notes section.
Navigation
Resource Types
| Resource Type | API Version |
|---|---|
Microsoft.Authorization/locks | 2020-05-01 |
Microsoft.Authorization/policyAssignments | 2024-04-01 |
Microsoft.Authorization/roleAssignments | 2022-04-01 |
Microsoft.Automanage/configurationProfileAssignments | 2022-05-04 |
Microsoft.Compute/disks | 2024-03-02 |
Microsoft.Compute/virtualMachines | 2024-07-01 |
Microsoft.Compute/virtualMachines/extensions | 2022-11-01 |
Microsoft.Compute/virtualMachineScaleSets | 2024-07-01 |
Microsoft.DevTestLab/schedules | 2018-09-15 |
Microsoft.GuestConfiguration/guestConfigurationAssignments | 2020-06-25 |
Microsoft.Insights/actionGroups | 2023-01-01 |
Microsoft.Insights/dataCollectionRuleAssociations | 2023-03-11 |
Microsoft.Insights/dataCollectionRules | 2023-03-11 |
Microsoft.Insights/diagnosticSettings | 2021-05-01-preview |
Microsoft.Insights/metricAlerts | 2018-03-01 |
Microsoft.Insights/scheduledQueryRules | 2025-01-01-preview |
Microsoft.Insights/workbooks | 2023-06-01 |
Microsoft.KeyVault/vaults | 2024-11-01 |
Microsoft.KeyVault/vaults/accessPolicies | 2024-11-01 |
Microsoft.KeyVault/vaults/keys | 2024-11-01 |
Microsoft.KeyVault/vaults/secrets | 2024-11-01 |
Microsoft.Maintenance/configurationAssignments | 2023-04-01 |
Microsoft.Maintenance/maintenanceConfigurations | 2023-04-01 |
Microsoft.ManagedIdentity/userAssignedIdentities | 2024-11-30 |
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials | 2024-11-30 |
Microsoft.Network/loadBalancers | 2024-05-01 |
Microsoft.Network/natGateways | 2023-04-01 |
Microsoft.Network/networkInterfaces | 2024-05-01 |
Microsoft.Network/networkSecurityGroups | 2023-11-01 |
Microsoft.Network/privateEndpoints | 2024-10-01 |
Microsoft.Network/privateEndpoints | 2023-11-01 |
Microsoft.Network/privateEndpoints | 2024-05-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2024-10-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2024-05-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2023-11-01 |
Microsoft.Network/publicIPAddresses | 2023-09-01 |
Microsoft.Network/publicIPAddresses | 2024-05-01 |
Microsoft.Network/publicIPPrefixes | 2023-09-01 |
Microsoft.Network/routeTables | 2024-05-01 |
Microsoft.Network/virtualNetworks | 2024-05-01 |
Microsoft.Network/virtualNetworks/subnets | 2024-05-01 |
Microsoft.Network/virtualNetworks/virtualNetworkPeerings | 2024-01-01 |
Microsoft.OperationalInsights/workspaces | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/dataExports | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/dataSources | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/linkedServices | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/linkedStorageAccounts | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/savedSearches | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/storageInsightConfigs | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/tables | 2025-02-01 |
Microsoft.OperationsManagement/solutions | 2015-11-01-preview |
Microsoft.PolicyInsights/remediations | 2021-10-01 |
Microsoft.RecoveryServices/vaults | 2024-04-01 |
Microsoft.RecoveryServices/vaults/backupconfig | 2023-01-01 |
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems | 2024-10-01 |
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems | 2023-01-01 |
Microsoft.RecoveryServices/vaults/backupPolicies | 2024-10-01 |
Microsoft.RecoveryServices/vaults/backupstorageconfig | 2023-01-01 |
Microsoft.RecoveryServices/vaults/replicationAlertSettings | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationPolicies | 2023-06-01 |
Microsoft.Resources/resourceGroups | 2021-04-01 |
Microsoft.SecurityInsights/onboardingStates | 2024-03-01 |
Microsoft.Storage/storageAccounts | 2025-06-01 |
Microsoft.Storage/storageAccounts/blobServices | 2025-01-01 |
Microsoft.Storage/storageAccounts/blobServices/containers | 2025-01-01 |
Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies | 2025-01-01 |
Microsoft.Storage/storageAccounts/fileServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/fileServices/shares | 2025-01-01 |
Microsoft.Storage/storageAccounts/localUsers | 2025-06-01 |
Microsoft.Storage/storageAccounts/managementPolicies | 2025-06-01 |
Microsoft.Storage/storageAccounts/objectReplicationPolicies | 2025-01-01 |
Microsoft.Storage/storageAccounts/queueServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/queueServices/queues | 2025-06-01 |
Microsoft.Storage/storageAccounts/tableServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/tableServices/tables | 2025-06-01 |
Usage examples
The following section provides usage examples for the module, which were used to validate and deploy the module successfully. For a full reference, please review the module’s test folder in its repository.
Note: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.
Note: To reference the module, please use the following syntax
br/innofactor:avm/ptn/lz/smtp-relay:<version>.
Example 1: Using only defaults
This instance deploys the SMTP relay with its own VNet and a single host behind the internal load balancer, pulling the relay image by digest with a read-only registry token. A client VM in the relay subnet proves, through the load balancer address, that the relay accepts mail from an allowed sender and refuses a sender that is not on the list, then sends a real message to a sandbox mailbox and proves from the relay log and through Graph that it arrived. The sandbox Graph app and mailbox come from the CI Key Vault (CI-graphTenantId, CI-graphClientId, CI-graphClientSecret, CI-graphTestMailbox); the deployment fails at validation, naming the parameter, while one is missing.
via Bicep module
module smtpRelay 'br/innofactor:avm/ptn/lz/smtp-relay:<version>' = {
name: 'smtpRelayDeployment'
params: {
// Required parameters
graphClientId: '<graphClientId>'
graphClientSecret: '<graphClientSecret>'
graphSenderMailbox: '<graphSenderMailbox>'
graphTenantId: '<graphTenantId>'
inboundAllowedCidr: '10.0.0.0/8'
mailDomain: 'example.test'
myNetworks: [
'10.242.0.0/24'
]
relayHostname: 'relay.example.test'
senderAllowList: [
'probe@example.test'
]
sshPublicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
// Non-required parameters
enableKeyVaultPurgeProtection: false
instanceCount: 1
keyVaultName: '<keyVaultName>'
location: '<location>'
name: '<name>'
registryToken: '<registryToken>'
scaleSetZones: [
1
2
]
vnetAddressPrefix: '10.242.0.0/24'
}
}via JSON parameters file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"graphClientId": {
"value": "<graphClientId>"
},
"graphClientSecret": {
"value": "<graphClientSecret>"
},
"graphSenderMailbox": {
"value": "<graphSenderMailbox>"
},
"graphTenantId": {
"value": "<graphTenantId>"
},
"inboundAllowedCidr": {
"value": "10.0.0.0/8"
},
"mailDomain": {
"value": "example.test"
},
"myNetworks": {
"value": [
"10.242.0.0/24"
]
},
"relayHostname": {
"value": "relay.example.test"
},
"senderAllowList": {
"value": [
"probe@example.test"
]
},
"sshPublicKey": {
"value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test"
},
// Non-required parameters
"enableKeyVaultPurgeProtection": {
"value": false
},
"instanceCount": {
"value": 1
},
"keyVaultName": {
"value": "<keyVaultName>"
},
"location": {
"value": "<location>"
},
"name": {
"value": "<name>"
},
"registryToken": {
"value": "<registryToken>"
},
"scaleSetZones": {
"value": [
1,
2
]
},
"vnetAddressPrefix": {
"value": "10.242.0.0/24"
}
}
}
via Bicep parameters file
using 'br/innofactor:avm/ptn/lz/smtp-relay:<version>'
// Required parameters
param graphClientId = '<graphClientId>'
param graphClientSecret = '<graphClientSecret>'
param graphSenderMailbox = '<graphSenderMailbox>'
param graphTenantId = '<graphTenantId>'
param inboundAllowedCidr = '10.0.0.0/8'
param mailDomain = 'example.test'
param myNetworks = [
'10.242.0.0/24'
]
param relayHostname = 'relay.example.test'
param senderAllowList = [
'probe@example.test'
]
param sshPublicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
// Non-required parameters
param enableKeyVaultPurgeProtection = false
param instanceCount = 1
param keyVaultName = '<keyVaultName>'
param location = '<location>'
param name = '<name>'
param registryToken = '<registryToken>'
param scaleSetZones = [
1
2
]
param vnetAddressPrefix = '10.242.0.0/24'
Example 2: WAF-aligned
This instance deploys the SMTP relay in alignment with the best practices of the Azure Well-Architected Framework: two hosts spread behind the internal load balancer, placed in an empty subnet the caller brings (here in a VNet the test creates, with a client subnet beside it), CanNotDelete locks on the stateful resources and deliberately NO resource-group lock, a purge-protected Key Vault, and an alert email receiver. The client sits on a network that is NOT in myNetworks, and the test proves the relay still answers EHLO but refuses to relay for it. Real Graph delivery is proven by the defaults test.
via Bicep module
module smtpRelay 'br/innofactor:avm/ptn/lz/smtp-relay:<version>' = {
name: 'smtpRelayDeployment'
params: {
// Required parameters
graphClientId: '00000000-0000-0000-0000-000000000000'
graphClientSecret: '<graphClientSecret>'
graphSenderMailbox: 'relay@example.test'
graphTenantId: '00000000-0000-0000-0000-000000000000'
inboundAllowedCidr: '10.0.0.0/8'
mailDomain: 'example.test'
myNetworks: [
'192.0.2.0/24'
]
relayHostname: 'relay.example.test'
senderAllowList: [
'probe@example.test'
]
sshPublicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
// Non-required parameters
alertEmailAddresses: [
'platform-alerts@example.com'
]
availabilityZone: 1
existingSubnetResourceId: '<existingSubnetResourceId>'
instanceCount: 2
keyVaultName: '<keyVaultName>'
location: '<location>'
name: '<name>'
protectStatefulResources: true
registryToken: '<registryToken>'
scaleSetZones: [
1
2
]
tags: {
Environment: 'Test'
Workload: 'smtp-relay'
}
}
}via JSON parameters file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"graphClientId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"graphClientSecret": {
"value": "<graphClientSecret>"
},
"graphSenderMailbox": {
"value": "relay@example.test"
},
"graphTenantId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"inboundAllowedCidr": {
"value": "10.0.0.0/8"
},
"mailDomain": {
"value": "example.test"
},
"myNetworks": {
"value": [
"192.0.2.0/24"
]
},
"relayHostname": {
"value": "relay.example.test"
},
"senderAllowList": {
"value": [
"probe@example.test"
]
},
"sshPublicKey": {
"value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test"
},
// Non-required parameters
"alertEmailAddresses": {
"value": [
"platform-alerts@example.com"
]
},
"availabilityZone": {
"value": 1
},
"existingSubnetResourceId": {
"value": "<existingSubnetResourceId>"
},
"instanceCount": {
"value": 2
},
"keyVaultName": {
"value": "<keyVaultName>"
},
"location": {
"value": "<location>"
},
"name": {
"value": "<name>"
},
"protectStatefulResources": {
"value": true
},
"registryToken": {
"value": "<registryToken>"
},
"scaleSetZones": {
"value": [
1,
2
]
},
"tags": {
"value": {
"Environment": "Test",
"Workload": "smtp-relay"
}
}
}
}
via Bicep parameters file
using 'br/innofactor:avm/ptn/lz/smtp-relay:<version>'
// Required parameters
param graphClientId = '00000000-0000-0000-0000-000000000000'
param graphClientSecret = '<graphClientSecret>'
param graphSenderMailbox = 'relay@example.test'
param graphTenantId = '00000000-0000-0000-0000-000000000000'
param inboundAllowedCidr = '10.0.0.0/8'
param mailDomain = 'example.test'
param myNetworks = [
'192.0.2.0/24'
]
param relayHostname = 'relay.example.test'
param senderAllowList = [
'probe@example.test'
]
param sshPublicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
// Non-required parameters
param alertEmailAddresses = [
'platform-alerts@example.com'
]
param availabilityZone = 1
param existingSubnetResourceId = '<existingSubnetResourceId>'
param instanceCount = 2
param keyVaultName = '<keyVaultName>'
param location = '<location>'
param name = '<name>'
param protectStatefulResources = true
param registryToken = '<registryToken>'
param scaleSetZones = [
1
2
]
param tags = {
Environment: 'Test'
Workload: 'smtp-relay'
}
Parameters
Required parameters
| Parameter | Type | Description |
|---|---|---|
graphClientId | string | Client (application) ID of the Entra app registration: single tenant, no public client flows, and the Mail.Send application permission only, admin-consented. The app registration is a prerequisite: it is a Graph object, not an ARM resource. |
graphClientSecret | securestring | Client secret of that app registration. Stored in the appliance Key Vault and written to an env file on the host at boot. Never part of the compose file. |
graphSenderMailbox | string | The mailbox Graph sends as. Every message is sent from this mailbox, whatever the original sender. It must be a real Exchange Online mailbox, shared (no licence needed) or licensed: a user whose licence was removed has no mailbox. Restrict the Entra app to it with an application access policy (see the README prerequisites). |
graphTenantId | string | Entra tenant ID of the app registration that sends the mail. |
inboundAllowedCidr | string | CIDR allowed inbound to the relay on port 25: the subnet the hub firewall forwards from. This module opens nothing else. |
mailDomain | string | The mail domain: Postfix mydomain and myorigin, for example contoso.com. |
myNetworks | array | Networks allowed to relay, as CIDRs. Used verbatim as Postfix mynetworks: nothing is added, so list loopback yourself if you need it. At least one entry. |
relayHostname | string | The name the relay announces: Postfix myhostname and the SMTP banner, for example smtp.contoso.com. |
senderAllowList | array | Sender addresses (or domain names, which match every address in them) allowed to send through the relay. The Graph mailbox is always allowed. Enforced for every client, trusted networks included. At least one entry. |
sshPublicKey | string | SSH public key for the admin account. Password sign-in is disabled. |
Conditional parameters
| Parameter | Type | Description |
|---|---|---|
existingIdentityPrincipalId | string | Required if createNewManagedIdentity is false. Principal ID of the existing identity. |
existingIdentityResourceId | string | Required if createNewManagedIdentity is false. Resource ID of the existing identity. |
registryToken | securestring | Required if containerRegistry.mode is keyVaultToken. A read-only registry token (read:packages) issued to a service identity, never to a person. Stored in the appliance Key Vault as the secret named by containerRegistry.tokenSecretName. |
vnetAddressPrefix | string | Required if existingSubnetResourceId is empty. Address space for the relay’s own VNet, for example 10.20.0.0/24. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
adminUsername | string | Local admin username on the hosts. |
alertEmailAddresses | array | Email addresses added to the action group. A service desk mailbox turns each alert into a ticket. |
applianceSubnetNewBits | int | Prefix length of the appliance subnet, carved as the first subnet of vnetAddressPrefix (27 = a /27, about 26 hosts). Despite the name, this is a prefix length. |
availabilityZone | int | Availability zone for the hosts that are not spread by scaleSetZones. |
businessHoursEndUtc | int | Business hours end at the start of this hour, UTC, 1 to 24. Weekdays only. |
businessHoursStartUtc | int | First business hour, UTC, 0 to 23. |
containerRegistry | object | How the hosts pull the relay image. The default is ghcr.io with a read-only token held in the appliance Key Vault (mode keyVaultToken, secret registry-token). The relay image package is private, so the token is needed. Use anonymous only if the package is public, or managedIdentity for an Azure Container Registry. |
containerRestartAlertThreshold | int | The container-restart alert fires when the relay container restarts more than this many times in 15 minutes. |
createNatGateway | bool | Create and associate a NAT Gateway for outbound egress. Ignored with existingSubnetResourceId. |
createNewManagedIdentity | bool | Create a new user-assigned identity (true) or attach an existing one (false). |
defaultRouteNextHopIpAddress | string | Next-hop IP for a 0.0.0.0/0 route on the relay subnet, for example the hub firewall. Ignored with existingSubnetResourceId. |
dnsServers | array | Custom DNS servers for the relay VNet. Ignored with existingSubnetResourceId. |
drainTimeoutSeconds | int | Seconds the drain waits for the queue to empty when a host goes away. The appliance gives a drain command 300 seconds, so keep this below that. |
enableKeyVaultPurgeProtection | bool | Purge protection on the Key Vault. Default true; turn off only for throwaway deployments. |
enableNoDeliveryAlert | bool | Alert when no mail was delivered for an hour inside business hours. Turn it off for a relay that legitimately carries no weekday traffic. |
enableTelemetry | bool | Enable/Disable usage telemetry for module. |
existingSubnetResourceId | string | Resource ID of an existing, dedicated and empty subnet to place the relay in, instead of creating a VNet. See the container-appliance module for what that subnet must provide. |
graphFailureAlertThreshold | int | The graph-send-failures alert fires when the relay logs more than this many deferred or rejected Graph sends in 15 minutes. |
hostPrivateIpAddress | string | Static private IP for the first host. Empty uses the container-appliance default. |
imageReference | string | The relay container image, <registry>/<repository>@sha256:<digest>. Always pinned by digest: the deployment fails without a 64-character @sha256: digest. The default is the vendor-neutral relay image at the digest built from relay commit 58bf566 (the build publishes the digest as a workflow output). |
instanceCount | int | Number of relay hosts, all active together behind the internal load balancer. Every host takes an address in the subnet. |
itsmWebhookUri | string | ITSM webhook URI for the action group. |
keyVaultName | string | Name of the appliance Key Vault. Empty derives it from the name. |
location | string | Azure region to deploy the resources. |
lock | object | A lock to apply to the whole resource group. NOT recommended: it stops Azure Resource Manager grooming deployment history and eventually fails every deployment. Use protectStatefulResources instead. |
messageSizeLimitBytes | int | Largest message the relay accepts, in bytes. Graph rejects a message above its own limit, so keep this at or below it. |
name | string | Short name used to derive every resource name. Lowercase alphanumeric and hyphens, kept short. |
protectStatefulResources | bool | CanNotDelete locks on each resource that holds state, instead of on the resource group. See the container-appliance module. |
queuedMailAlertThreshold | int | The queued-mail alert fires when a host has held more than this many messages for the whole 15-minute window. |
relayHost | string | Next hop Postfix names as relayhost. Mail is delivered through Graph, so this rarely matters. |
relayHostPort | int | Port of relayHost. |
resourceGroupName | string | Name of the resource group this module creates. Defaults to name. |
roleAssignments | array | Additional role assignments to grant on this resource group. |
scaleSetZones | array | Availability zones the scale set spreads across, for example [1, 2, 3]. Empty uses availabilityZone alone. |
tags | object | Tags applied to every resource. |
timeZone | string | Container time zone, for example Europe/Dublin. |
virtualNetworkPeerings | array | VNet peerings in the AVM shape. A remote side is a write outside the relay resource group. Ignored with existingSubnetResourceId. |
vmSize | string | VM size. Avoid burstable (B-series) sizes. |
workspaceResourceId | string | Resource ID of an existing Log Analytics workspace. Empty creates one in the resource group. |
Parameter: graphClientId
Client (application) ID of the Entra app registration: single tenant, no public client flows, and the Mail.Send application permission only, admin-consented. The app registration is a prerequisite: it is a Graph object, not an ARM resource.
- Required: Yes
- Type: string
Parameter: graphClientSecret
Client secret of that app registration. Stored in the appliance Key Vault and written to an env file on the host at boot. Never part of the compose file.
- Required: Yes
- Type: securestring
Parameter: graphSenderMailbox
The mailbox Graph sends as. Every message is sent from this mailbox, whatever the original sender. It must be a real Exchange Online mailbox, shared (no licence needed) or licensed: a user whose licence was removed has no mailbox. Restrict the Entra app to it with an application access policy (see the README prerequisites).
- Required: Yes
- Type: string
Parameter: graphTenantId
Entra tenant ID of the app registration that sends the mail.
- Required: Yes
- Type: string
Parameter: inboundAllowedCidr
CIDR allowed inbound to the relay on port 25: the subnet the hub firewall forwards from. This module opens nothing else.
- Required: Yes
- Type: string
Parameter: mailDomain
The mail domain: Postfix mydomain and myorigin, for example contoso.com.
- Required: Yes
- Type: string
Parameter: myNetworks
Networks allowed to relay, as CIDRs. Used verbatim as Postfix mynetworks: nothing is added, so list loopback yourself if you need it. At least one entry.
- Required: Yes
- Type: array
Parameter: relayHostname
The name the relay announces: Postfix myhostname and the SMTP banner, for example smtp.contoso.com.
- Required: Yes
- Type: string
Parameter: senderAllowList
Sender addresses (or domain names, which match every address in them) allowed to send through the relay. The Graph mailbox is always allowed. Enforced for every client, trusted networks included. At least one entry.
- Required: Yes
- Type: array
Parameter: sshPublicKey
SSH public key for the admin account. Password sign-in is disabled.
- Required: Yes
- Type: string
Parameter: existingIdentityPrincipalId
Required if createNewManagedIdentity is false. Principal ID of the existing identity.
- Required: No
- Type: string
- Default:
''
Parameter: existingIdentityResourceId
Required if createNewManagedIdentity is false. Resource ID of the existing identity.
- Required: No
- Type: string
- Default:
''
Parameter: registryToken
Required if containerRegistry.mode is keyVaultToken. A read-only registry token (read:packages) issued to a service identity, never to a person. Stored in the appliance Key Vault as the secret named by containerRegistry.tokenSecretName.
- Required: No
- Type: securestring
- Default:
''
Parameter: vnetAddressPrefix
Required if existingSubnetResourceId is empty. Address space for the relay’s own VNet, for example 10.20.0.0/24.
- Required: No
- Type: string
- Default:
''
Parameter: adminUsername
Local admin username on the hosts.
- Required: No
- Type: string
- Default:
'relayadmin'
Parameter: alertEmailAddresses
Email addresses added to the action group. A service desk mailbox turns each alert into a ticket.
- Required: No
- Type: array
- Default:
[]
Parameter: applianceSubnetNewBits
Prefix length of the appliance subnet, carved as the first subnet of vnetAddressPrefix (27 = a /27, about 26 hosts). Despite the name, this is a prefix length.
- Required: No
- Type: int
- Default:
27
Parameter: availabilityZone
Availability zone for the hosts that are not spread by scaleSetZones.
- Required: No
- Type: int
- Default:
1 - Allowed:
[ 1 2 3 ]
Parameter: businessHoursEndUtc
Business hours end at the start of this hour, UTC, 1 to 24. Weekdays only.
- Required: No
- Type: int
- Default:
17 - MinValue: 1
- MaxValue: 24
Parameter: businessHoursStartUtc
First business hour, UTC, 0 to 23.
- Required: No
- Type: int
- Default:
7 - MinValue: 0
- MaxValue: 23
Parameter: containerRegistry
How the hosts pull the relay image. The default is ghcr.io with a read-only token held in the appliance Key Vault (mode keyVaultToken, secret registry-token). The relay image package is private, so the token is needed. Use anonymous only if the package is public, or managedIdentity for an Azure Container Registry.
- Required: No
- Type: object
- Default:
{ mode: 'keyVaultToken' server: 'ghcr.io' tokenSecretName: 'registry-token' } - MinValue: 0
- MaxValue: 23
Required parameters
| Parameter | Type | Description |
|---|---|---|
mode | string | How to authenticate: anonymous, managedIdentity or keyVaultToken. |
server | string | Registry server name, for example contoso.azurecr.io. Empty with mode anonymous. |
Conditional parameters
| Parameter | Type | Description |
|---|---|---|
tokenSecretName | string | Required if mode is keyVaultToken: name of the Key Vault secret (one of keyVaultSecrets) holding the registry token. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
registryResourceId | string | managedIdentity only: resource ID of the Azure Container Registry, to grant the VM identity AcrPull on it. |
tokenUsername | string | keyVaultToken only: the user name that goes with the token. |
Parameter: containerRegistry.mode
How to authenticate: anonymous, managedIdentity or keyVaultToken.
- Required: Yes
- Type: string
- Allowed:
[ 'anonymous' 'keyVaultToken' 'managedIdentity' ] - MinValue: 0
- MaxValue: 23
Parameter: containerRegistry.server
Registry server name, for example contoso.azurecr.io. Empty with mode anonymous.
- Required: Yes
- Type: string
- MinValue: 0
- MaxValue: 23
Parameter: containerRegistry.tokenSecretName
Required if mode is keyVaultToken: name of the Key Vault secret (one of keyVaultSecrets) holding the registry token.
- Required: No
- Type: string
- MinValue: 0
- MaxValue: 23
Parameter: containerRegistry.registryResourceId
managedIdentity only: resource ID of the Azure Container Registry, to grant the VM identity AcrPull on it.
- Required: No
- Type: string
- MinValue: 0
- MaxValue: 23
Parameter: containerRegistry.tokenUsername
keyVaultToken only: the user name that goes with the token.
- Required: No
- Type: string
- MinValue: 0
- MaxValue: 23
Parameter: containerRestartAlertThreshold
The container-restart alert fires when the relay container restarts more than this many times in 15 minutes.
- Required: No
- Type: int
- Default:
3 - MinValue: 1
- MaxValue: 23
Parameter: createNatGateway
Create and associate a NAT Gateway for outbound egress. Ignored with existingSubnetResourceId.
- Required: No
- Type: bool
- Default:
True - MinValue: 1
- MaxValue: 23
Parameter: createNewManagedIdentity
Create a new user-assigned identity (true) or attach an existing one (false).
- Required: No
- Type: bool
- Default:
True - MinValue: 1
- MaxValue: 23
Parameter: defaultRouteNextHopIpAddress
Next-hop IP for a 0.0.0.0/0 route on the relay subnet, for example the hub firewall. Ignored with existingSubnetResourceId.
- Required: No
- Type: string
- Default:
'' - MinValue: 1
- MaxValue: 23
Parameter: dnsServers
Custom DNS servers for the relay VNet. Ignored with existingSubnetResourceId.
- Required: No
- Type: array
- Default:
[] - MinValue: 1
- MaxValue: 23
Parameter: drainTimeoutSeconds
Seconds the drain waits for the queue to empty when a host goes away. The appliance gives a drain command 300 seconds, so keep this below that.
- Required: No
- Type: int
- Default:
240 - MinValue: 10
- MaxValue: 280
Parameter: enableKeyVaultPurgeProtection
Purge protection on the Key Vault. Default true; turn off only for throwaway deployments.
- Required: No
- Type: bool
- Default:
True - MinValue: 10
- MaxValue: 280
Parameter: enableNoDeliveryAlert
Alert when no mail was delivered for an hour inside business hours. Turn it off for a relay that legitimately carries no weekday traffic.
- Required: No
- Type: bool
- Default:
True - MinValue: 10
- MaxValue: 280
Parameter: enableTelemetry
Enable/Disable usage telemetry for module.
- Required: No
- Type: bool
- Default:
True - MinValue: 10
- MaxValue: 280
Parameter: existingSubnetResourceId
Resource ID of an existing, dedicated and empty subnet to place the relay in, instead of creating a VNet. See the container-appliance module for what that subnet must provide.
- Required: No
- Type: string
- Default:
'' - MinValue: 10
- MaxValue: 280
Parameter: graphFailureAlertThreshold
The graph-send-failures alert fires when the relay logs more than this many deferred or rejected Graph sends in 15 minutes.
- Required: No
- Type: int
- Default:
0 - MinValue: 0
- MaxValue: 280
Parameter: hostPrivateIpAddress
Static private IP for the first host. Empty uses the container-appliance default.
- Required: No
- Type: string
- Default:
'' - MinValue: 0
- MaxValue: 280
Parameter: imageReference
The relay container image, <registry>/<repository>@sha256:<digest>. Always pinned by digest: the deployment fails without a 64-character @sha256: digest. The default is the vendor-neutral relay image at the digest built from relay commit 58bf566 (the build publishes the digest as a workflow output).
- Required: No
- Type: string
- Default:
'ghcr.io/innofactororg/smtp-relay@sha256:e63ef9f00fbbc6f5b37c419e5e69a9035c081c91ff76a9d906c3400584e32d14' - MinValue: 0
- MaxValue: 280
Parameter: instanceCount
Number of relay hosts, all active together behind the internal load balancer. Every host takes an address in the subnet.
- Required: No
- Type: int
- Default:
2 - MinValue: 1
- MaxValue: 100
Parameter: itsmWebhookUri
ITSM webhook URI for the action group.
- Required: No
- Type: string
- Default:
'' - MinValue: 1
- MaxValue: 100
Parameter: keyVaultName
Name of the appliance Key Vault. Empty derives it from the name.
- Required: No
- Type: string
- Default:
'' - MinValue: 1
- MaxValue: 100
Parameter: location
Azure region to deploy the resources.
- Required: No
- Type: string
- Default:
'westeurope' - MinValue: 1
- MaxValue: 100
Parameter: lock
A lock to apply to the whole resource group. NOT recommended: it stops Azure Resource Manager grooming deployment history and eventually fails every deployment. Use protectStatefulResources instead.
- Required: No
- Type: object
- MinValue: 1
- MaxValue: 100
Optional parameters
| Parameter | Type | Description |
|---|---|---|
kind | string | The lock kind. |
name | string | Name of the lock. |
notes | string | Notes about this lock. |
Parameter: lock.kind
The lock kind.
- Required: No
- Type: string
- Allowed:
[ 'CanNotDelete' 'None' 'ReadOnly' ] - MinValue: 1
- MaxValue: 100
Parameter: lock.name
Name of the lock.
- Required: No
- Type: string
- MinValue: 1
- MaxValue: 100
Parameter: lock.notes
Notes about this lock.
- Required: No
- Type: string
- MinValue: 1
- MaxValue: 100
Parameter: messageSizeLimitBytes
Largest message the relay accepts, in bytes. Graph rejects a message above its own limit, so keep this at or below it.
- Required: No
- Type: int
- Default:
10240000 - MinValue: 1
- MaxValue: 100
Parameter: name
Short name used to derive every resource name. Lowercase alphanumeric and hyphens, kept short.
- Required: No
- Type: string
- Default:
'smtprelay' - MinValue: 1
- MaxValue: 100
Parameter: protectStatefulResources
CanNotDelete locks on each resource that holds state, instead of on the resource group. See the container-appliance module.
- Required: No
- Type: bool
- Default:
True - MinValue: 1
- MaxValue: 100
Parameter: queuedMailAlertThreshold
The queued-mail alert fires when a host has held more than this many messages for the whole 15-minute window.
- Required: No
- Type: int
- Default:
25 - MinValue: 1
- MaxValue: 100
Parameter: relayHost
Next hop Postfix names as relayhost. Mail is delivered through Graph, so this rarely matters.
- Required: No
- Type: string
- Default:
'smtp.office365.com' - MinValue: 1
- MaxValue: 100
Parameter: relayHostPort
Port of relayHost.
- Required: No
- Type: int
- Default:
587 - MinValue: 1
- MaxValue: 100
Parameter: resourceGroupName
Name of the resource group this module creates. Defaults to name.
- Required: No
- Type: string
- Default:
[parameters('name')] - MinValue: 1
- MaxValue: 100
Parameter: roleAssignments
Additional role assignments to grant on this resource group.
- Required: No
- Type: array
- MinValue: 1
- MaxValue: 100
Required parameters
| Parameter | Type | Description |
|---|---|---|
principalId | string | The principal ID of the user, group, or service principal to assign the role to. |
roleDefinitionIdOrName | string | The role to assign — either a full role definition resource ID, or a bare role definition GUID (resolved against this subscription). |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
principalType | string | The principal type of the assigned principal ID. |
Parameter: roleAssignments.principalId
The principal ID of the user, group, or service principal to assign the role to.
- Required: Yes
- Type: string
- MinValue: 1
- MaxValue: 100
Parameter: roleAssignments.roleDefinitionIdOrName
The role to assign — either a full role definition resource ID, or a bare role definition GUID (resolved against this subscription).
- Required: Yes
- Type: string
- MinValue: 1
- MaxValue: 100
Parameter: roleAssignments.principalType
The principal type of the assigned principal ID.
- Required: No
- Type: string
- Allowed:
[ 'Device' 'ForeignGroup' 'Group' 'ServicePrincipal' 'User' ] - MinValue: 1
- MaxValue: 100
Parameter: scaleSetZones
Availability zones the scale set spreads across, for example [1, 2, 3]. Empty uses availabilityZone alone.
- Required: No
- Type: array
- Default:
[] - MinValue: 1
- MaxValue: 100
Parameter: tags
Tags applied to every resource.
- Required: No
- Type: object
- MinValue: 1
- MaxValue: 100
Parameter: timeZone
Container time zone, for example Europe/Dublin.
- Required: No
- Type: string
- Default:
'UTC' - MinValue: 1
- MaxValue: 100
Parameter: virtualNetworkPeerings
VNet peerings in the AVM shape. A remote side is a write outside the relay resource group. Ignored with existingSubnetResourceId.
- Required: No
- Type: array
- Default:
[] - MinValue: 1
- MaxValue: 100
Parameter: vmSize
VM size. Avoid burstable (B-series) sizes.
- Required: No
- Type: string
- Default:
'Standard_D2as_v5' - MinValue: 1
- MaxValue: 100
Parameter: workspaceResourceId
Resource ID of an existing Log Analytics workspace. Empty creates one in the resource group.
- Required: No
- Type: string
- Default:
'' - MinValue: 1
- MaxValue: 100
Outputs
| Output | Type | Description |
|---|---|---|
actionGroupResourceId | string | Resource ID of the action group the alerts notify. |
applianceAddress | string | Address of the internal load balancer. Point the hub firewall DNAT and the internal relay name here. |
applianceSubnetResourceId | string | Resource ID of the relay subnet. |
keyVaultName | string | Name of the appliance Key Vault. |
keyVaultUri | string | URI of the appliance Key Vault. |
loadBalancerResourceId | string | Resource ID of the internal load balancer. |
manualStepsRequiredForReuse | array | Role assignments the template could not make because an existing identity was reused. Empty for a new identity. |
resourceGroupName | string | Name of the resource group. |
scaleSetResourceId | string | Resource ID of the scale set that holds the relay hosts. |
virtualNetworkResourceId | string | Resource ID of the relay VNet. Empty when an existing subnet was used. |
vmIdentityPrincipalId | string | Principal ID of the identity the hosts run as. |
workspaceResourceId | string | Resource ID of the Log Analytics workspace the alerts read. |
Cross-referenced modules
This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).
| Reference | Type |
|---|---|
br/innofactor:avm/ptn/lz/container-appliance:0.2.1 | Remote reference |
br/public:avm/res/insights/scheduled-query-rule:0.5.1 | Remote reference |
Notes
What this module is, and is not
A Postfix relay on N hosts behind an internal load balancer. Applications and appliances on the internal network send plain SMTP to one address; the relay hands each message to Microsoft Graph (sendMail) over HTTPS, as one mailbox, with an Entra app registration’s client secret. It is the SMTP front of Graph for senders that cannot speak OAuth.
It is a two-layer pattern. container-appliance 0.1.0 (in loadBalanced mode) provides the network, the scale set, the identity, the Key Vault, monitoring and generic alerts, and knows nothing about mail. This module adds what only the relay needs: the compose file rendered from parameters, the relay settings, the Graph secret, the drain command and the payload alerts. No file is edited by hand on a host.
Prerequisites this module does not create
- The sender mailbox (
graphSenderMailbox). Every message leaves from this mailbox, whatever the original sender, so recipients see one address. The original sender is only checked againstsenderAllowList.- It must be a real Exchange Online mailbox: a shared mailbox (no licence needed) or a licensed user. A former licensed user whose licence was removed has no mailbox, and Graph answers
MailboxNotEnabledForRESTAPI. - The relay sends with
saveToSentItems, so a copy of every relayed message accumulates in this mailbox’s Sent Items. Agree a retention policy for it.
- It must be a real Exchange Online mailbox: a shared mailbox (no licence needed) or a licensed user. A former licensed user whose licence was removed has no mailbox, and Graph answers
- An Entra app registration for Graph. It is a Graph object, not an ARM resource. The values go in
graphTenantId,graphClientIdandgraphClientSecret.- Single tenant, no redirect URI, and no public client flows. The relay uses the client credentials flow, which needs neither.
- The
Mail.Sendapplication permission only, with admin consent. A test app that reads back and deletes its message also needsMail.ReadWrite(a Graph delete fails withMail.Read); a production app never does. - Restrict it to the sender mailbox, so a leaked secret cannot send as anyone else. Until this is done,
Mail.Sendreaches every mailbox in the tenant. Existing relays use an Exchange application access policy; Microsoft’s successor is RBAC for Applications in Exchange Online, which needs the same verification.- List the app’s existing policies first (
Get-ApplicationAccessPolicy) and remove stale ones. ARestrictAccesspolicy scoped to a mailbox that was later deleted leaves the app able to reach nothing. New-ApplicationAccessPolicy -AppId <app> -PolicyScopeGroupId <sender-mailbox> -AccessRight RestrictAccess.- Allow about an hour for propagation.
Test-ApplicationAccessPolicyreports Granted at once, but Graph kept answering403 ErrorAccessDeniedfor 62 minutes in the sandbox build. A 403 in that hour is expected; do not change permissions or recreate the policy because of it. - Verify with a client-credentials token, not only with
Test-ApplicationAccessPolicy: a GraphsendMailas the sender mailbox returns 202, and as any other mailbox 403. (An app that also holds a read permission can checkGET /users/<mailbox>/mailFolders/inboxinstead: 200 and 403.) Deploy the relay only after both answers are right.
- The Exchange Online PowerShell device code (
Connect-ExchangeOnline -Device) expires after 15 minutes, so have the Exchange administrator ready before starting.
- List the app’s existing policies first (
- The client secret expires. Put its expiry in a calendar, because the Graph-failures alert is how you would otherwise find out. It goes straight into
graphClientSecret. The module stores it in the appliance Key Vault and writes the host’s runtime env file itself; never put it in a committed file, a ticket or on a workstation.
- A read-only registry token (
registryToken,read:packages) for the private relay image package, issued to a service identity and never to a person. - The hub side, which this module never writes:
- a firewall DNAT rule from the published relay address to the
applianceAddressoutput (the internal load balancer); - hub return routes for the relay subnet in every hub route table that carries the traffic (the GatewaySubnet and any NVA or route-server subnet), through the
hubReturnRouteslist of the workload-networking module (0.4.11 or later). A half-applied set is the classic cause of asymmetric routing: the TCP connect succeeds and the SMTP banner never arrives. - the subnet’s
inboundAllowedCidris the source the firewall forwards from. The module opens port 25 from that CIDR and nothing else.
- a firewall DNAT rule from the published relay address to the
- An egress path for the hosts: the module’s NAT Gateway (default), or your own route through the hub firewall with
defaultRouteNextHopIpAddressorexistingSubnetResourceId. The firewall must allow the Docker and Ubuntu repositories,ghcr.io, Entra and Graph (login.microsoftonline.com,graph.microsoft.com) and Azure Key Vault.
How mail flows and what is protected
myNetworksis Postfixmynetworks, used verbatim. A client outside it cannot relay (454 Relay access denied). List loopback yourself if you need it.senderAllowListis enforced for every client, trusted networks included. A sender that is not on it, and is not the Graph mailbox, is refused at RCPT (554).- A message is queued, then sent through Graph. If Graph refuses temporarily (network, token, 5xx, throttling, 401/403/404/408) Postfix defers and retries until the queue lifetime. Other 4xx answers bounce. A failed send never drops mail.
- The queue is on each host’s OS volume: a
loadBalancedhost has no data disk. It survives a container restart and a recreate, not the loss of the host. On a scale-in, an update or a shutdown the appliance agent first takes the host out of the load balancer pool and waits out the probe (about 20 seconds), so clients are sent to the other hosts, then runs the drain command (docker exec postfix /scripts/drain.sh). The drain stops intake and waits up todrainTimeoutSecondsuntil the host is quiet (queue empty, no Graph send in progress, no client connected), then stops Postfix. If Graph is down the drain times out with mail queued and that mail is lost with the host, so do not scale in while the queued-mail alert is firing. A host that dies without a drain loses its queue (ADR 17, ADR 21). - Patching: the scale set hosts are patched by Azure’s automatic guest patching, in health-gated batches, at all hours. There is no patch window. State this to the people who depend on the relay.
Alerts
All notify the appliance action group (itsmWebhookUri, alertEmailAddresses) and auto-mitigate. They read the container logs in Log Analytics; the phrases they match are the relay image’s contract (ADR 18).
| Alert | Fires when | Severity |
|---|---|---|
| Relay Queue Backlog | a host’s smallest queue depth over 15 minutes is above queuedMailAlertThreshold | 2 |
| Relay Graph Send Failures | more than graphFailureAlertThreshold deferred or rejected Graph sends in 15 minutes | 1 |
| Relay No Deliveries | no delivery for an hour, hosts reporting, weekdays inside businessHoursStartUtc to businessHoursEndUtc (UTC); switch off with enableNoDeliveryAlert | 3 |
| Container Restarting | the relay container restarts more than containerRestartAlertThreshold times in 15 minutes (from the appliance) | 2 |
There is no connection monitor. “Connected” is not “answering”: the e2e probe checks for the SMTP banner and EHLO, not a TCP connect.
The image
imageReference is ghcr.io/innofactororg/smtp-relay by digest; the deployment fails without a digest (ADR 16). The package is private, so the default containerRegistry is keyVaultToken. To bump the image, take the digest from the relay build, change imageReference and redeploy; hosts roll one at a time through the scale set.
Tests
defaults: one host, own VNet. Through the load balancer address a client VM proves that the relay accepts mail from an allowed sender and refuses a sender that is not on the list, then sends a real message to a sandbox mailbox and proves, from the relay log (delivered via graph servicefor that queue ID) and then through Graph, that it reached the Inbox. It then deletes every copy of the test message (Inbox, and Sent Items when the sender mailbox is the recipient), requires 204 for each and proves none remain, so the sandbox mailbox ends each run clean. It needs a sandbox Entra app withMail.SendandMail.ReadWritescoped to a sandbox mailbox, in the CI Key Vault asCI-graphTenantId,CI-graphClientId,CI-graphClientSecretandCI-graphTestMailbox. While any is missing the deployment fails at validation and names the parameter. The test is not skipped and nothing is faked.waf-aligned: two hosts, a subnet the test brings, locks and an alert receiver. The client network is not inmyNetworks; the test proves the relay answers EHLO and still refuses to relay for it.- Both need
CI-ghcrReadTokenfor the private image.
Data Collection
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
Changelog
Changelog
0.2.0
Changes
- Builds on
container-appliance0.2.1 (was 0.1.1). The relay hosts now send their logs to Log Analytics: load-balanced hosts are associated with the data collection rule by policy, which brings the relay’s payload alerts (queue backlog, Graph send failures, no deliveries) and queue depth to life. A scale-in now takes a host out of the load balancer before it drains, so callers no longer see refused connections (ADR 20, ADR 21). - The default relay image is the build of relay commit
58bf566,sha256:e63ef9f00fbbc6f5b37c419e5e69a9035c081c91ff76a9d906c3400584e32d14. Its drain waits until the queue is empty, nothing is being sent and no client is connected, and no longer reads a failed queue check as an empty queue.
Breaking Changes
- Inherited from
container-appliance0.2.0: the identity that deploys the relay now needs to create a policy assignment and role assignments at the relay’s resource group (see thecontainer-appliance0.2.0 changelog).
0.1.1
Changes
- Documentation only; the deployed resources are unchanged. The Graph prerequisites in the README and the
graphSenderMailboxandgraphClientIddescriptions are corrected from a verified sandbox build: the sender must be a real Exchange mailbox (shared or licensed), the app is single tenant with no public client flows andMail.Sendonly, stale access policies are removed first, the access policy takes about an hour to reach Graph (a 403 in that hour is expected), and access is verified with a client-credentials token. Sent Items keeps a copy of every relayed message.
Breaking Changes
- None
0.1.0
Changes
- First release of the module. A managed SMTP relay: Postfix on N hosts behind an internal load balancer, delivering mail through Microsoft Graph, with its own network (or a subnet you bring), Key Vault, monitoring and payload alerts. It renders the compose file from parameters and calls
container-appliance0.1.1 inloadBalancedmode. See the README for parameters and examples. - The relay image is the vendor-neutral
ghcr.io/innofactororg/smtp-relay, pinned by digest. A deployment without a 64-character@sha256:digest fails. The package is private: the defaultcontainerRegistryiskeyVaultTokenwith a read-only token you supply (ADR 16). - The queue is on each host’s OS volume, because a
loadBalancedhost has no data disk. A drain command runs before a host goes away: it stops intake, flushes the queue, waits and stops Postfix (ADR 17). - Payload alerts from the container logs: queue backlog, Graph send failures, and no deliveries in business hours, plus the appliance’s container-restart alert. There is no connection monitor (ADR 18).
- Inbound is port 25 from
inboundAllowedCidronly. The hub side (a firewall DNAT to the load balancer address, and hub return routes through workload-networkinghubReturnRoutes) is a prerequisite the module does not write. - The Graph client secret goes to the appliance Key Vault and reaches the host through an env file. It is never part of the compose file or the deployment history.
- Tests:
defaults(one host, own VNet; SMTP through the load balancer accepts an allowed sender and refuses another, then a real message reaches a sandbox mailbox, proven from the relay log and through Graph) andwaf-aligned(two hosts, a subnet you bring, locks, an untrusted client network that is refused). The real-Graph test reads the CI Key Vault secretsCI-graphTenantId,CI-graphClientId,CI-graphClientSecretandCI-graphTestMailboxand fails at validation, naming the parameter, while one is missing.
Breaking Changes
- None
Version history
| Version | Published |
|---|---|
0.2.0 | 2026-11-24 |
0.1.1 | 2026-11-20 |
0.1.0 | 2026-11-20 |