Commit Graph

31 Commits

Author SHA1 Message Date
Peter J. Holzer 5294100b2c Handle multipart/related
For multipart related we need to be able to reference the other parts
from the root part by content-id, so we need to pass an argument with
the necessary information (imaginatively called "extra") to the render
function. Of course since this is called indirectly, every render
function needs to accept an extra argument, even if only
render_text_html uses it.
2019-03-31 23:48:57 +02:00
Peter J. Holzer 2a3e5622f3 Handle ms-tnef attachments
Like other attachments, just create a download link, don't try to parse
them.
2019-03-31 21:50:08 +02:00
Peter J. Holzer f543dbc5c8 Handle (old style) MS-Word attachments 2019-03-31 21:15:31 +02:00
Peter J. Holzer 08784b70fe Handle Perl attachments 2019-03-31 21:03:03 +02:00
Peter J. Holzer 0db91aaa5f Handle C attachments 2019-03-31 20:51:52 +02:00
Peter J. Holzer b2f56c1660 Handle underline in text/enriched 2019-03-17 22:42:44 +01:00
Peter J. Holzer 8acf092559 Fixed return values of all the new render functions
Oops. I should really check the output of the script, not just whether
it crashes in the expected place.
2019-03-17 22:30:27 +01:00
Peter J. Holzer 45848a73ae Handle multipart types that aren't 2019-03-17 22:24:17 +01:00
Peter J. Holzer b053ab454f Refactor render_body to handle each mime-type in a nested function
This replaces the giant elif cascade with a table lookup. It also allows
me to call one function from another.
2019-03-17 22:17:02 +01:00
Peter J. Holzer d5c5368bad Implement more text/enriched tags: nofill, param, ...
Nofill and param are handled specially by the parser. The parser now
also tolerates missing end tags.

Handle quite a few tags on output including some (like color and
fontfamily) that use a param.
2019-03-16 21:53:06 +01:00
Peter J. Holzer a997542cfe Handle image/gif (inline)
Inline images are very similar to attachments: We just want to store
them somewhere and refer to them. But we want to use a different element
(<img> instead of <a>) or more generally, a different template. So we
pass the disposition as an additional argument to save_part and use it
to construct the template name - which gives as a flurry of new
templates.
2019-03-10 23:27:30 +01:00
Peter J. Holzer df7fcb5777 Handle message/news 2019-03-10 22:47:10 +01:00
Peter J. Holzer d32c60a318 Handle plaintext and gzipped attachments 2019-03-04 21:49:46 +01:00
Peter J. Holzer 48fcf768ae "Handle" a detached pgp signature
Don't even ignore it (be sarcastic about it).
2019-03-04 21:23:03 +01:00
Peter J. Holzer 314ccaba48 Handle blockquote element and type attribute 2019-03-04 21:07:18 +01:00
Peter J. Holzer 77d2b87b1e Handle multipart/alternative and application/x-unknown-content-type-scpfile
Strange combination, but the first message with multipart/alternative
also contained a .scp file and not as an attachment.

The template for multipart/alternative allows switching between the
alternatives.
2019-03-02 23:33:39 +01:00
Peter J. Holzer a737ce1760 Handle application/pgp 2019-03-02 12:24:56 +01:00
Peter J. Holzer 9f44375354 Save all attachments to separate files
For now we just save them unmodified and give them an extension that
will cause the web server to provide the correct content-type. This is
probably *not safe*: A user could send malicious html as an attachment
and the browser will interpret it when another user clicks on the link.
We might try to sanitize attachments (but you would normally expect an
attachment to be preserved) or to preserve the content-dispostion header
(but I don't think this is possible with just a static archive).
2019-03-02 12:10:01 +01:00
Peter J. Holzer 48ea68eaef Don't require <base> tag 2019-03-01 22:52:41 +01:00
Peter J. Holzer 7f5ffdde0b Handle <ol> and <u> tags 2019-03-01 22:52:07 +01:00
Peter J. Holzer 1a0ce4a967 Decode html parts correctly 2019-03-01 22:51:06 +01:00
Peter J. Holzer 36a640857c Handle <ul> and <li> in html messages 2019-03-01 13:54:37 +01:00
Peter J. Holzer ea60f484a3 Handle PGP signed messages 2019-03-01 13:54:13 +01:00
Peter J. Holzer 02368a57f8 Handle application/octet-stream 2019-03-01 11:58:22 +01:00
Peter J. Holzer fbce052c69 Decode text/plain correctly 2019-03-01 11:57:55 +01:00
Peter J. Holzer 23a6ea4716 Wrap text/html and text/enriched in templates 2019-03-01 11:13:09 +01:00
Peter J. Holzer d1dc1db853 Handle some more html tags and attributes 2019-03-01 10:21:57 +01:00
Peter J. Holzer b5c979d5cb Add support for message/partial
This doesn't handle the case where total isn't present on all parts, but
I don't actually expect to encounter that (and if I do, it will crash
and I can fix it).
2019-02-28 17:17:44 +01:00
Peter J. Holzer d5e557e8e4 Make encoded message id html-safe
Exclude & and ' from list of allowed characters, so that the encoded
message id can be used unescaped.
2019-02-28 17:16:05 +01:00
Peter J. Holzer 341d5dd229 Add support for text/html and text/enriched 2019-02-28 09:30:47 +01:00
Peter J. Holzer b238c56edb Convert mbox files to standalone html files
No thread or date structure, just one isolated file per message.
Only text/plain and some multipart formats
2019-02-03 18:44:50 +01:00