Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
linux:service:ssmtp [03/11/2018 15:03]
thierry [Installation]
linux:service:ssmtp [05/05/2019 14:29] (Version actuelle)
thierry [rewriteDomain]
Ligne 2: Ligne 2:
 ===== Installation ===== ===== Installation =====
 <code bash> <code bash>
-sudo apt install ssmtp+sudo apt install ssmtp mailutils
 </​code>​ </​code>​
 +(Note: mailutils installe la commane [[linux:​commandes:​mail|mail]])
  
 +On devrait obtenir ceci:
 <code bash> <code bash>
-thierry@binova-srv:~$ whereis sendmail+user@server:~$ whereis sendmail
 sendmail: /​usr/​sbin/​sendmail /​usr/​lib/​sendmail /​usr/​share/​man/​man8/​sendmail.8.gz sendmail: /​usr/​sbin/​sendmail /​usr/​lib/​sendmail /​usr/​share/​man/​man8/​sendmail.8.gz
-thierry@binova-srv:~$ ls -la /​usr/​sbin/​sendmail+user@server:~$ ls -la /​usr/​sbin/​sendmail
 lrwxrwxrwx 1 root root 5 avril  3  2018 /​usr/​sbin/​sendmail -> ssmtp lrwxrwxrwx 1 root root 5 avril  3  2018 /​usr/​sbin/​sendmail -> ssmtp
 </​code>​ </​code>​
Ligne 18: Ligne 20:
 # The person who gets all mail for userids < 1000 # The person who gets all mail for userids < 1000
 # Make this empty to disable rewriting. # Make this empty to disable rewriting.
-root=servers@linformatic.fr +root=toto@mondomaine.fr 
-AuthUser=servers@linformatic.fr +AuthUser=toto@mondomaine.fr 
-AuthPass=xxXXxxXX+AuthPass=xxXXxxxXXX
  
 # The place where the mail goes. The actual machine name is required no # The place where the mail goes. The actual machine name is required no
Ligne 28: Ligne 30:
  
 # Where will the mail seem to come from? # Where will the mail seem to come from?
-#rewriteDomain=+rewriteDomain=mondomaine.fr
  
 # The full hostname # The full hostname
-hostname=binova-srv@binova.lan+hostname=user@server
  
 # Are users allowed to set their own From: address? # Are users allowed to set their own From: address?
 # YES - Allow the user to specify their own From: address # YES - Allow the user to specify their own From: address
 # NO - Use the system generated From: address # NO - Use the system generated From: address
-#FromLineOverride=YES+FromLineOverride=YES
 </​file>​ </​file>​
 +==== 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 ===== ===== Tests =====
 +Avec [[linux:​commandes:​mail]]
 +
 +Envoyer un mail a <<​thierry@testix.fr>>​
 +<code bash>
 +thierry@binovx-srv:​~$ mail thierry@testix.fr
 +Cc:
 +Subject: Test
 +Bonjour ceci est un test !
 +</​code>​
 +Envoyer le mail avec ''​ctl+D''​
 ===== Sources ===== ===== Sources =====
   * [[http://​tombuntu.com/​index.php/​2008/​10/​21/​sending-email-from-your-system-with-ssmtp/​]]   * [[http://​tombuntu.com/​index.php/​2008/​10/​21/​sending-email-from-your-system-with-ssmtp/​]]