|
|
(35 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) |
Zeile 1: |
Zeile 1: |
| == Einführung ==
| |
| Postfix hat mehrere hundert Konfigurationsparameter, die über die Datei [https://www.postfix.org/postconf.5.html main.cf] gesteuert werden.
| |
| * Glücklicherweise haben alle Parameter sinnvolle Standardwerte.
| |
| * In vielen Fällen müssen Sie nur zwei oder drei Parameter konfigurieren, bevor Sie mit dem Mailsystem spielen können.
| |
| * Hier eine kurze Einführung in die Syntax: * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#syntax Postfix-Konfigurationsdateien]
| |
|
| |
| Der folgende Text geht davon aus, dass Sie Postfix bereits auf Ihrem System installiert haben, entweder indem Sie den Quellcode selbst kompiliert haben (wie in der Datei [https://www.postfix.org/INSTALL.html INSTALL] beschrieben) oder indem Sie eine bereits kompilierte Version installiert haben.
| |
|
| |
| Dieses Dokument behandelt die grundlegende Konfiguration von Postfix.
| |
| * Informationen zur Konfiguration von Postfix für bestimmte Anwendungen wie Mailhub, Firewall oder Einwahlclient finden Sie in der Datei [https://www.postfix.org/STANDARD_CONFIGURATION_README.html STANDARD_CONFIGURATION_README].
| |
| * Gehen Sie aber erst dorthin, wenn Sie sich mit dem unten dargestellten Material vertraut gemacht haben.
| |
|
| |
| Die ersten Parameter, die von Interesse sind, geben die Identität und die Rolle des Rechners im Netzwerk an. * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#myorigin Welcher Domänenname soll im Postausgang verwendet werden?]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#mydestination Welche Domänen für den Postempfang ]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_from Von welchen Clients soll die Post weitergeleitet werden?]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_to An welche Ziele soll die Post weitergeleitet werden?]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#relayhost Welche Zustellmethode: direkt oder indirekt ]
| |
|
| |
| Die Standardwerte für viele andere Konfigurationsparameter werden von diesen abgeleitet.
| |
|
| |
| Der nächste interessante Parameter steuert die Menge der an den lokalen Postmaster gesendeten Post: * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#notify Welche Probleme sollen dem Postmaster gemeldet werden ]
| |
|
| |
| Vergewissern Sie sich, dass Sie die folgenden Einstellungen korrekt vornehmen, wenn Sie hinter einem Proxy oder Netzwerkadressenübersetzer sitzen und einen Backup-MX-Host für eine andere Domäne betreiben: * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#proxy_interfaces Proxy/NAT externe Netzwerkadressen ]
| |
|
| |
| Postfix-Daemon-Prozesse laufen im Hintergrund und protokollieren Probleme und normale Aktivitäten an den Syslog-Daemon.
| |
| * Hier sind ein paar Dinge, die Sie beachten müssen: * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#syslog_howto Was Sie über die Postfix-Protokollierung wissen müssen ]
| |
|
| |
| Wenn Ihr Rechner ungewöhnliche Sicherheitsanforderungen hat, sollten Sie Postfix-Daemon-Prozesse in einer Chroot-Umgebung ausführen. * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#chroot_setup Postfix-Daemon-Prozesse in einer chroot-Umgebung laufen lassen ]
| |
|
| |
| Wenn Sie Postfix auf einer virtuellen Netzwerkschnittstelle ausführen oder wenn Ihr Rechner andere Mailer auf virtuellen Schnittstellen betreibt, müssen Sie auch die anderen hier aufgeführten Parameter beachten: * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#myhostname Mein eigener Hostname ]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#mydomain Mein eigener Domainname ]
| |
| * [https://www.postfix.org/BASIC_CONFIGURATION_README.html#inet_interfaces Meine eigenen Netzwerkadressen ]
| |
|
| |
| == Grundkonfiguration ==
| |
| Nach der Installation folgt die Grundkonfiguration
| |
| * Standardwerte übernehmen, bei Fragen, die hier nicht angesprochen werden
| |
|
| |
| === Typ der Konfiguration / Einsatzszenario === | | === Typ der Konfiguration / Einsatzszenario === |
| {| class="wikitable sortable" | | {| class="wikitable sortable" |
Zeile 41: |
Zeile 4: |
| ! Typ !! Beschreibung | | ! Typ !! Beschreibung |
| |- | | |- |
| | [[Postfix:Keine Konfiguration|Keine Konfiguration]] || Aktuelle Konfiguration unverändert lassen | | | [[Postfix/Keine Konfiguration|Keine Konfiguration]] || Aktuelle Konfiguration unverändert lassen |
| |- | | |- |
| | [[Postfix:Internet Site|Internet Site]] || Mail wird empfangen und verschickt (Standard). | | | [[Postfix/Internet Site|Internet Site]] || Mail wird empfangen und verschickt (Standard) |
| * Echter Mailserver mit fester IP-Adresse, z.B. | | * Echter Mailserver mit fester IP-Adresse, beispielsweise Root-Server, E-Mails werden direkt via SMTP versandt und empfangen |
| * Root-Server, E-Mails werden direkt via SMTP versandt und empfangen.
| |
| |- | | |- |
| | [[Postfix:Smarthost|Smarthost]] || Wie Internet Site, aber Mail wird nicht direkt an den entfernten Server zugestellt, sondern über einen anderen Server (etwa beim ISP) geleitet. | | | [[Postfix/Smarthost|Smarthost]] || Wie Internet Site, aber Mail wird nicht direkt an den entfernten Server zugestellt, sondern über einen anderen Server (etwa beim ISP) geleitet |
| * Mailserver mit dynamischer IP-Adresse, die sonst sehr oft als potentielle Spam- oder Virenversender blockiert werden. | | * Mailserver mit dynamischer IP-Adresse, die sonst als potenzielle Spam- oder Virenversender blockiert werden |
| * E-Mails werden direkt mittels SMTP oder über ein Hilfsprogramm wie [[Fetchmail]] empfangen. | | * E-Mails werden direkt mittels SMTP oder über ein Hilfsprogramm wie [[Fetchmail]] empfangen |
| * Ausgehende E-Mails werden über einen Smarthost versandt- | | * Ausgehende E-Mails werden über einen Smarthost versandt |
| |- | | |- |
| | [[Postfix:Satellite System|Satellite System]] || Keine Mail wird empfangen, alle ausgehende Mail über einen Smarthost (s.o.) verschickt. | | | [[Postfix/Satellite System|Satellite System]] || Keine Mail wird empfangen, alle ausgehende Mail über einen Smarthost (s.o.) verschickt |
| * Mail durch Admin-Skripte oder Webapplikationen verschicken lassen. | | * Mail durch Admin-Skripte oder Webapplikationen verschicken lassen |
| * Alle E-Mails werden zur Zustellung einer anderen Maschine, genannt »Smarthost«, übergeben. | | * Alle E-Mails werden zur Zustellung einer anderen Maschine, genannt ''Smarthost'', übergeben |
| |- | | |- |
| | [[Postfix:Local only|Local only]] || Mail wird lokal auf dem Rechner zugestellt, es wird keine Mail von außen empfangen bzw. | | | [[Postfix/Lokaler Mailserver|Lokaler Mailserver]] || Mail wird lokal auf dem Rechner zugestellt, es wird keine Mail von außen empfangen bzw. nach außen geschickt |
| * nach außen geschickt.
| | * Wie ''Satellite System'', aber die Mail soll direkt auf demselben System gelesen werden |
| * Wie ''Satellite System'', aber die Mail soll direkt auf demselben System gelesen werden. | | * Es werden nur E-Mails für lokale Benutzer zugestellt |
| * Es werden nur E-Mails für lokale Benutzer zugestellt. | |
| * Ohne Netzwerkzugang. | | * Ohne Netzwerkzugang. |
| |} | | |} |
|
| |
| === Grundkonfiguration wiederholen ===
| |
| # '''dpkg-reconfigure postfix'''
| |
|
| |
|
| === Wohin soll die Mail für root gehen? === | | === Wohin soll die Mail für root gehen? === |
Zeile 73: |
Zeile 31: |
| * In den meisten Fällen sollte man einfach den Hostnamen als Mailnamen akzeptieren, außer man ist im Besitz eines geeigneteren Domain-Namens. | | * In den meisten Fällen sollte man einfach den Hostnamen als Mailnamen akzeptieren, außer man ist im Besitz eines geeigneteren Domain-Namens. |
|
| |
|
| === SMTP relay host? === | | === SMTP relay host === |
| * Mailserver des Anbieters z.B. | | * Mailserver des Anbieters beispielsweise ''smtp.mailanbieter.de'' |
| ** ''smtp.mailanbieter.de''
| |
|
| |
|
| === Für welche weiteren Rechner möchten Sie Mails akzeptieren? === | | === Für welche weiteren Rechner möchten Sie Mails akzeptieren? === |
Zeile 87: |
Zeile 44: |
| 127.0.0.0/8, 192.168.1.0/24 | | 127.0.0.0/8, 192.168.1.0/24 |
|
| |
|
| Wer seinen Server, bspw. | | Wer seinen Server, bspw. einen Root-Server, über das Internet nutzen will, sollte hier auf keinen Fall weite Adressbereiche erlauben, sondern für den Versand stattdessen eine [[Postfix/Authentifizierung]] verlangen. |
| * einen Root-Server, über das Internet nutzen will, sollte hier auf keinen Fall weite Adressbereiche erlauben, sondern für den Versand stattdessen eine [[Postfix:Authentifizierung]] verlangen.
| |
|
| |
|
| '''Hinweis''' | | '''Hinweis''' |
Zeile 96: |
Zeile 52: |
| Danach ist die erste Konfiguration von Postfix abgeschlossen und wird in der Datei '''/etc/postfix/main.cf''' hinterlegt. | | Danach ist die erste Konfiguration von Postfix abgeschlossen und wird in der Datei '''/etc/postfix/main.cf''' hinterlegt. |
|
| |
|
| === Postfix-Konfigurationsdateien === | | === Grundkonfiguration wiederholen === |
| Standardmäßig befinden sich die Postfix-Konfigurationsdateien in /etc/postfix.
| | # '''dpkg-reconfigure postfix''' |
| * Die beiden wichtigsten Dateien sind [https://www.postfix.org/postconf.5.html main.cf] und [https://www.postfix.org/master.5.html master.cf]<nowiki>; diese Dateien müssen root gehören.
| |
| * Wenn Sie jemandem Schreibrechte für </nowiki>[https://www.postfix.org/postconf.5.html main.cf] oder [https://www.postfix.org/master.5.html master.cf] (oder für die übergeordneten Verzeichnisse) geben, bedeutet das, dass Sie dieser Person root-Rechte geben.
| |
| | |
| In /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf] müssen Sie eine minimale Anzahl von Konfigurationsparametern einrichten.
| |
| * Postfix-Konfigurationsparameter ähneln Shell-Variablen, mit zwei wichtigen Unterschieden: Der erste ist, dass Postfix keine Anführungszeichen kennt, wie die UNIX-Shell.
| |
| | |
| Sie geben einen Konfigurationsparameter wie folgt an:
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| parameter = wert
| |
| | |
| und Sie verwenden ihn, indem Sie ein "$"-Zeichen vor seinen Namen setzen:
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| anderer_parameter = $parameter
| |
| | |
| Sie können $parameter verwenden, bevor ihm ein Wert zugewiesen wird (das ist der zweite wesentliche Unterschied zu UNIX-Shell-Variablen).
| |
| * Die Postfix-Konfigurationssprache verwendet eine "lazy evaluation", d.h. sie prüft einen Parameterwert erst, wenn er zur Laufzeit benötigt wird.
| |
| | |
| Postfix verwendet Datenbankdateien für die Zugriffskontrolle, das Umschreiben von Adressen und andere Zwecke.
| |
| * Die Datei [https://www.postfix.org/DATABASE_README.html DATABASE_README] gibt eine Einführung, wie Postfix mit Berkeley DB, LDAP oder SQL und anderen Typen arbeitet.
| |
| * Hier ist ein allgemeines Beispiel dafür, wie Postfix eine Datenbank aufruft:
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#virtual_alias_maps virtual_alias_maps] = [https://www.postfix.org/DATABASE_README.html#types hash]:/etc/postfix/virtual
| |
| | |
| Immer wenn Sie eine Änderung an der Datei [https://www.postfix.org/postconf.5.html main.cf] oder [https://www.postfix.org/master.5.html master.cf] vornehmen, führen Sie den folgenden Befehl als root aus, um ein laufendes Mailsystem zu aktualisieren:
| |
| | |
| <nowiki># postfix reload</nowiki>
| |
| | |
| === What domain name to use in outbound mail ===
| |
| The [https://www.postfix.org/postconf.5.html#myorigin myorigin] parameter specifies the domain that appears in mail that is posted on this machine.
| |
| * The default is to use the local machine name, $[https://www.postfix.org/postconf.5.html#myhostname myhostname], which defaults to the name of the machine.
| |
| * Unless you are running a really small site, you probably want to change that into $[https://www.postfix.org/postconf.5.html#mydomain mydomain], which defaults to the parent domain of the machine name.
| |
| | |
| For the sake of consistency between sender and recipient addresses, [https://www.postfix.org/postconf.5.html#myorigin myorigin] also specifies the domain name that is appended to an unqualified recipient address.
| |
| | |
| Examples (specify only one of the following):
| |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]: | |
| [https://www.postfix.org/postconf.5.html#myorigin myorigin] = $[https://www.postfix.org/postconf.5.html#myhostname myhostname] (default: send mail as "user@$[https://www.postfix.org/postconf.5.html#myhostname myhostname]")
| |
| [https://www.postfix.org/postconf.5.html#myorigin myorigin] = $[https://www.postfix.org/postconf.5.html#mydomain mydomain] (probably desirable: "user@$[https://www.postfix.org/postconf.5.html#mydomain mydomain]")
| |
| | |
| === Welche Domänen für den Empfang von E-Mails ===
| |
| Der Parameter [https://www.postfix.org/postconf.5.html#mydestination mydestination] gibt an, welche Domänen dieser Rechner lokal zustellen soll, anstatt sie an einen anderen Rechner weiterzuleiten.
| |
| * Die Standardeinstellung ist der Empfang von E-Mails für den Rechner selbst.
| |
| * In der Datei [https://www.postfix.org/VIRTUAL_README.html VIRTUAL_README] finden Sie Hinweise zur Konfiguration von Postfix für [https://www.postfix.org/VIRTUAL_README.html#canonical hosted domains].
| |
| | |
| Sie können null oder mehr Domainnamen, "/file/name"-Muster und/oder "[https://www.postfix.org/DATABASE_README.html type:table]"-Lookup-Tabellen (wie [https://www.postfix.org/DATABASE_README.html#types hash]:, [https://www.postfix.org/DATABASE_README.html#types btree]:, nis:, [https://www.postfix.org/ldap_table.5.html ldap]: oder [https://www.postfix.org/mysql_table.5.html mysql]:) angeben, getrennt durch Leerzeichen und/oder Kommas.
| |
| * Ein "/file/name"-Muster wird durch seinen Inhalt ersetzt; "[https://www.postfix.org/DATABASE_README.html type:table]" verlangt, dass eine Tabellensuche durchgeführt wird, und prüft lediglich, ob eine Tabelle vorhanden ist: Das Suchergebnis wird ignoriert.
| |
| | |
| WICHTIG: Wenn Ihr Rechner ein Mailserver für seine gesamte Domäne ist, müssen Sie auch $[https://www.postfix.org/postconf.5.html#mydomain mydomain] angeben.
| |
| | |
| Beispiel 1: Standardeinstellung.
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mydestination mydestination] = $[https://www.postfix.org/postconf.5.html#myhostname myhostname] localhost.$[https://www.postfix.org/postconf.5.html#mydomain mydomain] localhost
| |
| | |
| Beispiel 2: Domänenweiter Mailserver.
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mydestination mydestination] = $[https://www.postfix.org/postconf.5.html#myhostname myhostname] localhost.$[https://www.postfix.org/postconf.5.html#mydomain mydomain] localhost $[https://www.postfix.org/postconf.5.html#mydomain mydomain]
| |
| | |
| Beispiel 3: Host mit mehreren DNS-A-Einträgen.
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mydestination mydestination] = $[https://www.postfix.org/postconf.5.html#myhostname myhostname] localhost.$[https://www.postfix.org/postconf.5.html#mydomain mydomain] localhost
| |
| www.$[https://www.postfix.org/postconf.5.html#mydomain mydomain] ftp.$[https://www.postfix.org/postconf.5.html#mydomain mydomain]
| |
| | |
| Achtung: Um Mail-Zustellschleifen zu vermeiden, müssen Sie alle Hostnamen des Rechners auflisten, einschließlich $[https://www.postfix.org/postconf.5.html#myhostname myhostname] und localhost.$[https://www.postfix.org/postconf.5.html#mydomain mydomain].
| |
| | |
| === Von welchen Clients soll Post weitergeleitet werden ===
| |
| Standardmäßig leitet Postfix Mails von Clients in autorisierten Netzwerkblöcken an beliebige Ziele weiter.
| |
| * Autorisierte Netzwerke werden mit dem Konfigurationsparameter [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] definiert.
| |
| * Die aktuelle Voreinstellung ist, dass nur der lokale Rechner autorisiert wird.
| |
| * Vor Postfix 3.0 wurden standardmäßig alle Clients in den IP-Subnetzen autorisiert, an die der lokale Rechner angeschlossen ist.
| |
| | |
| Postfix kann auch so konfiguriert werden, dass es Mails von "mobilen" Clients weiterleitet, die Mails von außerhalb eines autorisierten Netzwerkblocks senden.
| |
| * Dies wird in den Dokumenten [https://www.postfix.org/SASL_README.html SASL_README] und [https://www.postfix.org/TLS_README.html TLS_README] erläutert.
| |
| | |
| WICHTIG: Wenn Ihr Rechner an ein Weitverkehrsnetz angeschlossen ist, kann die Einstellung "[https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = subnet" zu freundlich sein.
| |
| | |
| Beispiele (geben Sie nur eine der folgenden Möglichkeiten an):
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = subnet (nicht sicher in einem Weitverkehrsnetz)
| |
| [https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = host (nur lokale Rechner zulassen)
| |
| [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] = 127.0.0.0/8 (nur lokalen Rechner zulassen)
| |
| [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] = 127.0.0.0/8 168.100.189.2/32 (Autorisierung des lokalen Rechners)
| |
| [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] = 127.0.0.0/8 168.100.189.2/28 (lokale Netzwerke zulassen)
| |
| | |
| Sie können die vertrauenswürdigen Netzwerke in der Datei [https://www.postfix.org/postconf.5.html main.cf] angeben oder Postfix die Arbeit abnehmen lassen.
| |
| * Die Standardeinstellung ist, Postfix die Arbeit machen zu lassen.
| |
| * Das Ergebnis hängt vom Wert des Parameters [https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] ab. * Geben Sie "[https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = host" an (die Vorgabe, wenn [https://www.postfix.org/postconf.5.html#compatibility_level compatibility_level] ≥ 2), wenn Postfix nur Mails von dem lokalen Rechner weiterleiten soll.
| |
| * Geben Sie "[https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = subnet" an (Standard, wenn [https://www.postfix.org/postconf.5.html#compatibility_level compatibility_level] < 2), wenn Postfix Mails von SMTP-Clients weiterleiten soll, die sich in denselben IP-Subnetzen befinden wie der lokale Rechner.
| |
| * Unter Linux funktioniert dies nur mit Schnittstellen, die mit den Befehlen "ifconfig" oder "ip" angegeben wurden.
| |
| * Geben Sie "[https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] = class" an, wenn Postfix Mails von SMTP-Clients weiterleiten soll, die sich in denselben IP-Klasse-A/B/C-Netzen befinden wie der lokale Rechner.
| |
| * Tun Sie dies nicht bei einer Einwahlseite - es würde Postfix dazu veranlassen, dem gesamten Netzwerk Ihres Providers zu "vertrauen".
| |
| * Geben Sie stattdessen eine explizite [https://www.postfix.org/postconf.5.html#mynetworks mynetworks]-Liste von Hand an, wie unten beschrieben.
| |
| | |
| Alternativ können Sie auch die Liste [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] von Hand angeben, wobei Postfix die Einstellung [https://www.postfix.org/postconf.5.html#mynetworks_style mynetworks_style] ignoriert.
| |
| * Um die Liste der vertrauenswürdigen Netzwerke von Hand anzugeben, geben Sie Netzwerkblöcke in CIDR-Notation (Netzwerk/Maske) an, zum Beispiel
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mynetworks mynetworks] = 168.100.189.0/28, 127.0.0.0/8
| |
| | |
| Sie können auch den absoluten Pfadnamen einer Musterdatei angeben, anstatt die Muster in der Datei [https://www.postfix.org/postconf.5.html main.cf] aufzulisten.
| |
| | |
| === An welche Ziele soll Post weitergeleitet werden ===
| |
| Standardmäßig leitet Postfix Mails von Unbekannten (Clients außerhalb autorisierter Netzwerke) nur an autorisierte Remote-Ziele weiter.
| |
| * Autorisierte entfernte Ziele werden mit dem Konfigurationsparameter [https://www.postfix.org/postconf.5.html#relay_domains relay_domains] definiert.
| |
| * Standardmäßig werden alle Domänen (und Subdomänen) der Domänen zugelassen, die mit dem Parameter [https://www.postfix.org/postconf.5.html#mydestination mydestination] aufgeführt sind.
| |
| | |
| Beispiele (geben Sie nur eine der folgenden Möglichkeiten an):
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#relay_domains relay_domains] = $[https://www.postfix.org/postconf.5.html#mydestination mydestination] (Standard)
| |
| [https://www.postfix.org/postconf.5.html#relay_domains relay_domains] = (sicher: niemals Mails von Fremden weiterleiten)
| |
| [https://www.postfix.org/postconf.5.html#relay_domains relay_domains] = $[https://www.postfix.org/postconf.5.html#mydomain mydomain] (leitet Mails an meine Domain und Subdomains weiter)
| |
| | |
| === What delivery method: direct or indirect ===
| |
| By default, Postfix tries to deliver mail directly to the Internet.
| |
| * Depending on your local conditions this may not be possible or desirable.
| |
| * For example, your system may be turned off outside office hours, it may be behind a firewall, or it may be connected via a provider who does not allow direct mail to the Internet.
| |
| * In those cases you need to configure Postfix to deliver mail indirectly via a [https://www.postfix.org/postconf.5.html#relayhost relay host].
| |
| | |
| Examples (specify only one of the following):
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#relayhost relayhost] = (default: direct delivery to Internet)
| |
| [https://www.postfix.org/postconf.5.html#relayhost relayhost] = $[https://www.postfix.org/postconf.5.html#mydomain mydomain] (deliver via local mailhub)
| |
| [https://www.postfix.org/postconf.5.html#relayhost relayhost] = [mail.$[https://www.postfix.org/postconf.5.html#mydomain mydomain]] (deliver via local mailhub)
| |
| [https://www.postfix.org/postconf.5.html#relayhost relayhost] = [mail.isp.tld] (deliver via provider mailhub)
| |
| | |
| The form enclosed with <tt>[]</tt> eliminates DNS MX lookups.
| |
| * Don't worry if you don't know what that means.
| |
| * Vergewissern Sie sich nur, dass Sie den <tt>[]</tt> um den Mailhub-Hostnamen herum angeben, den Ihnen Ihr ISP mitgeteilt hat, sonst kann die E-Mail falsch zugestellt werden.
| |
| | |
| Die Datei [https://www.postfix.org/STANDARD_CONFIGURATION_README.html STANDARD_CONFIGURATION_README] enthält weitere Hinweise und Tipps für Firewalls und/oder Einwahlnetze.
| |
| | |
| === Welche Probleme dem Postmaster zu melden sind ===
| |
| Sie sollten in der Tabelle [https://www.postfix.org/aliases.5.html aliases(5)] einen Postmaster-Alias einrichten, der die Post an einen Menschen weiterleitet.
| |
| * Die Postmaster-Adresse muss vorhanden sein, damit die Leute Probleme bei der Postzustellung melden können.
| |
| * Während Sie die Tabelle [https://www.postfix.org/aliases.5.html aliases(5)] aktualisieren, stellen Sie sicher, dass Sie auch die Post für den Super-User an einen Menschen weiterleiten.
| |
| | |
| /etc/aliases:
| |
| postmaster: Sie
| |
| root: Sie
| |
| | |
| Führen Sie den Befehl "newaliases" aus, nachdem Sie die Datei aliases geändert haben.
| |
| * Anstelle von /etc/aliases kann sich Ihre Alias-Datei auch an anderer Stelle befinden.
| |
| * Verwenden Sie den Befehl "postconf [https://www.postfix.org/postconf.5.html#alias_maps alias_maps]", um das herauszufinden.
| |
| | |
| Das Postfix-System meldet Probleme an den postmaster alias.
| |
| * Da Sie vielleicht nicht an allen Arten von Fehlermeldungen interessiert sind, ist dieser Meldemechanismus konfigurierbar.
| |
| * In der Voreinstellung werden nur schwerwiegende Probleme (Ressourcen, Software) an postmaster gemeldet:
| |
| | |
| Standardeinstellung:
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#notify_classes notify_classes] = resource, software
| |
| | |
| Die Bedeutung der Klassen ist wie folgt:
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">bounce </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of undeliverable mail.
| |
| * Either send the postmaster a copy of undeliverable mail that is returned to the sender, or send a transcript of the SMTP session when Postfix rejected mail.
| |
| * For privacy reasons, the postmaster copy of undeliverable mail is truncated after the original message headers.
| |
| * This implies "2bounce" (see below).
| |
| * See also the [https://www.postfix.org/postconf.5.html#luser_relay luser_relay] feature.
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#bounce_notice_recipient bounce_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">2bounce </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">When Postfix is unable to return undeliverable mail to the sender, send it to the postmaster instead (without truncating the message after the primary headers).
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#2bounce_notice_recipient 2bounce_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">delay </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of delayed mail.
| |
| * In this case, the postmaster receives message headers only.
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#delay_notice_recipient delay_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">policy </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of client requests that were rejected because of (UCE) policy restrictions.
| |
| * The postmaster receives a transcript of the SMTP session.
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#error_notice_recipient error_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">protocol </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of protocol errors (client or server side) or attempts by a client to execute unimplemented commands.
| |
| * The postmaster receives a transcript of the SMTP session.
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#error_notice_recipient error_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">resource </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of mail not delivered due to resource problems (for example, queue file write errors).
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#error_notice_recipient error_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">software </div>
| |
| | |
| <div style="margin-left:1cm;margin-right:0cm;">Inform the postmaster of mail not delivered due to software problems.
| |
| * The notification is sent to the address specified with the [https://www.postfix.org/postconf.5.html#error_notice_recipient error_notice_recipient] configuration parameter (default: postmaster). </div>
| |
| | |
| === Externe Proxy-/NAT-Netzwerkadressen ===
| |
| Einige Mailserver sind über einen Network Address Translator (NAT) oder Proxy mit dem Internet verbunden.
| |
| * Das bedeutet, dass die Systeme im Internet eine Verbindung zur Adresse des NAT oder Proxy herstellen, anstatt sich mit der Netzwerkadresse des Mailservers zu verbinden.
| |
| * Der NAT oder Proxy leitet die Verbindung an die Netzwerkadresse des Mailservers weiter, die Postfix jedoch nicht kennt.
| |
| | |
| Wenn Sie einen Postfix-Server hinter einem Proxy oder NAT betreiben, müssen Sie den Parameter [https://www.postfix.org/postconf.5.html#proxy_interfaces proxy_interfaces] konfigurieren und alle externen Proxy- oder NAT-Adressen angeben, über die Postfix E-Mails empfängt.
| |
| * Anstelle von Netzwerkadressen können Sie auch symbolische Hostnamen angeben.
| |
| | |
| WICHTIG: Sie müssen die externen Proxy-/NAT-Adressen angeben, wenn Ihr System als Backup-MX-Host für andere Domänen fungiert, da es sonst zu Schleifen bei der Mailzustellung kommt, wenn der primäre MX-Host ausfällt.
| |
| | |
| Beispiel: Ein Host hinter einer NAT-Box, der als Backup-MX-Host fungiert.
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#proxy_interfaces proxy_interfaces] = 1.2.3.4 (die externe Netzwerkadresse des Proxy/NAT)
| |
| | |
| === Was Sie über die Postfix-Protokollierung wissen müssen ===
| |
| Postfix-Daemonprozesse laufen im Hintergrund und protokollieren Probleme und normale Aktivitäten an den syslog-Daemon.
| |
| * Der syslogd-Prozess sortiert die Ereignisse nach Klasse und Schweregrad und hängt sie an die Logdateien an.
| |
| * Die Protokollierungsklassen, -ebenen und -dateinamen werden normalerweise in /etc/syslog.conf festgelegt.
| |
| * Zumindest brauchen Sie etwas wie:
| |
| | |
| /etc/syslog.conf:
| |
| mail.err /dev/console
| |
| mail.debug /var/log/maillog
| |
| | |
| Nachdem Sie die Datei syslog.conf geändert haben, senden Sie ein "HUP"-Signal an den syslogd-Prozess.
| |
| | |
| WICHTIG: Viele syslogd-Implementierungen erstellen keine Dateien.
| |
| * Sie müssen Dateien erstellen, bevor Sie syslogd (erneut) starten.
| |
| | |
| WICHTIG: unter Linux müssen Sie ein "-"-Zeichen vor den Pfadnamen setzen, z.B. -/var/log/maillog, da sonst der syslogd-Prozess mehr Systemressourcen als Postfix verwendet.
| |
| | |
| Hoffentlich wird die Anzahl der Probleme gering sein, aber es ist eine gute Idee, den Check jede Nacht durchzuführen, bevor die Syslog-Dateien rotiert werden:
| |
| | |
| <nowiki># postfix check</nowiki>
| |
| <nowiki># egrep '(reject|warning|error|fatal|panic):' /some/log/file</nowiki>* Die erste Zeile (postfix check) veranlasst Postfix, Unstimmigkeiten bei den Dateiberechtigungen und -besitzern zu melden.
| |
| * Die zweite Zeile sucht nach Problemberichten von der Mailsoftware und meldet, wie effektiv die Relay- und Junk-Mail-Zugangssperren sind.
| |
| * Dies kann eine Menge Ausgaben erzeugen.
| |
| * Sie werden einige Nachbearbeitungen vornehmen wollen, um uninteressante Informationen zu eliminieren.
| |
| | |
| Das [https://www.postfix.org/DEBUG_README.html#logging DEBUG_README ]Dokument beschreibt die Bedeutung der "warning" etc.
| |
| * Kennzeichnungen in der Postfix-Protokollierung.
| |
| | |
| === Running Postfix daemon processes chrooted ===
| |
| Postfix daemon processes can be configured (via the [https://www.postfix.org/master.5.html master.cf] file) to run in a chroot jail.
| |
| * The processes run at a fixed low privilege and with file system access limited to the Postfix queue directories (/var/spool/postfix).
| |
| * This provides a significant barrier against intrusion.
| |
| * The barrier is not impenetrable (chroot limits file system access only), but every little bit helps.
| |
| | |
| With the exception of Postfix daemons that deliver mail locally and/or that execute non-Postfix commands, every Postfix daemon can run chrooted.
| |
| | |
| Sites with high security requirements should consider to chroot all daemons that talk to the network: the [https://www.postfix.org/smtp.8.html smtp(8)] and [https://www.postfix.org/smtpd.8.html smtpd(8)] processes, and perhaps also the [https://www.postfix.org/lmtp.8.html lmtp(8)] client.
| |
| * The author's own porcupine.org mail server runs all daemons chrooted that can be chrooted.
| |
| | |
| The default /etc/postfix/[https://www.postfix.org/master.5.html master.cf] file specifies that no Postfix daemon runs chrooted.
| |
| * In order to enable chroot operation, edit the file /etc/postfix/[https://www.postfix.org/master.5.html master.cf], and follow instructions in the file.
| |
| * When you're finished, execute "postfix reload" to make the change effective.
| |
| | |
| Note that a chrooted daemon resolves all filenames relative to the Postfix queue directory (/var/spool/postfix).
| |
| * For successful use of a chroot jail, most UNIX systems require you to bring in some files or device nodes.
| |
| * The examples/chroot-setup directory in the source code distribution has a collection of scripts that help you set up Postfix chroot environments on different operating systems.
| |
| | |
| Additionally, you almost certainly need to configure syslogd so that it listens on a socket inside the Postfix queue directory.
| |
| * Examples of syslogd command line options that achieve this for specific systems:
| |
| | |
| FreeBSD: <tt>syslogd -l /var/spool/postfix/var/run/log</tt>
| |
| | |
| Linux, OpenBSD: <tt>syslogd -a /var/spool/postfix/dev/log</tt>
| |
| | |
| === My own hostname ===
| |
| The [https://www.postfix.org/postconf.5.html#myhostname myhostname] parameter specifies the fully-qualified domain name of the machine running the Postfix system. $[https://www.postfix.org/postconf.5.html#myhostname myhostname] appears as the default value in many other Postfix configuration parameters.
| |
| | |
| By default, [https://www.postfix.org/postconf.5.html#myhostname myhostname] is set to the local machine name.
| |
| * If your local machine name is not in fully-qualified domain name form, or if you run Postfix on a virtual interface, you will have to specify the fully-qualified domain name that the mail system should use.
| |
| | |
| Alternatively, if you specify [https://www.postfix.org/postconf.5.html#mydomain mydomain] in [https://www.postfix.org/postconf.5.html main.cf], then Postfix will use its value to generate a fully-qualified default value for the [https://www.postfix.org/postconf.5.html#myhostname myhostname] parameter.
| |
| | |
| Examples (specify only one of the following):
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#myhostname myhostname] = host.local.domain (machine name is not FQDN)
| |
| [https://www.postfix.org/postconf.5.html#myhostname myhostname] = host.virtual.domain (virtual interface)
| |
| [https://www.postfix.org/postconf.5.html#myhostname myhostname] = virtual.domain (virtual interface)
| |
| | |
| === My own domain name ===
| |
| The [https://www.postfix.org/postconf.5.html#mydomain mydomain] parameter specifies the parent domain of $[https://www.postfix.org/postconf.5.html#myhostname myhostname].
| |
| * By default, it is derived from $[https://www.postfix.org/postconf.5.html#myhostname myhostname] by stripping off the first part (unless the result would be a top-level domain).
| |
| | |
| Conversely, if you specify [https://www.postfix.org/postconf.5.html#mydomain mydomain] in [https://www.postfix.org/postconf.5.html main.cf], then Postfix will use its value to generate a fully-qualified default value for the [https://www.postfix.org/postconf.5.html#myhostname myhostname] parameter.
| |
| | |
| Examples (specify only one of the following):
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#mydomain mydomain] = local.domain
| |
| [https://www.postfix.org/postconf.5.html#mydomain mydomain] = virtual.domain (virtual interface)
| |
| | |
| === My own network addresses ===
| |
| The [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] parameter specifies all network interface addresses that the Postfix system should listen on; mail addressed to "user@[network address]" will be delivered locally, as if it is addressed to a domain listed in $[https://www.postfix.org/postconf.5.html#mydestination mydestination].
| |
| | |
| You can override the [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] setting in the Postfix [https://www.postfix.org/master.5.html master.cf] file by prepending an IP address to a server name.
| |
| | |
| The default is to listen on all active interfaces.
| |
| * If you run mailers on virtual interfaces, you will have to specify what interfaces to listen on.
| |
| | |
| IMPORTANT: If you run MTAs on virtual interfaces you must specify explicit [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] values for the MTA that receives mail for the machine itself: this MTA should never listen on the virtual interfaces or you would have a mailer loop when a virtual MTA is down.
| |
| | |
| Example: default setting.
| |
| | |
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] = all
| |
|
| |
|
| Example: host running one or more virtual mailers.
| |
| * For each Postfix instance, specify only one of the following.
| |
|
| |
|
| /etc/postfix/[https://www.postfix.org/postconf.5.html main.cf]:
| |
| [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] = virtual.host.tld (virtual Postfix)
| |
| [https://www.postfix.org/postconf.5.html#inet_interfaces inet_interfaces] = $[https://www.postfix.org/postconf.5.html#myhostname myhostname] localhost... (non-virtual Postfix)
| |
|
| |
|
| Note: you need to stop and start Postfix after changing this parameter.
| | [[Kategorie:Postfix/Verwaltung]] |
| [[Kategorie:Entwurf]]
| | [[Kategorie:Postfix/Konfiguration]] |
| [[Kategorie:Postfix:Verwaltung]] | |
| [[Kategorie:Postfix:Konfiguration]] | |