diff --git a/mbox2web b/mbox2web index 84c9a6b..1b2531e 100755 --- a/mbox2web +++ b/mbox2web @@ -76,28 +76,29 @@ def render_message(msg): def save_part(msg, disposition): content_type = msg.get_content_type() extension = { - "application/octet-stream": ".bin", - "text/html": ".html", - "text/x-vcard": ".vcf", - "text/plain": ".txt", - "application/x-gzip": ".gz", # more likely tar.gz, but we can't know without looking into it which we ain't - "image/gif": ".gif", - "text/x-c": ".c", - "application/x-perl": ".pl", - "application/msword": ".doc", - "application/ms-tnef": ".ms-tnef", - "application/x-bzip2": ".bz2", # more likely tar.bz2, but we can't know without looking into it which we ain't - "application/x-shellscript": ".sh", - "application/x-java-vm": ".bin", # The only instances are mis-labelled - "image/png": ".png", - "application/pgp-keys": ".pgp", - "application/x-gunzip": ".gz", # that sort of makes sense, but not really - "image/jpeg": ".jpg", - "text/x-python": ".py", - "text/x-java": ".java", - "application/x-sh": ".sh", - "text/x-patch": ".patch", - "text/x-c++src": ".c++", + "application/octet-stream": ".bin", + "text/html": ".html", + "text/x-vcard": ".vcf", + "text/plain": ".txt", + "application/x-gzip": ".gz", # more likely tar.gz, but we can't know without looking into it which we ain't + "image/gif": ".gif", + "text/x-c": ".c", + "application/x-perl": ".pl", + "application/msword": ".doc", + "application/ms-tnef": ".ms-tnef", + "application/x-bzip2": ".bz2", # more likely tar.bz2, but we can't know without looking into it which we ain't + "application/x-shellscript": ".sh", + "application/x-java-vm": ".bin", # The only instances are mis-labelled + "image/png": ".png", + "application/pgp-keys": ".pgp", + "application/x-gunzip": ".gz", # that sort of makes sense, but not really + "image/jpeg": ".jpg", + "text/x-python": ".py", + "text/x-java": ".java", + "application/x-sh": ".sh", + "text/x-patch": ".patch", + "text/x-c++src": ".c++", + "application/x-compressed-tar": ".tar.gz", }[content_type] name = msg.get_param("name") or "(data)" @@ -364,6 +365,7 @@ def render_body(msg, extra=None): "multipart/related": render_multipart_related, "application/x-java-vm": render_application_octet_stream, "image/jpeg": render_image_jpeg, + "application/x-compressed-tar": render_application_octet_stream, } content_type = msg.get_content_type() content_disposition = msg.get_content_disposition() diff --git a/templates/attachment_application_x-compressed-tar.html b/templates/attachment_application_x-compressed-tar.html new file mode 100644 index 0000000..cf1ee16 --- /dev/null +++ b/templates/attachment_application_x-compressed-tar.html @@ -0,0 +1,9 @@ +
+
+ application/x-compressed-tar +
+
+ {{name}} +
+
+