Configure email service for smtp server without authentication | Community
Skip to main content
Sebastiane_Edberg_
Community Advisor
Community Advisor
May 11, 2022
Solved

Configure email service for smtp server without authentication

  • May 11, 2022
  • 3 replies
  • 2947 views

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
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gucci-Paull-108

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.

3 replies

Gucci-Paull-108Adobe EmployeeAccepted solution
Adobe Employee
May 12, 2022

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.

Level 4
May 12, 2022

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 .

Shashi_Mulugu
Community Advisor
Community Advisor
January 8, 2024

@sebastiane_edberg_ @gucci-paull-108 @an1-3 Do you people remember whats the exact fix for it? we also got a requirement to configure SMTP for AEM without username and password...