From 10fc5e2f619b30e3c5d9b04b8c7c60d3f26610f6 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Sun, 12 May 2019 23:06:52 +0200 Subject: [PATCH] Implement attachment application/vnd.oasis.opendocument.text --- mbox2web | 47 ++++++++++--------- ...plication_vnd.oasis.opendocument.text.html | 9 ++++ 2 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 templates/attachment_application_vnd.oasis.opendocument.text.html diff --git a/mbox2web b/mbox2web index 1b2531e..f410283 100755 --- a/mbox2web +++ b/mbox2web @@ -76,29 +76,30 @@ 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/x-compressed-tar": ".tar.gz", + "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", + "application/vnd.oasis.opendocument.text": ".odt", }[content_type] name = msg.get_param("name") or "(data)" diff --git a/templates/attachment_application_vnd.oasis.opendocument.text.html b/templates/attachment_application_vnd.oasis.opendocument.text.html new file mode 100644 index 0000000..aff77d7 --- /dev/null +++ b/templates/attachment_application_vnd.oasis.opendocument.text.html @@ -0,0 +1,9 @@ +
+
+ application/vnd.oasis.opendocument.text +
+
+ {{name}} +
+
+