% master: verwendung.tex % Verwendung von E-Mail v0.1 % 2025-02-15 (Rx) \section{Verwendung von E-Mail} %---------------------------- \index{mail} \begin{verbatim} sudo apt install mailutils postfix installiert mailx und MTA-Postfix sudo dpkg-reconfigure postfix postfix nochmal konfigurieren sudo apt install postfix-pcre dovecot-imapd für den Mail-Server installieren echo "Inhalt" | mailx -s "Betreff" user@Domain E-Mail verschicken E-Mail beim Starten verschicken /lib/systemd/system/mailx-start.service [Unit] Description=Boot Mails After=postfix.service [Service] Type=simple ExecStart=/usr/bin/sh -c 'echo "Inhalt" | mailx -s "Betreff" user@domain' [Install] WantedBy=multi-user.target E-Mail beim Beenden verschicken (kommt erst beim Booten an) /lib/systemd/system/mailx-stop.service [Unit] Description=Boot Mails After=shutdown.target [Service] Type=simple ExecStart=/usr/bin/sh -c 'echo "Inhalt" | mailx -s "StopBetreff" user@domain' [Install] WantedBy=multi-user.target danach sudo systemctl enable mailx-start.service sudo systemctl enable mailx-stop.service \end{verbatim}