Skip to main content

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;

aws-accounts-acme-sandbox@acme.xyz
aws-accounts-acme-projectx-stg@acme.xyz
aws-accounts-acme-projectx-prod@acme.xyz

Anything that comes to these emails can be forwarded to devops@acme.xyz or desired shared mailbox address.

Create Shared Mailbox

  1. In Office365 or Google Mail
  2. Create a Distribution list (Microsoft 365) / Group (Google Workspace) dist_devops@acme.xyz.
  3. Add necessary members.
  4. Create shared mailbox devops@acme.xyz.
  5. In forwarding setting in shared mailbox, forward incoming mails to dist_devops@acme.xyz.

Configure Catchall Prefix in Microsoft 365​

  1. Visit office admin center
  2. Go to exchange admin center
  3. Navigate to Mail flow → Accepted domains
    1. UI configuration
      1. Select the target domain
      2. Choose Internal relay and click Save
    2. PowerShell configuration (Optional)
      1. Open PowerShell
      2. Execute Set-ExecutionPolicy RemoteSigned
      3. Execute Install-Module -Name ExchangeOnlineManagement
      4. Execute Import-Module -Name ExchangeOnlineManagement
      5. Execute Connect-ExchangeOnline
      6. Execute Set-AcceptedDomain -Identity acme.xyz -DomainType InternalRelay
  4. Navigate to Mail flow → Rules
  5. Click on Add a rule and Create new rule
  6. Creating rule
    1. Create rule conditions
      1. Name → Catch all AWS accounts
      2. Apply this rule if → The recipient → address matches any of these text patterns | "aws-accounts-"
      3. Do the following → redirect message to → these recipients | "aws-accounts@acme.xyz"
      4. Click Next
    2. Create rule settings
      1. Check Rule mode to Enforce
      2. Click Next
    3. Click Finish
  7. In Rules dashboard click on newly created rule and Enable it.

Reference: Manage accepted domains in Exchange Online