Re: Keine Mailzustellung über Submission

Sandy Drobic postfixbuch-users at drobic.de
Mi Mär 17 11:31:25 CET 2021



Am 17.03.2021 um 08:36 schrieb Andreas:
>
> Guten Morgen Sandy,
>
> >
>
> > Dann hängt es wahrscheinlich mit dem zusammen, was nicht hier steht. (^-^)
>
> > "Mails von außen" kommen diese wirklich über den Submission Port rein oder
>
> > über den Port 25, also smtpd in der master?
>
> Dann fange ich einmal mit der Firewall an, um diesen Faktor ausschliessen zu
> können, denn der Mailserver liegt hinter einer Firewall:
>
>  
>
> 160 9164 ACCEPT tcp -- * * 0.0.0.0/0 192.168.1.71 multiport dports
> 25,465,587,143,993,110,995,4190
>
> 0 0 ACCEPT tcp -- * * 192.168.1.71 0.0.0.0/0 multiport dports
> 25,465,587,143,993,110,995,4190
>
>  
>
>  
>
Siehe meine andere Mail, auf dem Server selbst läuft wahrscheinlich auch noch
eine iptables Firewall.

> >
>
> > Poste bitte die Ausgabe von "postconf -n"
>
>  
>
> alias_database = hash:/etc/aliases
>
> alias_maps = hash:/etc/aliases
>
> append_dot_mydomain = no
>
> biff = no
>
> bounce_queue_lifetime = 1h
>
> broken_sasl_auth_clients = yes
>
> compatibility_level = 2
>
> disable_vrfy_command = yes
>
> html_directory = /usr/share/doc/postfix/html
>
> inet_interfaces = all
>
> inet_protocols = all
>
> mailbox_size_limit = 0
>
> maximal_backoff_time = 15m
>
> maximal_queue_lifetime = 1h
>

Ist dies nur für den Testfall, sonst ist das viel zu wenig. Üblich ist mehrere
Tage.
Du kannst "delay_warning_time = 60" nutzen, um eine Benachrichtigung an den
Absender zu schicken, wenn in 60 Minuten die Mail nicht ausgeliefert werden
konnte.
Ebenso confirm_delay_cleared, um nach erfolgter Zustellung eine Aufhebung der
Verzögerungsmail zu schicken.

> message_size_limit = 52428800
>
> milter_default_action = accept
>
Meine Empfehlung wäre statt "accept" ein "tempfail", sonst hast Du eventuell
das Problem, dass bei kaputter rspamd-Konfiguration der Milter defekt ist und
Mails z.B. mit ausführbaren Anhängen einfach durchlässt.

> milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
>
> milter_protocol = 6
>
> minimal_backoff_time = 5m
>
> mua_client_restrictions = permit_mynetworks permit_sasl_authenticated reject
>
> mua_relay_restrictions = reject_non_fqdn_recipient
> reject_unknown_recipient_domain permit_mynetworks permit_sasl_authenticated
> reject
>
> mua_sender_restrictions = permit_mynetworks reject_non_fqdn_sender
> reject_sender_login_mismatch permit_sasl_authenticated reject
>
> mydestination = mx.example.tld, localhost.example.tld, localhost
>

Hier wird es interessant: Du hast Domains in
- mydestination (local Domains, die gültigen Empfänger sind in
local_recipient_maps)
- relay_domains (gültige Empfänger in relay_recipient_maps)
- virtual_mailbox_domains ( gültige Empfänger in virtual_mailbox_maps)
Prüfe am besten, ob wirklich überall die Domains dort richtig sind.
Wahrscheinlich sind die Domains in mydestination und relay_domains besser alle
in virtual_mailbox_domains aufgehoben.

Prüfe bitte auch, ob auch alle notwendigen Pakete installiert sind. Damit
Postfix über cidr, regexp, mysql, ldap etc. auf Maps zugreifen kann, müssen
oft Pakete installiert sein, welche diese Funktionalität mitbringen.
"postconf -m" zeigt, welche Maptypen Postfix beherrscht. Bei mir auf Centos
etwa ist kein mysql in der Standardkonfiguration enthalten.
 postconf -m
btree
cidr
environ
fail
hash
inline
internal
memcache
nis
pcre
pipemap
proxy
randmap
regexp
socketmap
static
tcp
texthash
unionmap
unix

ich müsste dafür das Paket postfix-mysql installieren, damit ich
mysql-Abfragen nutzen kann.
Auch für pcre und cidre müssen oft Pakete hinzuinstalliert werden.

