diff options
author | W. Trevor King <wking@drexel.edu> | 2010-02-02 12:37:32 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-02-02 12:37:32 -0500 |
commit | 907d5f0887f52b6bb718d4ff2a58d3d214c480f8 (patch) | |
tree | 14a855fff9f5f7a06f729000cddb2b50ae45d38d /misc/xml/be-xml-to-mbox | |
parent | d98052a067923616efd3a27626dca29301d74246 (diff) | |
download | bugseverywhere-907d5f0887f52b6bb718d4ff2a58d3d214c480f8.tar.gz |
Fix be-xml-to-mbox handling of non-text/* content types
Diffstat (limited to 'misc/xml/be-xml-to-mbox')
-rwxr-xr-x | misc/xml/be-xml-to-mbox | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/misc/xml/be-xml-to-mbox b/misc/xml/be-xml-to-mbox index e2c8700..c8b7479 100755 --- a/misc/xml/be-xml-to-mbox +++ b/misc/xml/be-xml-to-mbox @@ -91,7 +91,8 @@ class Bug (LimitedAttrDict): print "Message-id: <%s@%s>" % (self["uuid"], DEFAULT_DOMAIN) print "Date: %s" % self["created"] print "From: %s" % self["creator"] - print "Content-Type: %s; charset=%s" % ("text/plain", DEFAULT_ENCODING) + print "Content-Type: %s; charset=%s" \ + % ("text/plain", DEFAULT_ENCODING) print "Content-Transfer-Encoding: 8bit" print "Subject: %s: %s" % (self["short-name"], self["summary"]) if "extra-strings" in self: @@ -168,11 +169,13 @@ class Comment (LimitedAttrDict): print "X-Extra-String: %s" % estr if self["content-type"].startswith("text/"): print "Content-Transfer-Encoding: 8bit" - print "Content-Type: %s; charset=%s" % (self["content-type"], DEFAULT_ENCODING) - print "" - print self["body"] - else: # content type and transfer encoding already in XML MIME output - print self["body"] + print "Content-Type: %s; charset=%s" \ + % (self["content-type"], DEFAULT_ENCODING) + else: + print "Content-Transfer-Encoding: base64" + print "Content-Type: %s;" % (self["content-type"]) + print "" + print self["body"] print "" def init_from_etree(self, element): assert element.tag == "comment", element.tag |