Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| server:postfix [2013/09/22 12:59] – st | server:postfix [2024/06/19 08:52] (aktuell) – st | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Postfix ====== | ||
| + | [[wpde> | ||
| + | * [[Konfiguration von Postfix]] | ||
| + | * [[Spamfilterung]] | ||
| + | |||
| + | |||
| + | ===== Links ===== | ||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | ==== Logging ==== | ||
| + | |||
| + | '' | ||
| + | |||
| + | Links: | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Verwaltung ===== | ||
| + | |||
| + | ==== Bestandteile und Tools ==== | ||
| + | |||
| + | FIXME | ||
| + | ^ Bestandteil ^ Aufgabe ^ oft benutzte Aufrufe ^ | ||
| + | | postalias | erzeugt die Alias-Datenbank | | | ||
| + | | postconf | zeigt oder verändert die Postfix-Konfiguration | | | ||
| + | | postfix-add-policy | | | | ||
| + | | postmap | für Lookup-Tables | neue hash/ | ||
| + | | **postcat** | liest mails aus der mailqueue | Mail ausgeben: '' | ||
| + | | postdrop | | | | ||
| + | | postfix-add-filter | | | | ||
| + | | postkick | | | | ||
| + | | postlog | Möglichkeit für Scripts Lognachrichten zu erzeugen | | | ||
| + | | **postqueue** | Verwaltet die Mail-Queue | Mails in Queue anzeigen: '' | ||
| + | | **postsuper** | Manipulation an der Mail-Queue | einzelne Mail aus der queue löschen: '' | ||
| + | |||
| + | |||
| + | ==== mails eines bestimmten Absenders auf hold setzen | ||
| + | für user@domain.tld: | ||
| + | <code bash> | ||
| + | |||
| + | und löschen: | ||
| + | <code bash> | ||
| + | ==== rate-Limiting ==== | ||
| + | |||
| + | * Versandprozesse limitieren (Beispiel: Auf 2 Prozess) * in der ''/ | ||
| + | # service type private unpriv | ||
| + | smtp unix - | ||
| + | * concurrency limits< | ||
| + | default_destination_concurrency_limit = 20 | ||
| + | default_destination_concurrency_negative_feedback = 1 | ||
| + | default_destination_concurrency_positive_feedback = 1 | ||
| + | relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit | ||
| + | relay_destination_concurrency_limit = $default_destination_concurrency_limit | ||
| + | relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback | ||
| + | relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback | ||
| + | relay_initial_destination_concurrency = $initial_destination_concurrency | ||
| + | smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit | ||
| + | smtp_destination_concurrency_limit = $default_destination_concurrency_limit | ||
| + | smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback | ||
| + | smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback | ||
| + | smtp_initial_destination_concurrency = $initial_destination_concurrency</ | ||
| + | |||
| + | Für ein relay was nur in microsoft365 weiterleitet sollte das sehr gering ausfallen (siehe https:// | ||
| + | < | ||
| + | # microsoft365 does not like more than 3 concurrent conns: | ||
| + | default_destination_concurrency_limit=3 | ||
| + | </ | ||
| + | |||
| + | ==== Links ==== | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | |||
| + | |||
| + | |||
| + | ===== Fehlerbehebung ===== | ||
| + | |||
| + | * nach postmap kommt dieser Fehler ('' | ||
| + | * postfix start schlägt fehl: < | ||
| + | # smtpd_tls_CApath = / | ||
| + | # smtp_tls_CApath = / | ||
| + | </ | ||
| + | |||
| + | ==== SSL/TLS debugging ==== | ||
| + | |||
| + | ''/ | ||
| + | |||
| + | < | ||
| + | smtpd_tls_received_header = yes | ||
| + | smtpd_tls_loglevel = 3 # 0 (none) to 4 (full data) | ||
| + | </ | ||
| + | |||
| + | ==== / | ||
| + | |||
| + | < | ||
| + | warning: SASL authentication problem: unable to open Berkeley db / | ||
| + | warning: unknown[x.x.x.x]: | ||
| + | </ | ||
| + | |||
| + | Eine leere Datei legt dieser Befehl an: | ||
| + | |||
| + | saslpasswd2 sasldb2 | ||
| + | |||
| + | ===== Konfiguration ===== | ||
| + | |||
| + | |||
| + | ==== Authentifizierung am Postfix-Relay (mit ClientCerts) ==== | ||
| + | |||
| + | Wir brauchen als Vorraussetzung eine CA, diese stellt dann ein Zertifikat für den Client-MTA aus ('' | ||
| + | Man kopiert die beiden Zertifikatsdateien und dazu das Zertifikat ('' | ||
| + | |||
| + | < | ||
| + | = TLS Auth start = | ||
| + | |||
| + | # ask clients for certs: | ||
| + | smtpd_tls_ask_ccert=yes | ||
| + | permit_tls_all_clientcerts = yes | ||
| + | |||
| + | # SSL-Debug: | ||
| + | # smtpd_tls_loglevel = 1 | ||
| + | |||
| + | # Fingerprints of SSL-Certs i trust and relay for (i am the relay for these hosts and they auth via their ssl-Cert) | ||
| + | relay_clientcerts = btree:/ | ||
| + | |||
| + | # TLS parameters (certs/keys in pem-format) | ||
| + | smtpd_tls_cert_file= / | ||
| + | smtpd_tls_key_file= / | ||
| + | smtpd_tls_CAfile= / | ||
| + | |||
| + | # enable STARTTLS outgoing: | ||
| + | smtp_tls_security_level=may | ||
| + | # enable STARTTLS incoming: | ||
| + | smtpd_tls_security_level=may | ||
| + | |||
| + | = TLS Auth end = | ||
| + | </ | ||
| + | |||
| + | Außerdem wird eine weitere Zeile zu den "'' | ||
| + | |||
| + | < | ||
| + | smtpd_recipient_restrictions = | ||
| + | ... | ||
| + | | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Die Datei ''/ | ||
| + | |||
| + | < | ||
| + | # List all client-certs that are allowed to srelay mail over me | ||
| + | # only MD5-Fingerprints (not SHA-1) seems to work, the comment is unimportant. | ||
| + | # you get the fingerprint with: " | ||
| + | # | ||
| + | EA: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== minimal nötiger freier Datenträgerplatz ==== | ||
| + | |||
| + | ...um E-Mail anzunehmen: minimaler Platz [[http:// | ||
| + | |||
| + | ==== ssmtp und submission aktivieren ==== | ||
| + | |||
| + | Die meisten Clients benutzen Port 25 und aktivieren SSL/TLS wenn angeboten (über STARTTLS), manche alte Client brauchen aber den Port 465 (SSMTP = SMTP + SSL). Außerdem blockieren einige Provider Port 25 ausgehend (um Spam einzudämmen), | ||
| + | |||
| + | Beides lässt sich über die beiden folgenden Zeilen in der ''/ | ||
| + | |||
| + | < | ||
| + | # some providers block Port 25 outgoing, so Port 587 (submission) in advised | ||
| + | submission inet n | ||
| + | -o smtpd_tls_security_level=encrypt | ||
| + | -o smtpd_sasl_auth_enable=yes | ||
| + | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| + | -o milter_macro_daemon_name=ORIGINATING | ||
| + | |||
| + | # SMTP+SSL (SSMTP) on Port 465 | ||
| + | smtps | ||
| + | -o smtpd_tls_wrappermode=yes | ||
| + | -o smtpd_sasl_auth_enable=yes | ||
| + | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| + | -o milter_macro_daemon_name=ORIGINATING | ||
| + | </ | ||
| + | |||
| + | ==== Mailarchivierung per Postfix ==== | ||
| + | |||
| + | Postfix kann für Domains oder einzelne Empfänger Kopien erzeugen, damit kann ein Mailarchiv erreicht werden. | ||
| + | |||
| + | In ''/ | ||
| + | < | ||
| + | sender_bcc_maps = btree:/ | ||
| + | recipient_bcc_maps = btree:/ | ||
| + | </ | ||
| + | |||
| + | Ganze Domains: | ||
| + | < | ||
| + | @domain.tld archiv@example.com | ||
| + | @domain.eu archiv@example.com | ||
| + | </ | ||
| + | |||
| + | Einzelne Benutzer: | ||
| + | < | ||
| + | info@domain.com chef@example.com | ||
| + | kotakt@domain.eu archiv@example.com | ||
| + | </ | ||