IT-Wissen/linux/linux-sendmail.md
2024-10-16 22:12:45 +02:00

1.1 KiB
Executable File

Table of Contents

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