Email Prefix
For AWS accounts created under the organization, each account requires a unique Email address. For this purpose, we can use a catchall email with a specific prefix aws-accounts-
. We can define a shared mailbox with distribution list (group) to forward any email that comes with this prefix. Below are a few examples;
Anything that comes to these emails can be forwarded to [email protected]
or desired shared mailbox address.
Create Shared Mailbox
- In Office365 or Google Mail
- Create a Distribution list (Microsoft 365) / Group (Google Workspace)
[email protected]
. - Add necessary members.
- Create shared mailbox
[email protected]
. - In forwarding setting in shared mailbox, forward incoming mails to
[email protected]
.
Configure Catchall Prefix in Microsoft 365
- Visit office admin center
- Go to exchange admin center
- Navigate to Mail flow → Accepted domains
- UI configuration
- Select the target domain
- Choose Internal relay and click Save
- PowerShell configuration (Optional)
- Open PowerShell
- Execute Set-ExecutionPolicy RemoteSigned
- Execute Install-Module -Name ExchangeOnlineManagement
- Execute Import-Module -Name ExchangeOnlineManagement
- Execute Connect-ExchangeOnline
- Execute Set-AcceptedDomain -Identity acme.xyz -DomainType InternalRelay
- UI configuration
- Navigate to Mail flow → Rules
- Click on Add a rule and Create new rule
- Creating rule
- Create rule conditions
- Name → Catch all AWS accounts
- Apply this rule if → The recipient → address matches any of these text patterns | "aws-accounts-"
- Do the following → redirect message to → these recipients | "[email protected]"
- Click Next
- Create rule settings
- Check Rule mode to Enforce
- Click Next
- Click Finish
- Create rule conditions
- In Rules dashboard click on newly created rule and Enable it.
Reference: Manage accepted domains in Exchange Online