Filename reporting issue - was: Filename enconding in auto-zip feature

Jules Field MailScanner at ecs.soton.ac.uk
Wed Sep 30 17:02:04 IST 2009



On 30/09/2009 16:39, Mark Sapiro wrote:
> On Wed, Sep 30, 2009 at 09:16:57AM +0100, Julian Field wrote:
>    
>> I have just tried it out with a message with 3 file attached to it:
>>      Nasty&  horrible.doc .doc
>>      Nasty&horrible.doc .doc
>>      Nasty&horrible.doc.zip
>> and in all cases it behaves just the way I would expect it to.
>>
>> Other than the filenames reported, what do you actually think is going
>> wrong?
>>      
>
> Nothing, but the file name reporting is the problem. If the name contains
> an ampersand or perhaps other characters that are turned into %nn, in some
> cases, the 'first extension' will be dropped entirely in the report. For
> example, in the test mail I sent in the zip file attached to the message
> archived at
> <http://lists.mailscanner.info/pipermail/mailscanner/2009-September/093341.html>
> the names "Motion&  Order.txt   .doc" and "Motion&  Order.doc   .doc" are
> reported as
>
>     MailScanner: Attempt to hide real filename extension (Motion %26 Order.doc)
>
> leaving the recipient and the mail admin wondering how that name triggered
> that rule.
>
> I don't have any problem with certain characters being escaped as %nn,
> but I do think that dropping pieces of the name, in particular in some
> cases entire 'extensions' is a problem.
>    
It all depends on the length of the filename after the last filename 
extension has been removed. This is truncated at a fixed point. So some 
other "extensions" may be lost. I'm not sure there is any easy way, 
heuristically, of trimming the filename while leaving *all* the 
extensions, as it's unknown what is and is not an extension, and what is 
just a dot in the middle of the text of the "main" bit of the filename.

Julian.Field.doc
JulianField.docx.doc
Julian.Field.docx.doc

What's an extension and what isn't?

Jules

-- 
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM and twitter.com/MailScanner


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list