Toto je starší verze dokumentu!
SSMTP
Aby se mnou server mohl komunikovat, bude rozumné vyřešit posílání e-mailů. Určitě nemá smysl kvůli pár e-mailům instalovat službu jako je postfix či jiné. Jednoduše nakonfiguruji systém tak, aby mi posílal poštu z freemailové schránky přes protokol SMTP. K tomu slouží utili SSMTP.
sudo apt install ssmtp cd /etc/ssmtp
Ve složce jsou nyní 2 soubory. Nejprve soubor revaliases. Dle konfigurace přesměrovávám poštu od uživatelů systému na freemail Google.
# 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:petr.nosek@gmail.com:smtp.gmail.com:587 user:petr.nosek@gmail.com:smtp.gmail.com:587
Pak je tu soubor ssmtp.conf, ve kterém jsou autentizační údaje.
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=petr.nosek@janekdo.cz # 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 AuthUser=petr.nosek@gmail.com AuthPass=prisnetajneheslo UseTLS=YES UseSTARTTLS=YES # Where will the mail seem to come from? #rewriteDomain= # The full hostname hostname=bananapir2 # 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