Hello,
One of the customer of our SaaS environnement doesn't have a domain name and is using gmail addresses.
Emails sent from our application are sometimes considered as spam when received by their customers.
So I'm trying to adapt setup so their tenant will use
smtp.gmail.com whereas other will uses our.
ATM, I'm working on our test instance and I found a blocking issue, which is weird.
From the tenant using
smtp.gmail.com, emails are sent (and received ^^), but when switching to another tenant (using 'our' smtp server), emails are not sent.
In other words, once an email has been sent from a
smtp.gmail.com, it is not possible to send emails from another server.
Steps to reproduce :
- Setup System and Client1 with an 'internal' smtp ; check emails are sent (using EMail Test process, is easy)
- Setup Client2 with an
smtp.gmail.com ; check emails are sent
- Restart the server
- Log into System and execute EMail Test process : is ok
- Log into Client1 and execute EMail Test process : is ok
- Log into Client2 and execute EMail Test process : is ok
- Log into System or Client1 and execute EMail Test process : is ko
- Log into Client2 and execute EMail Test process : is ok
I've added some logs in org.compiere.util.EMail.send() in the catch part (AuthenticationFailedException)
When trying to send an email from System (after an email was sent from Client2):
(ME) - Invalid Username/Password - null
(ClientID=0 - auth=null - isGmail=false - isSecureSmtp=false - host=xxx.yyy.zz:0 - from=
x...@yyy.fr - subject=Expert Light Demo EMail Test)
Seems when sending an email with SMTP authentication and/or ssl/tls should initiate a variable at server level and this variable is never resetted.
Any idea where to look and/or tests to conduct ?
Thanks,
Nicolas