[https://decatec.de/home-server/linux-einfach-e-mails-senden-mit-ssmtp/ https://decatec.de/home-server/linux-einfach-e-mails-senden-mit-ssmtp/]
===... erfolgreich getestet (Ubuntu unter Hyper-V, noch außerhalb Docker)===
sudo nano /etc/ssmtp/ssmtp.conf
<pre>
#<br /> # Config file for sSMTP sendmail
#<br /> # The person who gets all mail for userids < 1000<br /> # Make this empty to disable rewriting.<br /> root=info@civilcommons.eu<br /><br /> # The place where the mail goes. The actual machine name is required no<br /> # MX records are consulted. Commonly mailhosts are named mail.domain.com<br /> mailhub=smtp.office365.com:587<br /><br /> # Where will the mail seem to come from?<br /> rewriteDomain=civilcommons.eu<br /><br /> # The full hostname<br /> #hostname=info@civilcommons.eu<br /> hostname=192.168.137.40<br /><br /> # Are users allowed to set their own From: address?<br /> # YES - Allow the user to specify their own From: address<br /> # NO - Use the system generated From: address<br /> FromLineOverride=YES<br /><br /> AuthUser=info@civilcommons.eu<br /> AuthPass=********<br /> UseTLS=YES <br /> UseSTARTTLS=YES
</pre>
sudo <span class="crayon-v">nano</span> <span class="crayon-o">/</span><span class="crayon-v">etc</span><span class="crayon-o">/</span><span class="crayon-v">ssmtp</span><span class="crayon-o">/</span><span class="crayon-v">revaliases</span>
<span class="crayon-v"><pre></span>
# sSMTP aliases<br /> #<br /> # Format: local_account:outgoing_address:mailhub<br /> #<br /> # Example: root:your_login@your.domain:mailhub.your.domain[:port]<br /> # where [:port] is an optional port number that defaults to 25.<br /> root:info@civilcommons.eu:smtp.office365.com:587<br /> ccom:info@civilcommons.eu:smtp.office365.com:587
</pre>
<span class="crayon-v">echo -n 'Subject: test\n\nTesting ssmtp' | sendmail -v sfrenzel@kybeidos.de</span>
<pre>
ccom@lk19_proxy:~$ <br />[<-] 220 DB7PR04CA0019.outlook.office365.com Microsoft ESMTP MAIL Service ready at Sun, 24 Mar 2019 19:35:17 +0000<br />[->] EHLO 192.168.137.40<br />[<-] 250 SMTPUTF8<br />[->] STARTTLS<br />[<-] 220 2.0.0 SMTP server ready<br />[->] EHLO 192.168.137.40<br />[<-] 250 SMTPUTF8<br />[->] AUTH LOGIN<br />[<-] 334 VXNlcm5hbWU6<br />[->] aW5mb0BjaXZpbGNvbW1vbnMuZXU=<br />[<-] 334 UGFzc3dvcmQ6<br />[<-] 235 2.7.0 Authentication successful<br />[->] MAIL FROM:<info@civilcommons.eu><br />[<-] 250 2.1.0 Sender OK<br />[->] RCPT TO:<sfrenzel@kybeidos.de><br />[<-] 250 2.1.5 Recipient OK<br />[->] DATA<br />[<-] 354 Start mail input; end with <CRLF>.<CRLF><br />[->] Received: by 192.168.137.40 (sSMTP sendmail emulation); Sun, 24 Mar 2019 19:35:18 +0000<br />[->] From: "Civil Commons" <info@civilcommons.eu><br />[->] Date: Sun, 24 Mar 2019 19:35:18 +0000<br />[->]<br />[->] .<br />[<-] 250 2.0.0 OK <DB6PR07MB34805AC3E5BCE181980C278BCD5D0@DB6PR07MB3480.eurprd07.prod.outlook.com> [Hostname=DB6PR07MB3480.eurprd07.prod.outlook.com]<br />[->] QUIT<br />[<-] 221 2.0.0 Service closing transmission channel
</pre>