Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
lpi2:postfix [2022/09/21 20:01] ingo_wichmann [Postfix] |
lpi2:postfix [2022/12/21 14:52] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Minimal-Konfiguration ====== | ||
- | Vorraussetzung für Mail ist eine korrekte [[ dns| client- ]] und [[ bind | serverseitige ]] DNS Konfiguration, inkl. ''hostname -f'' | ||
- | ===== Benötigte Pakete ===== | ||
- | SuSE, Debian, RedHat: | ||
- | postfix | ||
- | |||
- | ==== Debian ==== | ||
- | exim Konfigurationsdateien direkt bei der Installation von Postfix entfernen: | ||
- | |||
- | apt --purge install postfix | ||
- | |||
- | ((exim Konfigurationsdateien nach der Installation von Postfix entfernen: | ||
- | dpkg-query -W -f='${Package}\n' | grep exim | xargs dpkg --purge | ||
- | )) | ||
- | ==== SuSE ==== | ||
- | SuSE hat seine eigenen Vorstellungen, wie man Postfix konfiguriert. Wenn man die Konfiguration aber nicht ''yast'' überlassen möchte, muß man die Datei ''/etc/sysconfig/mail'' anpassen: | ||
- | <file> | ||
- | MAIL_CREATE_CONFIG="no" | ||
- | </file> | ||
- | |||
- | ==== RedHat ==== | ||
- | Für RedHat wird auch das Paket ''system-switch-mail'' empfohlen | ||
- | |||
- | ===== Konfiguration ===== | ||
- | Der Großteil der Konfiguration spielt sich in den Dateien ''/etc/postfix/main.cf'' und ''/etc/postfix/master.cf'' ab. Die Datei ''/etc/postfix/main.cf'' kann man mit einem Editor oder über den Befehl ''postconf'' bearbeiten. | ||
- | |||
- | |||
- | |||
- | ==== Postfix ==== | ||
- | In der Folge werden sinnvolle Werte für ''myhostname'', ''mydomain'' und ''mynetworks'' gesetzt. Und die Parameter ''mydestination'', ''inet_interfaces'', ''smtpd_recipient_restrictions'' ((vor Postfix Version 2.10)), ''smtpd_relay_restrictions'' ((ab Postfix Version 2.10)), ''default_transport'' und ''relay_transport'' werden auf die default-Werte gesetzt: | ||
- | <code bash> | ||
- | |||
- | postconf -e "myhostname = $(hostname -f)" | ||
- | postconf -e "mydomain = $(hostname -d)" | ||
- | |||
- | for PARAMETER in mydestination inet_interfaces mynetworks smtpd_recipient_restrictions smtpd_relay_restrictions default_transport relay_transport; | ||
- | do | ||
- | postconf -# $PARAMETER; | ||
- | done; | ||
- | </code> | ||
- | |||
- | service postfix restart | ||
- | |||
- | |||
- | |||
- | ===== Testen ===== | ||
- | lsof -i :25 | ||
- | |||
- | netcat -v localhost 25 | ||
- | HELO localhost | ||
- | MAIL FROM: root@localhost | ||
- | RCPT TO: nutzer15@localhost | ||
- | DATA | ||
- | From: root@localhost | ||
- | To: nutzer15@localhost | ||
- | Subject: testmail | ||
- | | ||
- | Dies ist eine Testmail | ||
- | . | ||
- | quit | ||
- | |||
- | ====== Links ====== | ||
- | * http://www.postfix.org |