====== postfix ====== **postfix** ist ein [[Mail]]-Server. ===== Tips und Tricks ===== ==== Postfix an localhost oder eine spezifische Adresse binden ==== Von https://ho2e.de/mywallabag/view/679 In der /etc/postfix/main.cf ändern: Nuan an localhost: inet_interfaces = 127.0.0.1 oder inet_interfaces = loopback-only An mehrere Adressen: inet_interfaces = 202.5.1.2,127.0.0.1 Kontrollieren: netstat -tulpn | grep 25 tail -f /var/log/maillog ==== Postfix soll an Smarthost senden ==== Im Beispiel soll postfix auf pink alle Mails an mail.fahrrad-wiki.org senden. Während der Installation von postfix die Option smarthost auswählen und als hostname pink, sowie als smarthost mail.fahrrad-wiki.org. Konfiguration als Smarthost zum Versenden über mail.fahrrad-wiki.org: #mydestination = $myhostname, pink, localhost.localdomain, localhost mydestination = ########## von mir hinzugefügt relayhost = [mail.fahrrad-wiki.org]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes ##### inet_interfaces = loopback-only /etc/postfix/sasl_passwd erzeugen: [mail.fahrrad-wiki.org]:587 move@fahrrad-wiki.org:xxxxxxx Mit postmap erzeugen (sasl_passwd.db): postmap /etc/postfix/sasl_passwd In /etc/alias eintragen: root: admin@fahrrad-wiki.org Mit newaliases abschließen: newaliases Postfix neu starten: service postfix restart ==== Lokaler Postfix (neben mailcow) ==== Bei der Installation sind aufgrund [[linux:mailcow|mailcow:dockerized]] einige Besonderheiten zu beachten, da u.a. mailcow auf Port 25 lauscht. Siehe auch https://ho2e.de/mywallabag/view/553 Im Beispiel ist der hostname //mail//. Während der Installation Internetsite auswählen und den Hostnamen mail angeben. Dann auskommentieren in /etc/postfix/master.cf: #smtp inet n - y - - smtpd Und folgende Einstellungen nacheinander ausführen: postconf -e 'relayhost = 172.22.1.1' postconf -e "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128" postconf -e "inet_interfaces = loopback-only" Nun kann mit postfix local mail gesendet werden (postfix neustarten).