diff --git a/lib/email_listing.py b/lib/email_listing.py index ad1b4e11a..9ea457c1e 100644 --- a/lib/email_listing.py +++ b/lib/email_listing.py @@ -152,6 +152,8 @@ class Email(object): self.__parse(msg) + print "mf : %s, df : %s" % (mformat, dformat) + if not self.contents.has_key(mformat) or self.contents[mformat] == "": # Fallback self.mformat = mformat == "html" and "plain" or "html" @@ -280,8 +282,7 @@ class Email(object): }) def viewmail_plain(self, content, **kwargs): - return self.dformat == "html" and "
%s
" % content \ - or content + return "
%s
" % content def viewmail_html(self, content, **kwargs): if content is None or content == "": diff --git a/templates/common/viewmail.html b/templates/common/viewmail.html index 7f64d2539..8221b2fcf 100644 --- a/templates/common/viewmail.html +++ b/templates/common/viewmail.html @@ -10,6 +10,13 @@ body { margin: 5px; } + pre { + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ + } #mailcontent { width: 100%; border: 0px transparent none;