I am unable to setup the email SMTP via Google domain. I did remove 2FA and enable pop3 and imap in the gmail settings. I also enable the settings for unauthorized app auth in the google admin console.
Everything seems to be working fine, but it doesnt send any emails at all.
Server Setup Information
Rocket.Chat Version: 3.13.2
NodeJS Version: 12.21.0 - x64
MongoDB Version: 3.6.14
MongoDB Engine: wiredTiger
Platform: linux
Process Port: 3000
Site URL: hidden
=ReplicaSet OpLog: Enabled
Commit Hash: 5e9f4bc424
Commit Branch: HEAD
Any additional Information
Logs:
I20210429-15:21:42.127(-4) Updating process.env.MAIL_URL
I20210429-15:21:44.542(-4) The $MAIL_URL is ‘smtp://…:465’. You probably want ‘smtps://’ (The ‘s’ enables TLS/SSL) since ‘465’ is typically a secure port. undefined
Also these are my smtp settings:
Protocol: smtp
Host: smtp.gmail.com
Ignore TLS and pool activated
port: 465
username: the entire email with @
Password: same as gmail
From Email: Not sure, I put admin@csbtech.ca, that section was a bit confusing.
Couldn’t you get around this by setting up an SMTP server inside your network that does outbound TLS to Google? I suppose you could put it in your approved senders list.
@john.crisp I did exactly what you suggested and it does not work.
Protocol: smpts
Host: smtp.google.com
Username: username without @
Password: same as gmail
From email: username and @ to create full email
Ignore TLS: not active (false)
If I select port 587 then I see this in logs
Exception in defer callback: [Error: 140039672534912:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: ] { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ESOCKET', command: 'CONN' }
If I select port 465 with same other settings I see this in logs
Exception in defer callback: Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials q6-20020a05600c46c600b003d1f3e9df3csm10125399wmo.7 - gsmtp at SMTPConnection._formatError (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:784:19) at SMTPConnection._actionAUTHComplete (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34) at SMTPConnection.<anonymous> (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:540:26) at SMTPConnection._processResponse (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:947:20) at SMTPConnection._onData (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:749:14) at TLSSocket.SMTPConnection._onSocketData (/snap/rocketchat-server/1536/programs/server/npm/node_modules/meteor/email/node_modules/nodemailer/lib/smtp-connection/index.js:189:44) at TLSSocket.emit (events.js:400:28) at TLSSocket.emit (domain.js:475:12) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at TLSSocket.Readable.push (internal/streams/readable.js:206:10) at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) at TLSWrap.callbackTrampoline (internal/async_hooks.js:130:17) { code: 'EAUTH', response: '535-5.7.8 Username and Password not accepted. Learn more at<br>' + '535 5.7.8 https://support.google.com/mail/?p=BadCredentials q6-20020a05600c46c600b003d1f3e9df3csm10125399wmo.7 - gsmtp', responseCode: 535, command: 'AUTH PLAIN' }
Hi there! Here to share my success in SMTP setup with google account with 2Fa enabled:
=================================================*
Protocol: smtp
Host: smtp.gmail.com
Port: 587
IgnoreTLS: off
Pool: on
Login: **********@gmail.com (your google email) Password: **** **** **** **** (here paste password for app)
EmaiL: **********@gmail.com (same as login)
*=================================================
To obtain pass for app go to google account management - Security - 2-Step Verification - App passwords
Hi all. 8/21/2024 and I’m successfully using a secure (smtps) variation of Vladislav’s solution above. To reiterate, you need to enable 2FA on the Google account in order to create an app password for the RocketChat mailer, which you’ll use as the password, below:
Protocol: smtps
Host: smtp.gmail.com
Port: 465
IgnoreTLS: off (forced off by choice of smtps protocol)
Pool: off
Username: Username@GoogleWorkspaceDomain.com (your google email address)
Password: **** **** **** **** (Google App password)
From Email: (same as Username)