# /etc/postfix/main.cf # Beispiel von www.postfix-howto.de, Stand November 2026 # Geschrieben fuer Debian 13 mit Postfix 3.10. # Vor dem Einsatz example.org und mail.example.org ersetzen. # Danach pruefen: postfix check && postconf -n compatibility_level = 3.6 # --- Grundwerte --- myhostname = mail.example.org mydomain = example.org myorigin = $myhostname # Maildomains gehoeren NICHT hierher, sie kommen aus der Datenbank. mydestination = localhost mynetworks = 127.0.0.0/8 [::1]/128 inet_interfaces = all inet_protocols = all recipient_delimiter = + message_size_limit = 52428800 biff = no append_dot_mydomain = no # --- Tabellenformat: LMDB statt Berkeley DB --- default_database_type = lmdb alias_maps = lmdb:/etc/aliases alias_database = lmdb:/etc/aliases # --- Virtuelle Domains aus MariaDB --- virtual_mailbox_domains = mysql:/etc/postfix/sql/domains.cf virtual_mailbox_maps = mysql:/etc/postfix/sql/mailboxes.cf virtual_alias_maps = mysql:/etc/postfix/sql/aliases.cf virtual_transport = lmtp:unix:private/dovecot-lmtp # --- Anmeldung ueber Dovecot (nur auf 465 und 587 aktiv, siehe master.cf) --- smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = no smtpd_sender_login_maps = mysql:/etc/postfix/sql/sender-login.cf # --- TLS eingehend --- smtpd_tls_chain_files = /etc/letsencrypt/live/mail.example.org/privkey.pem, /etc/letsencrypt/live/mail.example.org/fullchain.pem smtpd_tls_security_level = may smtpd_tls_auth_only = yes smtpd_tls_protocols = >=TLSv1.2 smtpd_tls_mandatory_protocols = >=TLSv1.2 smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes # --- TLS ausgehend --- smtp_tls_security_level = may smtp_tls_protocols = >=TLSv1.2 smtp_tls_CApath = /etc/ssl/certs smtp_tls_loglevel = 1 smtp_tls_session_cache_database = lmdb:${data_directory}/smtp_scache # --- Schutzregeln --- smtpd_helo_required = yes disable_vrfy_command = yes strict_rfc821_envelopes = yes smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_recipient_restrictions = reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unlisted_recipient smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain smtpd_data_restrictions = reject_unauth_pipelining # --- Postscreen (Port 25), dazu die Zeilen in master.cf aktivieren --- # Spamhaus braucht einen eigenen Resolver auf dem Server (unbound). postscreen_access_list = permit_mynetworks postscreen_greet_action = enforce postscreen_dnsbl_sites = zen.spamhaus.org*3 bl.spamcop.net*1 postscreen_dnsbl_threshold = 3 postscreen_dnsbl_action = enforce postscreen_blacklist_action = drop # --- Spamfilter rspamd als Milter --- smtpd_milters = inet:127.0.0.1:11332 non_smtpd_milters = $smtpd_milters milter_protocol = 6 milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} # Faellt der Filter aus, gehen Mails ungefiltert durch statt verloren. milter_default_action = accept