fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


linux:debian:postfix

Postfix auf Debian

Befehle

mailq
less /var/log/mail.log
postsuper -d ALL
postsuper -d <ID>
systemctl restart postfix

Installation

apt update
apt install postfix
apt install postfix libsasl2-modules          # relay mit smtp auth

Konfiguration

Sender Mapping

/etc/postfix/main.cf

sender_canonical_maps = hash:/etc/postfix/sender_canonical

/etc/postfix/sender_canonical

root    root@host.example.org
chmod 600 /etc/postfix/sender_canonical
postmap /etc/postfix/sender_canonical

Smarthost

If not already installed:

apt install libsasl2-modules

/etc/postfix/main.cf

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

/etc/postfix/relay_pass

[smtp.example.com]:587 user@example.com:password
chmod 600 /etc/postfix/relay_pass
postmap /etc/postfix/relay_pass

Test

apt install mailutils
echo "Test" | mail -s "Test mx01" test@example.com
openssl s_client -connect mx01.example.org:587 -starttls smtp
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.  More information about cookies 
linux/debian/postfix.txt · Last modified: 2024/06/21 18:28 by gsys