While handling attachments upas/marshal first looks at the file extension which it matches against a built-in list and then against the system mimelist. Both of those currently contain only single-component extensions such as '.tgz' but marshal uses anything after the first '.' in the name as an extension, probably in anticipation for '.tar.gz' and similar. This patch changes marshal to match the last '.' delimited component.