Handle some more attachment types (some of them bogus)
This commit is contained in:
parent
8d78b2ec26
commit
a44ff7ee4b
6
mbox2web
6
mbox2web
|
@ -88,6 +88,11 @@ def save_part(msg, disposition):
|
||||||
"application/ms-tnef": ".ms-tnef",
|
"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-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-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",
|
||||||
}[content_type]
|
}[content_type]
|
||||||
|
|
||||||
name = msg.get_param("name") or "(data)"
|
name = msg.get_param("name") or "(data)"
|
||||||
|
@ -333,6 +338,7 @@ def render_body(msg, extra=None):
|
||||||
"message/news": render_message_news,
|
"message/news": render_message_news,
|
||||||
"image/gif": render_image_gif,
|
"image/gif": render_image_gif,
|
||||||
"multipart/related": render_multipart_related,
|
"multipart/related": render_multipart_related,
|
||||||
|
"application/x-java-vm": render_application_octet_stream,
|
||||||
}
|
}
|
||||||
content_type = msg.get_content_type()
|
content_type = msg.get_content_type()
|
||||||
content_disposition = msg.get_content_disposition()
|
content_disposition = msg.get_content_disposition()
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="partouter">
|
||||||
|
<div class="partheader">
|
||||||
|
application/pgp-keys
|
||||||
|
</div>
|
||||||
|
<div class="partinner">
|
||||||
|
<a href="{{url}}">{{name}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="partouter">
|
||||||
|
<div class="partheader">
|
||||||
|
application/x-gzip
|
||||||
|
</div>
|
||||||
|
<div class="partinner">
|
||||||
|
<a href="{{url}}">{{name}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="partouter">
|
||||||
|
<div class="partheader">
|
||||||
|
application/x-java-vm
|
||||||
|
</div>
|
||||||
|
<div class="partinner">
|
||||||
|
<a href="{{url}}">{{name}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="partouter"> 1000
|
||||||
|
<div class="partheader">
|
||||||
|
image/png
|
||||||
|
</div>
|
||||||
|
<div class="partinner">
|
||||||
|
<a href="{{url}}">{{name}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="partouter"> 1000
|
||||||
|
<div class="partheader">
|
||||||
|
image/png
|
||||||
|
</div>
|
||||||
|
<div class="partinner">
|
||||||
|
<a href="{{url}}">{{name}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in New Issue