Merged my cleanup of Gianluca's HTML branch.
authorW. Trevor King <wking@drexel.edu>
Tue, 20 Oct 2009 13:38:17 +0000 (09:38 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 20 Oct 2009 13:38:17 +0000 (09:38 -0400)
commitc80312557917015fcda9f7baa9e1acdce8ad9de7
treea12410e78c028ce2b6cd1d880e860fb843e280c7
parenta808d2f4f0d91c049da826480f9d0fe7f0848b1c
parent74864cbce9ded7764e05647d5433fc7c9958e22a
Merged my cleanup of Gianluca's HTML branch.

This fixes a bug in binary comments (non-"text/" content-types), where
the content-type wasn't being set until _after_ the save was
attempted.  This led to errors for non-ascii bodies (e.g. images with
null characters).

Note that text/html comments are included as is, so make sure they are
formatted appropriately to fit into your tempate without creating
invalid code.  This issue could be a real pain in the neck, especially
when including text/html email bodies, which might contain <body>
tags, etc..  Stupid email clients that don't send a text/plain
alternative...