Last active
August 15, 2024 08:08
-
-
Save jcdarwin/fa9235dd48276f348cc7 to your computer and use it in GitHub Desktop.
How to allow monit to use gmail as a smtp relay to send out alert emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# visit https://accounts.google.com/DisplayUnlockCaptcha and click to allow access | |
# edit /etc/monit/monitrc to include the following | |
set mailserver smtp.gmail.com port 587 | |
username "[email protected]" password "whatever" | |
using tlsv1 | |
with timeout 30 seconds | |
# run the following to validate access | |
/etc/init.d/monit restart | |
monit validate |
I found this solution (aug 2024):
turn on 2fa on gmail acc, go to https://myaccount.google.com/apppasswords and create app password and use it for monit
here is my config:
set mailserver smtp.gmail.com port 587
username "<gmail account name without @gmail.com>" password "<your app pass word>"
using tlsv1
with timeout 30 seconds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, for few days , i've try to correct error in my Monit (V5.27-2) log (error : Mail: SSL connection error: error:141E70BF:SSL routines:tls_construct_client_hello:no protocols available)
When sending alert email to my gmail account. My monit email config is:
set mailserver smtp.gmail.com port 587
username xxxxxxxxxxxx password xxxxxxxxxxx
using tlsv1
with timeout 30 seconds
set alert [email protected]
I've tried with TLS, TLSV1, TLSV12 or TLSV13 without progress.
If someone got idea? Thanks