Ssmtp
Zur Navigation springen
Zur Suche springen
Links[Bearbeiten]
Nutzung[Bearbeiten]
# sendmail und ssmtp sind gleichwertig
FROM=myaddress@gmx.de
TO=test@hamatoma.de
echo -e 'Subject: test\n\nTesting ssmtp' | sendmail -v $TO
sudo ssmtp -v -t <<EOS
To:$TO
From:$FROM
Subject: Test
This is a test mail.
EOS
# Anhang:
EMAIL_FILE=/tmp/email.txt
DATA_FILE=/tmp/data.zip
INTERNAL_NAME=mydata.zip
cat >$EMAIL_FILE <<EOS
To:$TO
From:$FROM
Subject: Test
This is a test mail.
EOS
zip -9 $DATA_FILE /etc/hosts
uuencode $DATA_FILE $INTERNAL_NAME >/tmp/appendix
cat $EMAIL_FILE /tmp/appendix >/tmp/both.data
cat /tmp/both.data | sudo sendmail -v -t
Installation[Bearbeiten]
# sharutils für uuencode
apt install ssmtp sharutils
Konfiguration[Bearbeiten]
- /etc/ssmtp/ssmtp.conf
root=myaddress@gmx.de mailhub=mail.gmx.net:587 rewriteDomain=gmx.net hostname=gmx.net FromLineOverride=YES AuthUser=youraddress@gmx.de AuthPass=SehrGeheim UseSTARTTLS=YES TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
- /etc/ssmtp/revaliases
root:youraddress@gmx.de:smtp.gmx.net:587 jonny:youraddress@gmx.de:smtp.gmx.net:587