AEM as a Cloud Service: SMTP email delivery fails because of incorrect Advanced Networking or proxy configuration
Workflow email notifications in AEM as a Cloud Service can fail when the mail service uses an incorrect SMTP host or port configuration with Advanced Networking. Review the flexible port egress setup, update the Day CQ Mail Service configuration to use the correct proxy host and forwarded port, and verify that email notifications send successfully.
Description description
Environment
Adobe Experience Manager as a Cloud Service (all versions)
Issue/Symptoms
Workflow email notifications from the AEM Author environment do not send. The logs may show an error like this:
[ author instance] *ERROR* [ EMailNotificationService-Processor] com.day.cq.workflow.impl.email.EMailNotificationService error while sending email: org.apache.commons.mail.EmailException: Sending the email to the following server failed: <smtp-server>:<forwarded-proxy-port>
- AEM workflow email notifications do not arrive.
- The SMTP connection uses an incorrect or mismatched forwarded port and fails.
- Common SMTP ports include 587 for STARTTLS and 465 for SSL, depending on the provider.
- This issue can occur in environments that use Advanced Networking with flexible port egress.
Resolution resolution
To solve this issue, try the following steps:
-
Check the Advanced Networking or flexible port egress configuration in Cloud Manager or through the Advanced Networking API. Confirm that the environment includes a port forward mapping for SMTP traffic. Example mapping
- Host:
<smtp-host> - Destination port: 587
- Forwarded proxy port:
<forwarded-proxy-port> - Non-proxy hosts: none
See Advanced networking.
- Host:
-
Update the
com.day.cq.mailer.DefaultMailServiceconfiguration so the mail service uses the configured proxy host and the forwarded proxy port for SMTP traffic. Example configuration- smtp.host:
<configured-proxy-host> - smtp.port:
<forwarded-proxy-port> - from.address: no-reply@example.com
- smtp.user: $
[secret:<mail-service-user>] - smtp.password: $
[secret:<mail-service-password>] - smtp.starttls: true
- smtp.ssl: false
- smtp.requiretls: true
Do not point
smtp.hostdirectly to the external SMTP server. Setsmtp.portto the internal forwarded proxy port that matches the Advanced Networking configuration. - smtp.host:
-
Test email delivery. Start a workflow that sends an email notification, confirm that the email arrives, and check the AEM error logs for new errors.