> myhostname = mx.example.tld
>
> mynetworks = 127.0.0.0/8 192.168.1.0/24 192.102.24.0/24
> [::ffff:127.0.0.0]/104 [::1]/128
>
> myorigin = /etc/mailname
>
> non_smtpd_milters = inet:localhost:11332
>
> plaintext_reject_code = 550
>
> postscreen_access_list = permit_mynetworks cidr:/etc/postfix/postscreen_access
>
> postscreen_bare_newline_enable = no
>
> postscreen_blacklist_action = drop
>
> postscreen_cache_cleanup_interval = 24h
>
> postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
>
> postscreen_dnsbl_action = enforce
>
> postscreen_dnsbl_sites = b.barracudacentral.org=127.0.0.2*7
> dnsbl.inps.de=127.0.0.2*7 bl.mailspike.net=127.0.0.2*5
> bl.mailspike.net=127.0.0.[10;11;12]*4 dnsbl.sorbs.net=127.0.0.10*8
> dnsbl.sorbs.net=127.0.0.5*6 dnsbl.sorbs.net=127.0.0.7*3
> dnsbl.sorbs.net=127.0.0.8*2 dnsbl.sorbs.net=127.0.0.6*2
> dnsbl.sorbs.net=127.0.0.9*2 zen.spamhaus.org=127.0.0.[4..7]*6
> zen.spamhaus.org=127.0.0.3*4 zen.spamhaus.org=127.0.0.2*3
> hostkarma.junkemailfilter.com=127.0.0.2*3
> hostkarma.junkemailfilter.com=127.0.0.4*1
> hostkarma.junkemailfilter.com=127.0.1.2*1
> wl.mailspike.net=127.0.0.[18;19;20]*-2
> hostkarma.junkemailfilter.com=127.0.0.1*-2
>
> postscreen_dnsbl_threshold = 8
>
> postscreen_dnsbl_ttl = 5m
>
> postscreen_greet_action = enforce
>
> postscreen_greet_banner = $smtpd_banner
>
> postscreen_greet_ttl = 2d
>
> postscreen_greet_wait = 3s
>
> postscreen_non_smtp_command_enable = no
>
> postscreen_pipelining_enable = no
>
> proxy_read_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf,
> proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_out_policy.cf,
> proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_in_policy.cf,
> $local_recipient_maps $mydestination $virtual_alias_maps
> $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
> $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
> $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
>

Wenn "postconf -m" zeigt, dass mysql als maptype existiert kannst Du prüfen,
ob die Abfragen denn auch ein Ergebnis bringen.
"postmap -q 'was-du-suchst' mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf"

Schaue Dir bitte auch die Liste der proxy_read_maps an, da werden Sachen
aufgeführt, die in Deiner Konfig nicht mehr verwendet werden wie
virtual_alias_domains, sender_canonical_maps, relocated_maps usw.
Schau Dir auch immer an, was der Defaulteintrag für diesen Parameter ist, denn
was Du in Deiner Konfig nicht explizit verwendest (postconf -n zeigt dies)
wird mit dem Default hinzugenommen.

postconf -d transport_maps
transport_maps =

Der Default bei mir wäre z.B. eine leere transport_maps, was diese Tabelle
abschaltet.

