Smtp relay gmail

Hi group,

I just built my first Mattermost server. I’m trying to configure my SMTP with GMAIL.

I read:* docs.mattermost.com/install/smtp-email-setup

When I try to read server log, but is show Loading… and nothing show

I entrer: smtp-relay.gmail.com
Port: 587
Enable SMTP auth: True
Connection : TLS
I follow: SMTP relay: Route outgoing non-Gmail messages through Google

Message erreur: Connection unsuccessful: Connection unsuccessful: SendMail: Échec de l’ouverture de la connexion TLS, tls: first record does not look like a TLS handshake

Merci

Hi @inno100,

You need to enable Less secure apps in google.


1 Like

Thank for your help,

I forgot to mention that I had already done this step.

So did enabling this feature with Google solve your issue?

No, not working

Merci

Alright, so based on that, and the error related to “Does not appear to be a TLS handshake” makes me think that you may have selected the wrong security method for your SMTP settings.

Would you be able to provide a screenshot (with sensitive information removed if desired, of course) of your SMTP configuration settings?

My Gmail account config

I would suggest changing the SMTP security protocol to STARTLS, changing your server log level to DEBUG and restarting your Mattermost instance, and then see if it works, and if it doesn’t, then we’ll have the most details possible, because you would have changed your logging to DEBUG mode.

Here the msg error when I change for STARTTLS:
How to use debug mode?

Connection unsuccessful: Connection unsuccessful: SendMail: Une erreur s’est produite lors de la définition de l’adresse source, 550 5.7.1 Invalid credentials for relay [51.222.XX.XX]. The IP address you’ve 5.7.1 registered in your G Suite SMTP Relay service doesn’t match domain of 5.7.1 the account this email is being sent from. If you are trying to relay 5.7.1 mail from a domain that isn’t registered under your G Suite account 5.7.1 or has empty envelope-from, you must configure your mail server 5.7.1 either to use SMTP AUTH to identify the sending domain or to present 5.7.1 one of your domain names in the HELO or EHLO command. For more 5.7.1 information, please visit 5.7.1 https://support.google.com/a/answer/6140680#invalidcred g12sm191980oou.25 - gsmtp

Okay so I see several issues, the first one being the IP address of your server. Could you confirm that you configured the G Suite IP address correctly and that you are not using a web firewall such as Cloudflare?

Hi,

I confirm the IP is correct and I don’t use Cloudflare.

Hi,

I found the solution, I need to activated the 2FA and use App password. It’s working.


465
TLS

Merci

2 Likes

I’m glad you got it working!