Debian Postfix Smarthost mit Authentifierung

Aus Bennys Wiki
Wechseln zu: Navigation, Suche

Benötigte Libaries installieren

apt-get install libsasl2-modules postfix
vim /etc/postfix/main.cf
#SMTP Auth with sasl authentication
# the host where all mail should be sent
relayhost = mail.mailserver.hasi
# switch on sasl authentication
smtp_sasl_auth_enable = yes
# mailserver, username and password will be read from /etc/postfix/smtp_auth
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
# do not try anonymous authentication
smtp_sasl_security_options = noanonymous
# first we try with plain authentication then wie check if login is available
smtp_sasl_mechanism_filter = plain, login

Nun erstellen befüllen wir unsere Passwort Datei

vim /etc/postfix/smtp_auth
mail.mailserver.hasi username@mailserver:passwort

Jetzt in Postfix lesbares Format umwandeln und Postfix neustarten

postmap /etc/postfix/smtp_auth
/etc/init.d/postfix restart