fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


linux:debian:postfix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:debian:postfix [2024/06/21 10:16] – created gsyslinux:debian:postfix [2024/06/21 18:28] (current) – [Smarthost] gsys
Line 1: Line 1:
 ====== Postfix auf Debian ====== ====== Postfix auf Debian ======
  
 +===== Befehle =====
  
 +<code>
 +mailq
 +less /var/log/mail.log
 +postsuper -d ALL
 +postsuper -d <ID>
 +systemctl restart postfix
 +</code>
 +
 +===== Installation =====
 +
 +<code>
 +apt update
 +apt install postfix
 +apt install postfix libsasl2-modules          # relay mit smtp auth
 +</code>
 +
 +===== Konfiguration =====
 +
 +==== Sender Mapping ====
 +''/etc/postfix/main.cf''
 +<code>
 +sender_canonical_maps = hash:/etc/postfix/sender_canonical
 +</code>
 +
 +''/etc/postfix/sender_canonical''
 +<code>
 +root    root@host.example.org
 +</code>
 +
 +<code>
 +chmod 600 /etc/postfix/sender_canonical
 +postmap /etc/postfix/sender_canonical
 +</code>
 +
 +==== Smarthost ====
 +
 +If not already installed:
 +<code>
 +apt install libsasl2-modules
 +</code>
 +
 +''/etc/postfix/main.cf''
 +<code>
 +relayhost = [smtp.example.com]:587
 +smtp_sasl_auth_enable = yes
 +smtp_sasl_password_maps = hash:/etc/postfix/relay_pass
 +smtp_sasl_security_options = noanonymous
 +smtp_use_tls=yes
 +smtp_tls_security_level = encrypt
 +</code>
 +
 +''/etc/postfix/relay_pass''
 +<code>
 +[smtp.example.com]:587 user@example.com:password
 +</code>
 +
 +<code>
 +chmod 600 /etc/postfix/relay_pass
 +postmap /etc/postfix/relay_pass
 +</code>
 +
 +===== Test =====
 +
 +<code>
 +apt install mailutils
 +</code>
 +
 +<code>
 +echo "Test" | mail -s "Test mx01" test@example.com
 +</code>
 +
 +<code>
 +openssl s_client -connect mx01.example.org:587 -starttls smtp
 +</code>
linux/debian/postfix.1718957777.txt.gz · Last modified: 2024/06/21 10:16 by gsys