Postfix ist ein Mail Transfer Agent für Unix und Unix-Derivate. Es wurde erschaffen, um eine kompatible Alternative zu Sendmail zu bieten. Bei der Entwicklung wurde insbesondere auf Sicherheitsaspekte geachtet. Postfix ist aber nicht nur sicher, sondern auch schnell und einfach zu administrieren. Zur Außenwelt verhält es sich wie Sendmail, aber im Inneren ist es komplett anders aufgebaut. Der Quellcode von Postfix steht unter der IBM Public License zur Verfügung.
| 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/btree-DB einer Klartextdatei erzeugen: postmap DATEI |
| postcat | liest mails aus der mailqueue | Mail ausgeben: postcat -q ID |
| postdrop | ||
| postfix-add-filter | ||
| postkick | ||
| postlog | Möglichkeit für Scripts Lognachrichten zu erzeugen | |
| postqueue | Verwaltet die Mail-Queue | Mails in Queue anzeigen: postqueue -p (flush mit -f) |
| postsuper | Manipulation an der Mail-Queue | einzelne Mail aus der queue löschen: postsuper -d ID oder alle postsuper -d ALL |
/etc/postfix/master.cf: # service type private unpriv chroot wakeup maxproc command + args
smtp unix - - - - 2 smtp
postconf | grep '^\(default\|smtp\|relay\)[^ ]*concurrency[^ ]*'
default_destination_concurrency_failed_cohort_limit = 1 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
Postfix Error “fatal: open database /etc/postfix/transport.db: Invalid argument”) Mails werden nicht mehr angenommen. Lösung: In der Konfiguration wird btree als Datenbankformat angegeben, postmap erstellt aber standardmäpßig hash-Datenbanken. Diser Eintrag in der /etc/postfix/main.cf behebt dies: default_database_type = btree
Wir brauchen als Vorraussetzung eine CA, diese stellt dann ein Zertifikat für den Client-MTA aus (MY-CERT.key und MY-CERT.key) aus.
Man kopiert die beiden Zertifikatsdateien und dazu das Zertifikat (CA.crt) auf das Relay.
= 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:/etc/postfix/relay_clientcerts # TLS parameters (certs/keys in pem-format) smtpd_tls_cert_file= /etc/postfix/MY-CERT.crt smtpd_tls_key_file= /etc/postfix/MY-CERT.key smtpd_tls_CAfile= /etc/postfix/CA.crt # 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“ hinzugefügt:
smtpd_recipient_restrictions = ... permit_tls_clientcerts, ...
Die Datei /etc/postfix/relay_clientcerts enthält den Fingerabdruck der Clients die sich am Relay damit authentifizieren wollen.
# 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: "openssl x509 -md5 -noout -fingerprint -in FILENAME-OF-CRT" # EA:0E:CD:21:19:0A:DE:DC:66:49:89:7B:E4:DF:7E:A3 Client XY
News
Navigation