REJECT für Spam-Versende-Hosts mit localhost als reverse DNS name pointer

Martin Steigerwald martin at lichtvoll.de
Di Jan 24 17:58:36 CET 2017


Hallo Christian, hallo ihr,

sorry, ich hab Deine Antwort übersehen.

Am Dienstag, 27. Dezember 2016, 19:38:11 CET schrieb Christian Boltz:
> Am Dienstag, 27. Dezember 2016, 13:37:21 CET schrieb Martin Steigerwald:
> > Ich bekomme ab und zu einen REJECT für einen Spam, den ich nicht
> > versandte, zugestellt, weil der Spammer sowas hast:
> > 
> > # host 117.0.201.94
> > 94.201.0.117.in-addr.arpa domain name pointer localhost.
> > 
> > Und das ist aufgrund
> > 
> > mondschein:/etc/postfix> grep X-Spam header_checks
> > /^X-Spam-Flag:.YES/ REJECT Your mail appears to be spam
> > 
> > dann auch logisch.
> 
> Äh, bist Du sicher, dass Du wirklich "richtig" rejectest?
> Eigentlich sollte beim Reject der Reverse DNS komplett egal sein - der
> absendende Server bekommt die Mail nicht los und darf dann selbst einen
> Bounce generieren.

Hmmm, okay. Ich dachte bislang, dass das da oben ein REJECT ist.

> Für mich sieht das aus, als ob Du Backscatter generierst und Dich diese
> Bounces in seltenen Fällen ("localhost") dann selbst treffen.
> 
> Kannst Du das mal im Log nachsehen oder im Zweifelsfall den relevanten
> Logabschnitt zeigen? (Dann bitte auch postconf -n und die master.cf
> mitschicken.)

Hmmm, ob ich das noch hab. Hmm, da ist es:

Dec 27 11:40:11 mondschein postfix/smtpd[11172]: warning: hostname localhost does not resolve to address 117.0.201.94
Dec 27 11:40:11 mondschein postfix/smtpd[11172]: connect from unknown[117.0.201.94]
Dec 27 11:40:13 mondschein postfix/policyd-weight[5393]: decided action=PREPEND X-policyd-weight: passed - too many local DNS-errors in HELO A lookup for 53.202-in-addr.arpa-nettlinx.com; <client=unknown[117.0.201.94]> <helo=14.95.53.202-in-addr.arpa-nettlinx.com> <from=martin at lichtvoll.de> <to=martin at lichtvoll.de>; delay: 1s
Dec 27 11:40:13 mondschein postfix/smtpd[11172]: C4B3D24C: client=unknown[117.0.201.94]
Dec 27 11:40:14 mondschein postfix/cleanup[11175]: C4B3D24C: message-id=<5862A776.4147.4B18D8 at martin.lichtvoll.de>
Dec 27 11:40:14 mondschein postfix/qmgr[10788]: C4B3D24C: from=<martin at lichtvoll.de>, size=2320, nrcpt=2 (queue active)
Dec 27 11:40:14 mondschein spamd[4842]: spamd: connection from ip6-localhost [::1]:51194 to port 783, fd 5
Dec 27 11:40:14 mondschein spamd[4842]: spamd: setuid to debian-spamd succeeded
Dec 27 11:40:14 mondschein spamd[4842]: spamd: processing message <5862A776.4147.4B18D8 at martin.lichtvoll.de> for debian-spamd:120
Dec 27 11:40:14 mondschein postfix/smtpd[11172]: disconnect from unknown[117.0.201.94]
Dec 27 11:40:16 mondschein spamd[4842]: spamd: identified spam (17.1/8.0) for debian-spamd:120 in 1.7 seconds, 2252 bytes.
Dec 27 11:40:16 mondschein spamd[4842]: spamd: result: Y 17 - CK_HELO_DYNAMIC_SPLIT_IP,DATE_IN_FUTURE_06_12,HELO_DYNAMIC_SPLIT_IP,HTML_MESSAGE,PYZOR_CHECK,RCVD_IN_BRBL_LASTEXT,RCVD_IN_SBL_CSS,RCVD_IN_SORBS_DUL,RCVD_IN_SORBS_SPAM,RCVD_IN_XBL,RDNS_NONE,TO_EQ_FM_DIRECT_MX,T_SPF_HELO_TEMPERROR,URIBL_CR_SURBL scantime=1.7,size=2252,user=debian-spamd,uid=120,required_score=8.0,rhost=ip6-localhost,raddr=::1,rport=51194,mid=<5862A776.4147.4B18D8 at martin.lichtvoll.de>,autolearn=no autolearn_force=no
Dec 27 11:40:16 mondschein postfix/pipe[11176]: C4B3D24C: to=<martin2 at mondschein.lichtvoll.de>, orig_to=<martin at lichtvoll.de>, relay=spamassassin, delay=3.8, delays=2.1/0/0/1.7, dsn=2.0.0, status=sent (delivered via spamassassin service)
Dec 27 11:40:16 mondschein postfix/pipe[11176]: C4B3D24C: to=<martin at mondschein.lichtvoll.de>, orig_to=<martin at lichtvoll.de>, relay=spamassassin, delay=3.8, delays=2.1/0/0/1.7, dsn=2.0.0, status=sent (delivered via spamassassin service)
Dec 27 11:40:16 mondschein postfix/qmgr[10788]: C4B3D24C: removed

