Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postfix access

2 views
Skip to first unread message

Ulli Horlacher

unread,
Aug 3, 2021, 2:44:43 PM8/3/21
to

Nachdem ich tausende von Spams via protection.outlook.com bekommen habe
und Microsoft (wie ueblich) Beschwerden ignoriert habe ich die Domain
gesperrt:

root@tandem:/etc/postfix# grep protection.outlook.com access
protection.outlook.com 521 550 E-mail rejected: protection.outlook.com is classified as a spammer domain

Das funktioniert auch :

root@tandem:/etc/postfix# grep protection.outlook.com /var/log/mail.log|head
2021-08-01 06:27:31 connect from mail-bn7nam10olkn2109.outbound.protection.outlook.com[40.92.40.109]
2021-08-01 06:27:32 NOQUEUE: reject: RCPT from mail-bn7nam10olkn2109.outbound.protection.outlook.com[40.92.40.109]: 521 5.7.1 <mail-bn7nam10olkn2109.outbound.protection.outlook.com[40.92.40.109]>: Client host rejected: 550 E-mail rejected: protection.outlook.com is classified as a spammer domain; from=<XXX...@msn.com> to=<fram...@flupp.org> proto=ESMTP helo=<NAM10-BN7-obe.outbound.protection.outlook.com>
2021-08-01 06:27:32 disconnect from mail-bn7nam10olkn2109.outbound.protection.outlook.com[40.92.40.109] ehlo=2 starttls=1 mail=1 rcpt=0/1 rset=1 commands=5/6
2021-08-01 06:37:34 connect from mail-mw2nam10olkn2075.outbound.protection.outlook.com[40.92.42.75]
2021-08-01 06:37:35 NOQUEUE: reject: RCPT from mail-mw2nam10olkn2075.outbound.protection.outlook.com[40.92.42.75]: 521 5.7.1 <mail-mw2nam10olkn2075.outbound.protection.outlook.com[40.92.42.75]>: Client host rejected: 550 E-mail rejected: protection.outlook.com is classified as a spammer domain; from=<XXX...@msn.com> to=<fram...@flupp.org> proto=ESMTP helo=<NAM10-MW2-obe.outbound.protection.outlook.com>
2021-08-01 06:37:35 disconnect from mail-mw2nam10olkn2075.outbound.protection.outlook.com[40.92.42.75] ehlo=2 starttls=1 mail=1 rcpt=0/1 commands=4/5
2021-08-01 06:47:37 connect from mail-dm6nam10olkn2068.outbound.protection.outlook.com[40.92.41.68]
2021-08-01 06:47:38 NOQUEUE: reject: RCPT from mail-dm6nam10olkn2068.outbound.protection.outlook.com[40.92.41.68]: 521 5.7.1 <mail-dm6nam10olkn2068.outbound.protection.outlook.com[40.92.41.68]>: Client host rejected: 550 E-mail rejected: protection.outlook.com is classified as a spammer domain; from=<XXX...@msn.com> to=<fram...@flupp.org> proto=ESMTP helo=<NAM10-DM6-obe.outbound.protection.outlook.com>
2021-08-01 06:47:38 disconnect from mail-dm6nam10olkn2068.outbound.protection.outlook.com[40.92.41.68] ehlo=2 starttls=1 mail=1 rcpt=0/1 commands=4/5


Leider ist mir genau DIESER Absender XXX...@msn.com wichtig, den moechte
ich gerne durchlassen.

http://www.postfix.org/access.5.html

Also hab ich noch ins access file geschrieben:

root@tandem:/etc/postfix# grep XXXXXX access
XXX...@msn.com OK

Und danach auch "make access.db" aufgerufen:

root@tandem:/etc/postfix# ll access*
-rw-r--r-- root root 62,214 2021-08-02 09:44:45 access
-rw-r--r-- root root 151,552 2021-08-02 09:44:52 access.db
-rw-r--r-- root root 20 2015-05-05 17:29:28 access_ok
-rw-r--r-- root root 12,288 2015-05-05 17:33:04 access_ok.db

root@tandem:/etc/postfix# grep access main.cf
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access_ok
check_client_access hash:/etc/postfix/access
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access

Leider funktioniert das nicht, XXX...@msn.com wird weiterhin
abgewiesen, egal ob die OK-Regel am Anfang oder Ende vom access file steht.

Ich hab dann noch die OK-Regel nach access_ok geschrieben:

root@tandem:/etc/postfix# cat access_ok
127.0.0.1 OK
XXX...@msn.com OK

root@tandem:/etc/postfix# make
postmap hash:access
postmap hash:access_ok

Wird allerdings immer noch abgewiesen:

root@tandem:/etc/postfix# grep XXXXXX /var/log/mail.log|tail -2
2021-08-02 10:10:28 NOQUEUE: reject: RCPT from mail-mw2nam08olkn2041.outbound.protection.outlook.com[40.92.46.41]: 521 5.7.1 <mail-mw2nam08olkn2041.outbound.protection.outlook.com[40.92.46.41]>: Client host rejected: 550 E-mail rejected: protection.outlook.com is classified as a spammer domain; from=<XXX...@msn.com> to=<fram...@flupp.org> proto=ESMTP helo=<NAM04-MW2-obe.outbound.protection.outlook.com>
2021-08-02 10:12:17 NOQUEUE: reject: RCPT from mail-mw2nam08olkn2105.outbound.protection.outlook.com[40.92.46.105]: 521 5.7.1 <mail-mw2nam08olkn2105.outbound.protection.outlook.com[40.92.46.105]>: Client host rejected: 550 E-mail rejected: protection.outlook.com is classified as a spammer domain; from=<XXX...@msn.com> to=<fram...@tandem-fahren.de> proto=ESMTP helo=<NAM04-MW2-obe.outbound.protection.outlook.com>

