RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.17k stars 10.38k forks source link

Google Suite blocking Rocket.Chat sending emails #11846

Open Triloworld opened 6 years ago

Triloworld commented 6 years ago

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.

Triloworld commented 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/

vynmera commented 6 years ago

SMTP is always deemed "less secure" by Google :(

slhck commented 5 years ago

You should be able to use the SMTP Relay Service instead: https://support.google.com/a/answer/2956491

florisvangeel commented 3 years ago

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.

Triloworld commented 3 years ago

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

rvbatista commented 3 years ago

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.

sakreto commented 3 years ago

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?

daxxog commented 3 years ago

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';
florisvangeel commented 2 years ago

for smtp with TFA gmail has recently extended this blocker to accounts without TFA. So you have to enable less secure apps feature

Headstore commented 2 years ago

for smtp with TFA gmail has recently extended this blocker to accounts without TFA. So you have to enable less secure apps feature

They stopped the support for "less secure apps" as of May 30. What now? Is anyone successfully using gmail to send emails?