SMTP External for Email Notification

Locked
User avatar
latifolia
Posts: 42
Joined: Wed 18. Aug 2021, 09:08

SMTP External for Email Notification

Post by latifolia »

Hello,

I tried to configure Email Notifications from server to registered users via external SMTP (gmail smtp) but always failed with error :

Failed to connect to SMTP server

Why is that ? gmail smtp at : smtp.gmail.com port 587 with username and password generated-app via gmail security console. The same settings works on my other server (not keyhelp server).
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

Re: SMTP External for Email Notification

Post by Florian »

Hallo,

please explain the problem more in detail. What excatly was configured on the server.
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
Alexander
Keyweb AG
Posts: 3814
Joined: Wed 20. Jan 2016, 02:23

Re: SMTP External for Email Notification

Post by Alexander »

Have you enabled "Less Secure App" in your Google Account management and wait at least 1 hour?
Google have a strict policy regarding such requests and flagging them as "insecure" - not that their preferred method would be more secure at all...
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
latifolia
Posts: 42
Joined: Wed 18. Aug 2021, 09:08

Re: SMTP External for Email Notification

Post by latifolia »

Hello, I try to configure Email Notifications as in attached images. Yes, Less Secure apps is active more than a year ago and still activly used in different postfix mail server (not keyhelp). We try to move into KeyHelp from that mail server.
Attachments
B.png
A.png
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

Re: SMTP External for Email Notification

Post by Florian »

Hallo,

if you use Port 587 you must choose STARTTLS and not SSL/TLS

Also test via telnet if your server can reach the Google mail server:

Code: Select all

telnet smtp.gmail.com 587
Trying 2a00:1450:4013:c04::6c...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP n15sm10806206edw.70 - gsmtp
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
latifolia
Posts: 42
Joined: Wed 18. Aug 2021, 09:08

Re: SMTP External for Email Notification

Post by latifolia »

Florian wrote: Wed 1. Sep 2021, 11:32 Hallo,

if you use Port 587 you must choose STARTTLS and not SSL/TLS

Also test via telnet if your server can reach the Google mail server:

Code: Select all

telnet smtp.gmail.com 587
Trying 2a00:1450:4013:c04::6c...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP n15sm10806206edw.70 - gsmtp
Tried multiple times with STARTTLS or SSL/TLS.. both of them always Failed.

Here attached successfull Telnet to Gmail SMTP firectly from KeyHelp shell console (via SSH).
Attachments
C.png
C.png (8.99 KiB) Viewed 2111 times
User avatar
Alexander
Keyweb AG
Posts: 3814
Joined: Wed 20. Jan 2016, 02:23

Re: SMTP External for Email Notification

Post by Alexander »

They may have turned off support for all new apps, which try to connect to their services, no matter if "less secure apps" is already enabled.

I will try to implement XOAUTH2 (their preferred method) for using Googles SMTP services at some point in the future.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Locked