possible file detection bug

Mark Sapiro mark at msapiro.net
Wed Oct 5 16:40:19 UTC 2016


On 10/05/2016 06:48 AM, Tiago Meireles wrote:
> Mark,
> 
> It is easily avoided by not using spaces correct?


It's not that simple. The spaces don't cause a problem per se as they
get squeezed out, but there are other characters besides spaces that can
cause problems, and even if there are none of these, if the length of
the name is > 50 characters, that's an issue.

I actually tried testing both

"Test 128 Screen File(9-20-16).screen-bin"
and
"Test_128_Screen_File(9-20-16).screen-bin"

and in both cases the name wasn't truncated. In the first case, the
resultant safe name was "Test128ScreenFile(9-20-16).screen-bin" and in
the second it was "Test_128_Screen_File(9-20-16).screen-bin"

I don't know why it was truncated in your case unless the code in your
MailScanner is different from that at
<https://github.com/MailScanner/v5/blob/master/common/usr/share/MailScanner/perl/MailScanner/Message.pm>,
or perhaps in your case the original name was not ascii or different
from "Test 128 Screen File(9-20-16).screen-bin".

In any case, the easiest avoidance is to use names which do not have
pseudo extensions that truncate to bad extensions. E,g., instead of
"Test 128 Screen File(9-20-16).screen-bin", use a name like "Test 128
Screen File(9-20-16)_screen-bin"

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the MailScanner mailing list