A long gap in a name is often used to hide part of it {Scanne d by HJMS}
Antony Stone
Antony at SOFT-SOLUTIONS.CO.UK
Sat Sep 13 16:01:45 IST 2003
On Saturday 13 September 2003 3:06 pm, Julian Field wrote:
> At 14:58 13/09/2003, you wrote:
> >On Saturday 13 September 2003 2:35 pm, Julian Field wrote:
> > > This is because you are seeing the truncated "sanitised" version of the
> > > filename, not the original name. If you check in the MIME headers of
> > > the original message, you will probably see the real filename as being
> > > much longer.
> >
> >Just out of interest, what does this "sanitisation" consist of?
> >
> >I'm happy with a pointer to the code if that's the easiest way to explain
> > :)
>
> See sub exorcise_filename in Message.pm.
I think I'll attempt an explanation in English here for those who don't read
Perl - it might be useful to anyone who comes across a similar problem to the
one Martin Sapsed reported.
MailScanner takes the original attachment filename (discarding the pathname)
and throws away everything *except* the characters A-Z, a-z, 0-9, %(){},._=+-
space or Ascii codes 0x80-0xFF, then deletes all leading and trailing spaces,
and finally truncates the filename (the bit before the final dot) to 14
characters, and the extension (the bit after the final dot) to 3 characters.
If the original filename contained any unacceptable characteristics (leading
spaces, trailing spaces, trailing dots, or any characters not in the above
list), then the translated / truncated filename is what appears in the
reports; otherwise the full filename is used.
Hence:
a) You will see characters missing from filenames if the original attachment
filename contained anything except A-Za-z0-9%(){},._=+- space or Ascii
0x80-0xFF. A good example of such characters which people put into
filenames would be [ or ]
b) You will see truncated filenames for any attachments which originally had
any characters except the above, or leading / trailing spaces, or trailing
dots, and after removing these, the result had more than 14 characters before
the final dot, or more than 3 characters after the final dot
By the way, the comments in Message.pm don't entirely match up with the code,
so I've taken the above description from the code :)
Hope this helps someone out there :)
Antony.
--
Abandon hope, all ye who enter here.
You'll feel much better about things once you do.
More information about the MailScanner
mailing list