Was hab ich uebersehen oder falsch gemacht?


--
+ Ulli Horlacher + fram...@tandem-fahren.de + http://tandem-fahren.de/ +

Thomas Hochstein

unread,
Aug 3, 2021, 3:15:03 PM8/3/21
to
Ulli Horlacher schrieb:

> Subject: postfix access

Disclaimer: Ich kenne mich mit Postfix praktisch nicht aus; ich habe
nur die Doku gelesen.

> Was hab ich uebersehen oder falsch gemacht?

| Delayed evaluation of SMTP access restriction lists
[...]
| Restriction lists are still evaluated in the proper order of (client,
| helo, etrn) or (client, helo, sender, relay, recipient, data, or
| end-of-data) restrictions. When a restriction list (example: client)
| evaluates to REJECT or DEFER the restriction lists that follow
| (example: helo, sender, etc.) are skipped.
<http://www.postfix.org/SMTPD_ACCESS_README.html>

Wenn ich das richtig verstehe, wird zuerst smtpd_client_restrictions
ausgewertet. Das führt bei Dir zu einem REJECT wegen des Hostnamens
(Reverse-Lookups) der IP-Afresse; damit ist das Thema durch. Die
normalerweise später geprüften smtpd_sender_restrictions werden gar
nicht mehr ausgewertet; erst da ist aber das MAIL FROM überhaupt
bekannt. Man kann also bei einem Block auf IP-Ebene Ausnahmen für
bestimmte IP-Adressen vorsehen, aber nicht bestimmte Absenderadressen
ausnehmen, weil die zu diesem Zeitpunkt noch nicht bekannt sind und
die Entscheidung bei einem REJECT/DEFER endgültig fällt.

Ob und wie es mit Postfix möglich ist, Mails von bestimmten IPs (hier:
IPs mit bestimmtem Reverse-Lookup) nicht zu rejecten, sondern das nur
vorzumerken, so dass man dann später den MAIL FROM auswerten und
bestimmte Mails abweichend doch akzeptieren kann, kann ich nicht
sagen; auf Anhieb habe ich jedenfalls keine einfache Lösung in der
Doku gefunden. Vermutlich bräuchte man so etwas wie einen Milter?

-thh
--
Informationen rund um E-Mail und Mailserver:
<https://th-h.de/net/mail/>

Matthias Andree

unread,
Aug 4, 2021, 5:53:05 AM8/4/21
to
Am 03.08.21 um 21:14 schrieb Thomas Hochstein:
Thomas' Begründung passt - allerdings blockiert protection.outlook.com
auch legitime Firmenabsender... wenn Ulli das braucht?

Für die UND-Verknüpfung zweier Checks in so einfachen Fällen kann man
smtpd_restriction_classes [1] verwenden; wenn's aber viele Regeln gibt,
ist ein externer policy-daemons wie z. B. https://postfwd.org/ wohl
handhabbarer.
[1] http://www.postfix.org/RESTRICTION_CLASS_README.html

Entwurf für restriction classes:

1. In /etc/postfix/main.cf:

smtpd_restriction_classes = outlook_com
outlook_com = check_sender_access
hash:/etc/postfix/access_outlook_com_permitted
static:{554 5.7.1 E-mail rejected: protection.outlook.com
is classified as a spammer domain}
smtpd_sender_restrictions =
...
reject_unauth_destination
check_client_access hash:/etc/postfix/access
...

2. In /etc/postfix/access:
protection.outlook.com outlook_com

3. In /etc/postfix/access_outlook_com_permitted:
XXX...@msn.com OK

4. das übliche postmap/postfix reload.

Einschränkung: Das alles unterstellt, dass von Sendern mit Hostnamen
*outlook.com keine gefälschten @msn.com-Absender kommen können.

Hinweis: Das 521 550 in Ullis Originalkonfiguration ist Grütze. Weder
braucht's bei outlook.com 521 + drop, noch würde Postfix das 550
verwenden (siehe Logs - es antwortet ja mit 521 5.7.1 und übernimmt die
550 als Payload-Text).

Thomas Hochstein

unread,
Aug 4, 2021, 8:00:04 AM8/4/21
to
Matthias Andree schrieb:

> Thomas' Begründung passt - allerdings blockiert protection.outlook.com
> auch legitime Firmenabsender... wenn Ulli das braucht?

Naja, Framstag ist lange genug im Netz, dass ich unterstelle, dass er
weiß, was er da tut (und dass natürlich viele Anbieter, Firmen, auch
Behörden im weiteren Sinne die Mailinfrastruktur von entweder Google
oder Microsofrt nutzen).

> Für die UND-Verknüpfung zweier Checks in so einfachen Fällen kann man
> smtpd_restriction_classes [1] verwenden; [...]

Wieder was gelernt, danke! :)
0 new messages