This commit is contained in:
Roger Rutishauser 2024-10-16 22:11:32 +02:00
parent 3ee7bc74b4
commit 421cad3e3c
2 changed files with 43 additions and 0 deletions

View File

@ -8,4 +8,6 @@
[Bash Scripting](linux-bash-scripting.md)
[Sendmail](linux-sendmail.md)
[VIM](linux-vim.md)

41
linux/linux-sendmail.md Executable file
View File

@ -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`