> $smtpd_sender_login_maps
>
> queue_run_delay = 5m
>
> readme_directory = /usr/share/doc/postfix
>
> recipient_delimiter = +
>
> relay_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_mxdomain_maps.cf
>
> relay_recipient_maps =
> proxy:mysql:/etc/postfix/sql/mysql_relay_recipient_maps.cf
>
> relayhost =
>
> sender_dependent_default_transport_maps =
> proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_out_policy.cf
>
> smtp_dns_support_level = dnssec
>
> smtp_header_checks = pcre:/etc/postfix/submission_header_cleanup
>
> smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
>
> smtp_tls_ciphers = high
>
> smtp_tls_loglevel = 1
>
> smtp_tls_policy_maps = mysql:/etc/postfix/sql/tls-policy.cf
>
> smtp_tls_protocols = !SSLv2, !SSLv3
>
> smtp_tls_security_level = dane
>
> smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
>
> smtpd_banner = $myhostname
>
> smtpd_client_restrictions = permit_mynetworks check_client_access
> hash:/etc/postfix/without_ptr reject_unknown_client_hostname
>
> smtpd_data_restrictions = reject_unauth_pipelining
>
> smtpd_delay_reject = yes
>
> smtpd_error_sleep_time = 10s
>
> smtpd_hard_error_limit = ${stress?1}${stress:5}
>
> smtpd_helo_required = yes
>
> smtpd_helo_restrictions = permit_mynetworks reject_invalid_helo_hostname
> reject_non_fqdn_helo_hostname reject_unknown_helo_hostname
>
> smtpd_milters = inet:localhost:11332
>
> smtpd_proxy_timeout = 600s
>
> smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
> reject_invalid_helo_hostname, reject_unknown_reverse_client_hostname,
> reject_unauth_destination
>
> smtpd_relay_restrictions = reject_non_fqdn_recipient
> reject_unknown_recipient_domain permit_mynetworks reject_unauth_destination
>
> smtpd_restriction_classes = mua_sender_restrictions mua_client_restrictions
> mua_relay_restrictions
>
> smtpd_sasl_auth_enable = yes
>
> smtpd_sasl_authenticated_header = yes
>
> smtpd_sasl_path = private/auth_dovecot
>
> smtpd_sasl_type = dovecot
>
> smtpd_sender_login_maps =
> proxy:mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf
>
> smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
> permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated,
> reject_unlisted_sender, reject_unknown_sender_domain
>
> smtpd_soft_error_limit = 3
>
> smtpd_tls_auth_only = yes
>
> smtpd_tls_cert_file = /etc/letsencrypt/live/mx.example.tld/fullchain.pem
>
> smtpd_tls_ciphers = high
>
> smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams_2048.pem
>
> smtpd_tls_dh512_param_file = /etc/ssl/mail/dhparams_512.pem
>
> smtpd_tls_eecdh_grade = strong
>
> smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL
>
> smtpd_tls_key_file = /etc/letsencrypt/live/mx.example.tld/privkey.pem
>
> smtpd_tls_loglevel = 1
>
> smtpd_tls_mandatory_ciphers = high
>
> smtpd_tls_mandatory_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL
>
> smtpd_tls_mandatory_protocols = !SSLv3
>
> smtpd_tls_protocols = !SSLv3
>
> smtpd_tls_security_level = may
>
> smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
>
> tls_high_cipherlist =
> EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
>
> tls_preempt_cipherlist = yes
>
> tls_ssl_options = NO_COMPRESSION
>
> virtual_alias_maps =
> proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
> proxy:mysql:/etc/postfix/sql/mysql_virtual_spamalias_maps.cf,
> proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
> proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
>
> virtual_gid_maps = static:5000
>
> virtual_mailbox_base = /var/vmail/
>
> virtual_mailbox_domains =
> proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
>
> virtual_mailbox_maps =
> proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
> proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
>
> virtual_minimum_uid = 104
>
> virtual_transport = lmtp:unix:private/dovecot-lmtp
>
> virtual_uid_maps = static:5000
>
>  
>
> > und die Logdateien beim Start von
>
> > Postfix
>
> Das ist direkt nach dem Start von Postfix, Dovecot und RSpamd:
>
>  
>
> Mar 17 08:22:22 mx postfix/postfix-script[20923]: warning: symlink leaves
> directory: /etc/postfix/./makedefs.out
>
> Mar 17 08:22:22 mx postfix/postfix-script[20964]: starting the Postfix mail
> system
>
> Mar 17 08:22:22 mx postfix/master[20966]: daemon started -- version 3.4.14,
> configuration /etc/postfix
>
> Mar 17 08:22:22 mx postfix/pickup[20967]: 919F1601668: uid=0 from=<root>
>
> Mar 17 08:22:22 mx postfix/cleanup[20977]: warning: connect to Milter
> service inet:localhost:11332: Connection refused
>
> Mar 17 08:22:22 mx postfix/cleanup[20977]: 919F1601668:
> message-id=<20210317072222.919F1601668 at mx.example.tld>
>
> Mar 17 08:22:22 mx postfix/qmgr[20968]: 919F1601668:
> from=<root at mx.example.tld>, size=1856, nrcpt=1 (queue active)
>
> Mar 17 08:22:22 mx postfix/pickup[20967]: C2FA960092B: uid=0 from=<root>
>
> Mar 17 08:22:22 mx postfix/cleanup[20977]: warning: connect to Milter
> service inet:localhost:11332: Connection refused
>
> Mar 17 08:22:22 mx postfix/cleanup[20977]: C2FA960092B:
> message-id=<20210317072222.C2FA960092B at mx.example.tld>
>
>  
>
> Direkt auffallen tut mir der Milter Service.
>
>  
>
> > und wenn ein Client versucht, eine Mail einzuliefern.
>
> > Submission (Port 587) sollte nur für das Einliefern von Clients verwendet
>
> > werden, die sich authentifizieren und nicht abgewiesen werden sollen.
>
> >
>
> Auf meinem funktionierenden Server sehe im Log
>
>  
>
> Mar 17 08:27:16 mx postfix/smtp[12439]: connect to
> mx.example.tld[192.109.24.70]:25: Connection timed out
>
> Mar 17 08:27:16 mx postfix/smtp[12439]: BE00B120062: to=<wh at example.tld>,
> relay=none, delay=30, delays=0.2/0.05/30/0, dsn=4.4.1, status=deferred
> (connect to mx.example.tld[192.109.24.70]:25: Connection timed out)
>
>  
>
> Im Zeitraum von 08:27:02 bis 08:27:35 sehe ich dem Server nichts was auf
> diesen Kontaktversuch schliessen lässt.
>
>
Du hast wahrscheinlich eine Firewall auf dem Server selbst aktiv, welche die
Verbindung zu Port 25 blockt.
Da sind noch einige Sachen strubbelig. Am besten, am Anfang führt man eine
Anleitung genau durch und bekommt dann ein funktionierendes System
(hoffentlich). Abweichungen kann man dann danach einführen.
Bist Du nach dieser Anleitung vorgegangen:
https://thomas-leister.de/mailserver-debian-buster/ oder was hast Du als
Vorlage verwendet?

Gruß
Sandy
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <https://listi.jpberlin.de/pipermail/postfixbuch-users/attachments/20210317/578a6faa/attachment-0001.htm>


Mehr Informationen über die Mailingliste Postfixbuch-users