Page 1 of 1

SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 10:00
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).

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 10:46
by Florian
Hallo,

please explain the problem more in detail. What excatly was configured on the server.

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 10:58
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...

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 11:05
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.

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 11:32
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

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 11:51
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).

Re: SMTP External for Email Notification

Posted: Wed 1. Sep 2021, 12:14
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.