Ceci est une ancienne révision du document !
SSMTP
Installation
sudo apt install ssmtp mailutils
(Note: mailutils installe la commane mail)
thierry@binova-srv:~$ whereis sendmail sendmail: /usr/sbin/sendmail /usr/lib/sendmail /usr/share/man/man8/sendmail.8.gz thierry@binova-srv:~$ ls -la /usr/sbin/sendmail lrwxrwxrwx 1 root root 5 avril 3 2018 /usr/sbin/sendmail -> ssmtp
Configuration
- /etc/ssmtp/ssmtp.conf
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=servers@linformatic.fr AuthUser=servers@linformatic.fr AuthPass=xxXXxxxXXX # 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=ssl0.ovh.net:465 UseTLS=YES # Where will the mail seem to come from? rewriteDomain=linformatic.fr # The full hostname hostname=binova-srv@binova.lan # 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
rewriteDomain
Lorsque l'on ecrit un mail, ssmtp l'envois avec le nom de l'utilisateur + hostname
Soit thierry@binova-srv@binova.lan … et ça plante !
Si on active le rewriteDomain=linformatic.fr
l'utilisateur utilisé pour l'envois deviens utilisateur + rewriteDomain = thierry@linformatic.fr
Tests
Avec mail
Envoyer un mail a «thierry@testix.fr»
thierry@binovx-srv:~$ mail thierry@testix.fr Cc: Subject: Test test encore
Envoyer le mail avec ctl+D
Sources
Vous pourriez laisser un commentaire si vous étiez connecté.