Hmmm, der scheint das zu bouncen:

Dec 27 11:40:16 mondschein postfix/pickup[10897]: 412285E4: uid=120 from=<martin at lichtvoll.de>
Dec 27 11:40:16 mondschein postfix/cleanup[11175]: 412285E4: message-id=<5862A776.4147.4B18D8 at martin.lichtvoll.de>
Dec 27 11:40:16 mondschein postfix/cleanup[11175]: 412285E4: reject: header X-Spam-Flag: YES from local; from=<martin at lichtvoll.de> to=<martin at mondschein.lichtvoll.de>: 5.7.1 Your mail appears to be spam

Das "from local" finde ich merkwürdig. Aber… hmmm… weil SpamAssassin die Mail
wieder in den Postfix reinpipt? Das würde heißen, dass meine Idee mit dem
Header-Check nicht so funktioniert, wie ich mir das dachte.

Dec 27 11:40:16 mondschein postfix/cleanup[11175]: 412285E4: to=<martin2 at mondschein.lichtvoll.de>, relay=none, delay=0.02, delays=0.02/0/0/0, dsn=5.7.1, status=bounced (Your mail appears to be spam)
Dec 27 11:40:16 mondschein postfix/cleanup[11175]: 412285E4: to=<martin at mondschein.lichtvoll.de>, relay=none, delay=0.02, delays=0.02/0/0/0, dsn=5.7.1, status=bounced (Your mail appears to be spam)


Ich bekam gerade einen Bounce-Report von einem Debian-Mailserver für eine
Spam-Mail von einer Debian-Mailingliste, die der an meinen Mailserver
ausliefert. Die Spam-Mail war natürlich nicht von Debian, aber der Debian-
Mailserver lieferte diese bei meinem Mailserver ein – daher denke ich
andererseits, dass das doch funktioniert mit dem REJECT.


Nun hier mal die Postconf.

mondschein:~> postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
delay_warning_time = 4h
disable_mime_input_processing = yes
header_checks = pcre:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT" -d "$USER"
mailbox_size_limit = 2000000000
message_size_limit = 20000000
mydestination = mondschein.lichtvoll.de, mondschein, localhost.localdomain, localhost
myhostname = mail.lichtvoll.de
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
smtp_bind_address = 194.150.191.11
smtp_sasl_auth_enable = no
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated reject_unknown_reverse_client_hostname
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = reject_invalid_helo_hostname
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_non_fqdn_recipient reject_unknown_recipient_domain reject_unauth_destination check_client_access hash:/etc/postfix/client_checks check_sender_access pcre:/etc/postfix/sender_checks check_policy_service inet:127.0.0.1:12525
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = reject_non_fqdn_sender
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/lichtvoll.de/fullchain.pem
smtpd_tls_dh1024_param_file = ${config_directory}/dh2048.pem
smtpd_tls_eecdh_grade = strong
smtpd_tls_key_file = /etc/letsencrypt/live/lichtvoll.de/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_use_tls = yes
strict_rfc821_envelopes = yes
virtual_alias_domains = lichtvoll.de […]
virtual_alias_maps = hash:/etc/postfix/virtual_domains
virtual_mailbox_limit = 2000000000

Ciao,
-- 
Martin



Mehr Informationen über die Mailingliste Postfixbuch-users