Disable Double Extension

Questions and answers about how to do stuff
Post Reply
bas60
Posts: 57
Joined: 04 Feb 2014 13:58

Disable Double Extension

Post by bas60 »

How do I diable double extensions !??

I tried this but the file is READ only so can't save it !
-------
The second (allow double file extenstions) is configured in /etc/Mailscanner/filename.rules.conf
Scroll all the way down and find the 2 lines:

# Deny all other double file extensions. This catches any hidden filenames.
deny \.[a-z][a-z0-9]{2,3}\s*\.[a-z0-9]{3}$ Found possible filename hiding Attempt to hide real filename extension

Just comment the deny out and restart Mailscanner.
-------------
freyuh
Posts: 62
Joined: 04 Oct 2018 11:21

Re: Disable Double Extension

Post by freyuh »

sudo <editor> <filename>
MattS
Posts: 20
Joined: 12 Dec 2017 14:00

Re: Disable Double Extension

Post by MattS »

I've been wrestling with allowing specific double extensions (*.com.pdf, *.com.pdf.zip) for the last couple of hours and no matter what format I try in /etc/Mailscanner/filename.rules.conf, I can't get it to _not_ block legitimate email attachments.

Thinking there must be some particularly arcane formatting for the allow rules I even went nuclear and, against my better judgement, commented out the entire "Deny all other double file extensions" rule at the bottom of the filename.rules.conf file. Doesn't see to have had any effect as the legitimate emails still fall foul of the rule and get blocked. And yes, I have saved the edited file and restarted the mailscanner service after each edit.

Hopefully you have better luck than me.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Disable Double Extension

Post by pdwalker »

On my system, if I comment out the rule, attachments pass correctly.

Can you share your specific message you're getting? Maybe we can debug what's happening to you.
Post Reply