From 24431b34393f17240d12fe55f7ce4615178bac8b Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 4 Feb 2011 10:39:47 +0100 Subject: [PATCH] fixed #80 The real problem was due to the use of a
 tag to display plaintext messages. By default, it does not automatically cut long lines as with other tags. Some CSS stuff fixed the problem.

Fixed bad behaviour on some combinations between display mode and message available formats. (ie. plain/text or plain/html)
---
 lib/email_listing.py           | 5 +++--
 templates/common/viewmail.html | 7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

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;