Control Web Panel
WebPanel => Postfix => Topic started by: umtu06 on September 24, 2024, 11:48:34 AM
-
Hello. I made the following settings but why is it blocking all attachments?
Why does it block all files including PDF?
main.cfg file content :
header_checks = pcre:/etc/postfix/header_checks
header_checks file content :
#(this working)
/^Subject:.*expires.*$/i DISCARD
# only allow .pdf but blocking all attachments? pdf file also blocked.
/^Content-Disposition:.*filename=.*\.pdf$/ OK
/^Content-Disposition:.*filename=.*$/ REJECT
Thanks in advance.
-
header_checks = regexp:/etc/postfix/header_checks
/name=[^>]*\.(exe|pif|com|dll|vbs|bat)/ REJECT
/name=[^>]*\.zip/ REJECT no ransomware for us, thanks anyway
/name=[^>]*\.pdf/ PASS PDFs are okay with us
-
Thanks for the answer. Instead of specifying the prohibited file extensions one by one, I would like to block all files except PDF. 8) Is it possible?
-
Try the following regular expression:
/name=[^>]*\.\w{3}(?<!pdf)/ REJECT attachments not allowed
or
/^Content-Disposition:.*filename=.*\.\w{3}(?<!pdf)/ REJECT attachments not allowed
However, you need to check the above rules very closely.