Open Triloworld opened 6 years ago
It is somehow releated to : https://developers.google.com/gmail/imap/xoauth2-protocol Or maybe use that API: https://developers.google.com/gmail/api/guides/
SMTP is always deemed "less secure" by Google :(
You should be able to use the SMTP Relay Service instead: https://support.google.com/a/answer/2956491
G-suite only works on SSL 465, when TFA is enabled and app password
is generated.
Be sure to confirm all the emails sent to your google inbox.
I have "To use this feature with your **** account, you need to upgrade to Google Workspace." Not everybody can use that type of relay. App password is automatically disabled and not recommended. We need more secure approach I think. I looking for OAuth solution
I installed a self hosted version of rocket.Chat a few months ago, and it was able to sent email after setup the smtp. But suddenly it stops and gives me the following error:
Error: Server terminates connection: 421 4.7.0 Try again later, closing connection. (EHLO) z14sm26858pjc.13
Tried a bunch of setups on rocket.Chat and Gmail sides, but was not able to make it work again.
I installed a self hosted version of rocket.Chat a few months ago, and it was able to sent email after setup the smtp. But suddenly it stops and gives me the following error:
Error: Server terminates connection: 421 4.7.0 Try again later, closing connection. (EHLO) z14sm26858pjc.13
Tried a bunch of setups on rocket.Chat and Gmail sides, but was not able to make it work again.
same issue here. any luck?
After much investigating I finally figured out this issue!
I kept getting this error:
421 4.7.0 Try again later, closing connection. (EHLO) <some identifier> - gsmtp
I ended up stumbling across this post, which lead me to explore the "name" configuration option of nodemailer.
Turns out the issues stems from the meteor package, with how they create the SMTP connection using a url (as opposed to an object, with the proper "name" attribute). https://github.com/meteor/meteor/blob/ffcfa5062cf1bf8a64ea64fef681ffcd99fe7939/packages/email/email.js#L47
And then, in nodemailer it simply parses the url. The resulting object doesn't have a "name" attribute, which is needed to send the proper host name to google for the EHLO to work properly. https://github.com/nodemailer/nodemailer/blob/fed2ebd5dc68094ea843d7a51c1c27527ac25626/lib/nodemailer.js#L33
My quick workaround was to hardcode patch the proper name attribute in the programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/nodemailer.js
file (in the module.exports.createTransport
function) in my container.
options['name'] = 'example.com';
for smtp with TFA gmail has recently extended this blocker to accounts without TFA. So you have to enable less secure apps feature
Reopen : https://github.com/RocketChat/Rocket.Chat/issues/2312 Problem with setting : Less Secure Apps https://support.google.com/a/answer/6260879?hl=en How to configure so we can force Rocket.Chat to be more than less secure apps visible for Gmail.
For GSuite: It need to be enabled for organisation, then by user must be done separately. Before: Work just fine because no forcing of that settings by Google.
Can someone add to documentation some info about that? And of course maybe some example settings for that case ;/
Settings work just fine after I switch "ON" for "Enable less secure apps"
It's working on same settings: PROTOCOL: SMTPS HOST: smtp.gmail.com PORT: 465 IgnoreTLS: NO POOL: YES Login & Password correct. IMAP in account enabled.