diff --git a/linux/README.md b/linux/README.md index b426269..80f41c1 100644 --- a/linux/README.md +++ b/linux/README.md @@ -8,4 +8,6 @@ [Bash Scripting](linux-bash-scripting.md) +[Sendmail](linux-sendmail.md) + [VIM](linux-vim.md) \ No newline at end of file diff --git a/linux/linux-sendmail.md b/linux/linux-sendmail.md new file mode 100755 index 0000000..fac6528 --- /dev/null +++ b/linux/linux-sendmail.md @@ -0,0 +1,41 @@ +--- +gitea: none +include_toc: true +--- +# Sendmail + +``` +apt install sendmail +``` + +## config + + - change first line of `/etc/hosts` to:\ + `127.0.0.1 localhost.localdomain localhost backup`\ + ("backup" is the hostname. Get it with: $ hostname + - config\ `sudo sendmailconfig # answer "Y" to everything` + +## custom "from: " address + +in order to have a custom "from: " email address (instead of `user@localhost.localdomain`) do the following: + + - create file `/etc/mail/genericstable` + - add following content: + ``` + user notifications@docuteam.ch + root notifications@docuteam.ch + ``` + - create `genericstable.db`\ + `makemap hash /etc/mail/genericstable < /etc/mail/genericstable` + - modify `/etc/mail/sendmail.mc`\ + add following lines right before `MAILER_DEFINITIONS`:\ + ``` + FEATURE(`genericstable')dnl` + GENERICS_DOMAIN(`localhost.localdomain')dnl + ```` + - macro erstellen\ + `m4 sendmail.mc > sendmail.cf` + - restart sendmail service\ + `systemctl restart sendmail.service` + - test mail\ + `echo "Subject: sendmail test 1" | sendmail -v r.rutishauser@docuteam.ch` \ No newline at end of file