Postfix – lokale und Systemmails an smtp weiterleiten

18. Juli 2019 0 Von LTZ4hundert

/etc/postfix/main.cf

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
myhostname = server.localdomain
mydestination = server.localdomain, localhost, localhost.localdomain, localhost
smtp_sasl_mechanism_filter = login
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
inet_interfaces = loopback-only
relayhost = smtp-server:587
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
smtp_tls_security_level = encrypt
smtp_sasl_path = smtpd

in /etc/postfix/master.cf „chroot“ auf „n“ setzen

/etc/postfix/sasl_passwd
smtp-server:587 user:password

/etc/postfix/sender_canonical
@server.localdomain server@email-adresse.de
„“ server@email-adresse.de

/etc/postfix/generic
/.*/ server@email-addresse.de

/etc/postfix/smtp_header_checks
/^Subject: (.*)/ REPLACE Subject: ${1} [server.localdomain]


abschliessend mit „postmap hash:/etc/postfix/datei“ hashen – .db files wird erzeugt)

service postfix restart