AEM Sites workflow email notifications not sent due to SendAsDenied error
This article explains how to resolve an issue where Adobe Experience Manager (AEM) Sites workflow email notifications are not delivered because Microsoft 365 rejects the emails with a SendAsDenied error.
Description description
Environment
- Adobe Experience Manager (AEM) Sites (all versions)
- Microsoft 365 (Exchange Online) as SMTP server with OAuth authentication
Issue/Symptoms
- Workflow email notifications are not received by reviewers.
- AEM author logs contain a SendAsDenied error when attempting to send notification emails.
Cause
Microsoft 365 rejects outbound messages because the configured mail account does not have permission to send emails using the specified sender address (from.address) in the AEM mail configuration.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review the AEM author logs to confirm the presence of the following error:
SMTPSendFailedException: 554 5.2.252 SendAsDenied. -
Identify the configured sender address in the OSGi configuration for
com.day.cq.mailer.DefaultMailService(property:from.address). -
In Microsoft 365 (Exchange Admin Center or Microsoft 365 admin center):
- Grant the configured mail account (used for OAuth authentication) the Send As or Send on Behalf permission for the configured sender address.
- Alternatively, update the
from.addressvalue in the AEM configuration to use a mailbox that the configured mail account is already authorized to send as.
-
After you update the permissions or configuration, restart the workflow in AEM.
-
Verify that reviewers receive email notifications and check the AEM author logs to confirm that
EMailNotificationService.sendNotificationcompletes successfully withoutSMTPSendFailedExceptionerrors.