Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
postfix_test [2025/10/18 16:27] jango |
postfix_test [2025/10/24 13:01] (aktuell) jango |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | =====Version 1===== | + | Beispiele für [[Postfix]] Setups mit [[SASL]] für [[PAM]], [[LDAP]] etc. |
| + | |||
| + | =====SASL mit PAM===== | ||
| Ubuntu 24.04 | Ubuntu 24.04 | ||
| Zeile 7: | Zeile 9: | ||
| sudo apt install -y postfix libsasl2-modules sasl2-bin | sudo apt install -y postfix libsasl2-modules sasl2-bin | ||
| - | # SASL gegen PAM (lokale User) | + | # SASL soll gegen PAM authentifizieren. |
| sudo sed -i ' | sudo sed -i ' | ||
| sudo sed -i ' | sudo sed -i ' | ||
| + | |||
| sudo systemctl enable --now saslauthd | sudo systemctl enable --now saslauthd | ||
| sudo systemctl status saslauthd | sudo systemctl status saslauthd | ||
| + | |||
| + | # Postfix user muss in die SASL Gruppe! | ||
| sudo adduser postfix sasl | sudo adduser postfix sasl | ||
| - | # SASL für Postfix | + | # SASL Konfiguration |
| sudo mkdir -p / | sudo mkdir -p / | ||
| sudo tee / | sudo tee / | ||
| Zeile 22: | Zeile 27: | ||
| EOF | EOF | ||
| - | + | # SASL serverseitig | |
| - | # SASL einschalten | + | |
| sudo postconf -e " | sudo postconf -e " | ||
| sudo postconf -e " | sudo postconf -e " | ||
| Zeile 29: | Zeile 33: | ||
| sudo postconf -e " | sudo postconf -e " | ||
| - | # WICHTIG: Keine TLS-Pflicht für AUTH (sonst | + | # WICHTIG: Keine TLS-Pflicht für AUTH (sonst ohne Zertifikat kein AUTH) |
| sudo postconf -e " | sudo postconf -e " | ||
| sudo postconf -e " | sudo postconf -e " | ||
| Zeile 37: | Zeile 41: | ||
| sudo postconf -e " | sudo postconf -e " | ||
| - | # Optional wie auf smtp02: | + | # Relay Host konfigurieren. Kein AUTH! Postfix dürfen am Exchange anonym senden. Evtl aendern. |
| sudo postconf -e " | sudo postconf -e " | ||
| #sudo postconf -e " | #sudo postconf -e " | ||
| - | # proxy-protocol | + | # proxy-protocol |
| sudo postconf -e " | sudo postconf -e " | ||
| sudo postconf -e " | sudo postconf -e " | ||
| Zeile 56: | Zeile 60: | ||
| -o smtpd_upstream_proxy_protocol= | -o smtpd_upstream_proxy_protocol= | ||
| EOF | EOF | ||
| + | </ | ||
| + | |||
| + | =====SASL mit AD===== | ||
| + | |||
| + | Die Datei / | ||
| + | |||
| + | Im ursprünglichen Setup wird MECHANISMS=" | ||
| + | |||
| + | - saslauthd delegiert die Authentifizierung an PAM | ||
| + | - PAM wiederum nutzt lokale Systemuser oder andere Module (z. B. pam_unix, pam_winbind, | ||
| + | - Die Konfiguration erfolgt dann über /etc/pam.d/ – nicht über eine eigene saslauthd.conf | ||
| + | |||
| + | Kein Bedarf für / | ||
| + | |||
| + | Sobald du MECHANISMS=" | ||
| + | |||
| + | < | ||
| + | sudo sed -i ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | ldap_servers: | ||
| + | ldap_search_base: | ||
| + | ldap_bind_dn: | ||
| + | ldap_bind_pw: | ||
| + | ldap_filter: | ||
| + | ldap_auth_method: | ||
| + | </ | ||
| + | |||
| + | =====Alma Linux===== | ||
| + | |||
| + | <code bash> | ||
| + | # Postfix und LibSASL installieren | ||
| + | sudo dnf install postfix cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain | ||
| + | |||
| + | # SASL soll gegen PAM authentifizieren. (lokale User) | ||
| + | sudo sed -i ' | ||
| + | |||
| + | sudo systemctl enable --now saslauthd | ||
| + | sudo systemctl status saslauthd | ||
| + | |||
| + | sudo groupadd sasl | ||
| + | sudo usermod -a -G sasl postfix | ||
| + | sudo systemctl restart saslauthd | ||
| + | |||
| + | sudo mkdir -p / | ||
| + | sudo tee / | ||
| + | pwcheck_method: | ||
| + | mech_list: PLAIN LOGIN | ||
| + | log_level: 7 | ||
| + | EOF | ||
| + | |||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | |||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | |||
| + | sudo postconf -e " | ||
| + | |||
| + | sudo postconf -e " | ||
| + | sudo postconf -e " | ||
| + | |||
| + | sudo systemctl restart postfix | ||
| + | sudo systemctl restart saslauthd | ||
| </ | </ | ||