Paul Schmehl via Postfix-users: > > On Jun 20, 2024, at 7:17?AM, Wietse Venema via Postfix-users > > <postfix-users@postfix.org> wrote: > > > > Paul Schmehl via Postfix-users: > >> Is there a place in postfix where I could discard mail if it has > >> a spam score higher than say 4 or 5? I know that postfix hands the > >> mail off to spamassassin for processing and then receives it back > >> for delivery, but I'm unclear what checks could be implemented to > >> catch spam and discard it. > >> > >> This is what I could match on: X-Spam-Status: Yes, score=2.1 > >> > >> If the score was higher than some number (e.g >4) than reject the mail. > > > > One could try some variant of /^X-Spam-Status: Yes, score=[5-9]/ > > Would this be in header_checks? I confess, I?m not clear on how > mail is handled after spamassassin returns it to Postfix. Does it > go all the way through the process again, beginning with header_checks?
That depends. If you use the "content_filter" feature then header_checks shold do it. If you use some Milter like rspamd then you need milter_header_checks. > If it?s header_checks, I would probably use something like /^X-Spam-Status: > Yes, score=[5-100[/ to catch everything above five. No. It's a regular expression, it does not compute that 5 is less than 100. Use a pattern from Viktor's post. Wietse _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org