linux  system

smtp sendmail

Kleine Mailbibliotheke um einfach im Linux mails zu versenden

Installation

sudo apt install msmtp msmtp-mta mailutils

Default-Konfiguration

sudo nano /etc/msmtprc
# Set default values for all following accounts.
defaults

# Mail account
account heister.email
port 465
tls on
tls_starttls off
auth on
host mail.heister.email
from noreply@heister.email
user noreply@heister.email
password ♯crypt♯

# Map local users to mail addresses (for crontab)
aliases /etc/aliases

# Set a default account
account default: heister.email

# By default, the --from option overrides the from command. Set to ‘off’ to disable this.
allow_from_override off

Aliases

sudo nano /etc/aliases
postmaster: postmaster@heister.email
default: default@heister.email

Berechtigungen

sudo chown root:adm /etc/msmtprc
sudo chmod 660 /etc/msmtprc

Troubleshooting debian & manjaro

sudo usermod -aG adm mani

Mail testen

echo "this is a test" | mail -s "was betreff" test@heister.email
#-M text/html
echo "<b>this</b> <mark>is</mark> a <i>test</i>" | mail -s "was betreff" -M text/html test@heister.email