Bonjour,
J’essaie de faire en sorte que fail2ban m’envoie des alertes par mail. Seulement, mes tests d’envoi de mail ne passent pas.
La commande
echo -e "Subject: Title\nMessage" | sudo ssmtp -vvv monadressemail@gmail.com
me retourne
[<-] 220 smtp.gmail.com ESMTP k4sm15900957wmk.26 - gsmtp
[->] EHLO raspberrypi
[<-] 250 SMTPUTF8
[->] STARTTLS
[<-] 220 2.0.0 Ready to start TLS
[->] EHLO raspberrypi
[<-] 250 SMTPUTF8
[->] AUTH LOGIN
[<-] 334 VXNlcm5hbWU6
[->] amVlZG9tX2ZhaWwyYmFuQGdtYWlsLmNvbQ==
[<-] 334 UGFzc3dvcmQ6
[<-] 535 5.7.8 https://support.google.com/mail/?p=BadCredentials k4sm15900957wmk.26 - gsmtp
ssmtp: Authorization failed (535 5.7.8 https://support.google.com/mail/?p=BadCredentials k4sm15900957wmk.26 - gsmtp)
Voici la configuration du fichier ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=monadressemail@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
# Where will the mail seem to come from?
rewriteDomain=gmail.com
# The full hostname
hostname=raspberrypi
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=YES
FromLineOverridce=YES
AuthUser=monadressemail@gmail.com
AuthPass=monmotdepasse
Et voici la configuration du fichier revaliases
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:monadressemail@gmail.com:smtp.gmail.com:587
pi:monadressemail@gmail.com:smtp.gmail.com:587
Avez-vous une idée de ce qui peut bloquer ?
Merci.