Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung | Vorherige Überarbeitung | ||
|
lpi2:postfix [2017/04/02 19:44] |
lpi2:postfix [2026/03/04 11:20] (aktuell) ingo_wichmann [Testen] |
||
|---|---|---|---|
| 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, Ubuntu, 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 | ||
| + | )) | ||
| + | |||
| + | ===== 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'' und ''mydomain'' gesetzt. Und die Parameter ''mydestination'', ''inet_interfaces'', ''mynetworks'', ''smtpd_recipient_restrictions'', ''smtpd_relay_restrictions'', ''default_transport'' und ''relay_transport'' werden auf ihre 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; | ||
| + | postconf -e 'mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost' | ||
| + | </code> | ||
| + | |||
| + | service postfix restart | ||
| + | |||
| + | |||
| + | |||
| + | ===== Testen ===== | ||
| + | lsof -Pni :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 | ||
| + | |||
| + | |||
| + | ====== Übersichtsbild Postfix Konfiguration ====== | ||
| + | {{ :lpi2:postfix.svg |}} | ||
| + | Original von Michael Nausch: https://dokuwiki.nausch.org/doku.php/centos:mail_c6:mta_3 | ||
| + | |||
| + | ====== Links ====== | ||
| + | * http://www.postfix.org | ||