Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Configure email service for smtp server without authentication

Avatar

Community Advisor

Hi there, 

We currently have the com.day.cq.mailer.DefaultMailService configured to use gmail smtp service, works fine. 

 

But now we are switching to another smtp server where no authentication is needed, the dedicated egress ip is whitelisted on smtp side so everything should be enabled to properly handle incoming requests from AEM to port 25.

 

question then is, for the port forwards rule, is it enough to change the current working port forward config:

 

"portForwards": [{
"name": "smtp.gmail.com",
"portDest": 465,
"portOrig": 30002
}]

to 

"portForwards": [{
"name": "ip.address.goes.here",
"portDest": 25,
"portOrig": 30002
}]

note that no domain name is used, only ip

 

 

and the working mail service is currently configured like this:

 

{
    "smtp.host": "$[env:AEM_PROXY_HOST;default=proxy.tunnel]",
    "smtp.port": "30002",
    "smtp.user": "$[env:EMAIL_USERNAME;default=emailapikey]",
    "smtp.password": "$[secret:EMAIL_PASSWORD]",
    "from.address": "sender@example.com",
    "smtp.ssl": true,
    "smtp.starttls": false,
    "smtp.requiretls": true,
    "debug.email": false,
    "oauth.flow": false
}
 
is it enough to only keep this as below or how would it be configured properly?
 
{
    "smtp.host": "$[env:AEM_PROXY_HOST;default=proxy.tunnel]",
    "smtp.port": "30002",
    "from.address": "sender@example.com",
    "smtp.ssl": true,
    "smtp.starttls": false,
    "smtp.requiretls": true,
    "debug.email": false,
    "oauth.flow": false
}
 
been trying back and forth with different configurations and with the configurations above we keep getting this error:
 
com.day.cq.mailer.MailingException: org.apache.commons.mail.EmailException: Sending the email to the following server failed : proxy.tunnel:30002
1 Accepted Solution

Avatar

Correct answer by
Level 2

As an immediate WA, please hardcode the proxy value (don't use variable) and log a support case mentioning #SKYOPS-21877 to aid expedite the AEM engineer analysis - thanks.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

As an immediate WA, please hardcode the proxy value (don't use variable) and log a support case mentioning #SKYOPS-21877 to aid expedite the AEM engineer analysis - thanks.

Avatar

Level 4

I think this is feasible . Not able to recall fully but we had configured SMTP configuration without password . But actually it doesn't means we are skipping authentication. In our case SMTP team did few settings at their end and whitelisted few IP's (might be adobe server IP) to make it workable .

Avatar

Community Advisor

@Sebastiane_Edberg_ @GucciPaull @Anoop_Garg Do you people remember whats the exact fix for it? we also got a requirement to configure SMTP for AEM without username and password...