Re: header_checks and regexes

2022-05-01 Thread Viktor Dukhovni
On Sun, May 01, 2022 at 03:54:16PM -0400, Alex wrote: > > Conditional header checks require a milter or content filter that > > can make such fine distinctions. Postfix built-in header checks > > are global. > > I need to find a way to have different policies for different domains > on the same

Re: header_checks and regexes

2022-05-01 Thread Alex
Hi, On Thu, Mar 10, 2022 at 5:23 PM Viktor Dukhovni wrote: > > > On 10 Mar 2022, at 3:48 pm, Alex wrote: > > > > Can I use sender_checks to bypass a host like mail.coupahost.com? The > > client IP will constantly change, but I can rely on the sending domain > > to remain the same. > > Conditiona

Re: header_checks and regexes

2022-03-10 Thread Viktor Dukhovni
> On 10 Mar 2022, at 3:48 pm, Alex wrote: > > Can I use sender_checks to bypass a host like mail.coupahost.com? The > client IP will constantly change, but I can rely on the sending domain > to remain the same. Conditional header checks require a milter or content filter that can make such fine

Re: header_checks and regexes

2022-03-10 Thread Alex
Hi, I now have these mime_header_checks working properly, but it turns out there are companies sending legitimate invoices as HTML attachments, ugh. Mar 8 07:49:05 xavier postfix-118/cleanup[2084042]: C01C310024593: reject: header Content-Disposition: attachment;? filename=purchase_order.html fr

Re: header_checks and regexes

2022-03-04 Thread Alex
Hi, > > I believe there's a dot missing in the first one, as in '.(386' but > > it's more than that, because I experimented with that too. > > No, it would have to be: \.(386|...) > otherwise '.' just matches any character. Your RE pattern is sloppy > in places, ... correct REs take some care.

Re: header_checks and regexes

2022-03-03 Thread Viktor Dukhovni
> On 3 Mar 2022, at 10:06 pm, Alex wrote: > > I believe there's a dot missing in the first one, as in '.(386' but > it's more than that, because I experimented with that too. No, it would have to be: \.(386|...) otherwise '.' just matches any character. Your RE pattern is sloppy in places,

Re: header_checks and regexes

2022-03-03 Thread Alex
Hi, > > It's still not working, and I suspect the reason is that I somehow > > screwed up when I pasted it. Can I ask you to take a look at the > > attached? > > I don't see any rules below that would do that. There's a rule > for "mhtml" files, and a rule for ".pdf.html" files, but I fail > to s

Re: header_checks and regexes

2022-03-03 Thread Viktor Dukhovni
On Thu, Mar 03, 2022 at 06:04:43PM -0500, Alex wrote: > > > Content-Type: text/html; charset="US-ASCII"; name="download.html" > > > Content-Disposition: attachment; filename="download.html" It seems you're trying to block "mumble.html" attachments. > It's still not working, and I suspect the rea

Re: header_checks and regexes

2022-03-03 Thread Alex
Hi Viktor, > > Content-Type: text/html; charset="US-ASCII"; name="download.html" > > Content-Disposition: attachment; filename="download.html" > > > > And this is the regex I currently have. Hopefully it wraps properly. > > > /^Content-(Disposition|Type):\s+.+?(?:file)?name="?.+?\(386|exe|ad[ept]|

Re: header_checks and regexes

2022-03-02 Thread Viktor Dukhovni
On Wed, Mar 02, 2022 at 08:57:51PM -0500, Alex wrote: > Content-Type: text/html; charset="US-ASCII"; name="download.html" > Content-Disposition: attachment; filename="download.html" > > And this is the regex I currently have. Hopefully it wraps properly. > /^Content-(Disposition|Type):\s+.+?(?:f