Phil Stracchino via Postfix-users:
> On 2/11/25 16:26, Wietse Venema via Postfix-users wrote:
> > Phil Stracchino via Postfix-users:
> >> On 2/11/25 14:53, Phil Stracchino wrote:
> >>> On 2/11/25 14:48, Florian Piekert wrote:
> >>>> Amazon.com in the filename.
> >>>>
> >>>> .com extension.
> >>>>
> >>>>>
> >>>>> /name=[^>]*\.(bat|com|exe|dll|vbs|xls|zip)/ REJECT
> >>>
> >>>
> >>> I imagine I should make that regexp:
> >>>
> >>> /name=[^>]*\.(bat|com|exe|dll|vbs|xls|zip)\b/
> >>>
> >>> (should a \b work here?)
> >>
> >> actually $ would be better than a \b, wouldn't it?
> >
> > Please have a look at the exmaple in
> > https://www.postfix.org/header_checks.5.html#examples
Specifically, the first example at the above URL:
/etc/postfix/header_checks.pcre:
/^Content-(Disposition|Type).*name\s*=\s*"?([^;]*(\.|=2E)(
ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
hlp|ht[at]|
inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
\{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}|
ops|pcd|pif|prf|reg|sc[frt]|sh[bsm]|swf|
vb[esx]?|vxd|ws[cfh]))(\?=)?"?\s*(;|$)/x
REJECT Attachment name "$2" may not end with ".$4"
It does not have your problem with .com in the middle of a string.
Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]