====== SSMTP ====== ===== Installation ===== sudo apt install ssmtp mailutils (Note: mailutils installe la commane [[linux:commandes:mail|mail]]) On devrait obtenir ceci: user@server:~$ whereis sendmail sendmail: /usr/sbin/sendmail /usr/lib/sendmail /usr/share/man/man8/sendmail.8.gz user@server:~$ ls -la /usr/sbin/sendmail lrwxrwxrwx 1 root root 5 avril 3 2018 /usr/sbin/sendmail -> ssmtp ===== Configuration ===== # # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=toto@mondomaine.fr AuthUser=toto@mondomaine.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=mondomaine.fr # The full hostname hostname=user@server # 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 current_user@user@server ... et ça plante ! Si on active le ''rewriteDomain=mondomaine.fr'' l'utilisateur utilisé pour l'envois deviens utilisateur + rewriteDomain = current_user@mondomaine.fr ===== Tests ===== Avec [[linux:commandes:mail]] Envoyer un mail a <> thierry@binovx-srv:~$ mail thierry@testix.fr Cc: Subject: Test Bonjour ceci est un test ! Envoyer le mail avec ''ctl+D'' ===== Sources ===== * [[http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/]]