Zum Inhalt springen

Postfix einrichten

Aus Computech CMS Wiki
Version vom 19. September 2016, 11:41 Uhr von Simon Zeberli (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „==Installieren== sudo apt-get update sudo apt-get install postfix ==Postfix configurieren== <syntaxhighlight lang="bash"> # Open up a sudo session so you d…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Installieren

sudo apt-get update
sudo apt-get install postfix

Postfix configurieren

# Open up a sudo session so you don't have to preface every
# command with 'sudo' - remember to exit when done!
sudo -s

# postconf is a program that can modify the postfix config file /etc/postfix/main.cf
postconf -e 'relayhost = mailserver:587'
postconf -e 'myorigin = mailserver'

postconf -e 'smtp_sasl_auth_enable = yes'
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
postconf -e 'smtp_sasl_security_options ='

# Authentication -- Substitute mailserver, username and password here:
echo "mailserver:587   username:password" > /etc/postfix/sasl_passwd 

# Protect this password file
chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd

# update the sasl_password.db file using the new password file
postmap /etc/postfix/sasl_passwd

# Restart
service postfix restart

# and exit the sudo session
exit