Ssmtp
Version vom 27. August 2023, 10:03 Uhr von Hamatoma (Diskussion | Beiträge)
Links
Nutzung
# 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
# sharutils für uuencode
apt install ssmtp sharutils
Konfiguration
- /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