Discussion:
[imp] IMP displays both Plaintext and HTML
Jens Pranaitis
2012-08-22 12:06:07 UTC
Permalink
Hello list,
I'm having some trouble getting IMP to behave like it did with Horde3
with regard to HTML mails. With Horde3 when receiving a mail containing
both plain-text and HTML only the HTML part is displayed (however the
plain-text part is readable as an attachment). In Horde4 and IMP5 both
parts are displayed underneath each other. Is there any way I can get
Horde to only display the HTML part (if available) without breaking
display of plain-text-only messages? I'd really appreciate your help on
this subject.

I'm running IMP 5.0.23 and Horde 4.0.15. I enabled HTML by creating
imp/config/mime_drivers.local.php with the following content:

<?
$mime_drivers = array(
'html' => array(
'inline' => true,
'handles' => array(
'text/html'
),
'icons' => array(
'default' => 'html.png'
),
'limit_inline_size' => 1048576,
'phishing_check' => true
)
);
?>

Kind regards,
Jens Pranaitis
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
Michael M Slusarz
2012-08-22 15:47:46 UTC
Permalink
Post by Jens Pranaitis
Hello list,
I'm having some trouble getting IMP to behave like it did with
Horde3 with regard to HTML mails. With Horde3 when receiving a mail
containing both plain-text and HTML only the HTML part is displayed
(however the plain-text part is readable as an attachment). In
Horde4 and IMP5 both parts are displayed underneath each other. Is
there any way I can get Horde to only display the HTML part (if
available) without breaking display of plain-text-only messages? I'd
really appreciate your help on this subject.
This would happen if the message is not a multipart/alternative
message and is, instead, separate text/html and text/plain messages.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]
Jens Pranaitis
2012-08-23 07:53:00 UTC
Permalink
This would happen if the message is not a multipart/alternative message
and is, instead, separate text/html and text/plain messages.
I'm quite sure this isn't the case. The message source sets
"Content-Type: multipart/alternative". The E-Mail was generated by Horde
3, IMP 4.3.11.
michael
Kind regards,
Jens Pranaitis
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
Jens Pranaitis
2012-08-29 07:51:44 UTC
Permalink
Post by Jens Pranaitis
This would happen if the message is not a multipart/alternative message
and is, instead, separate text/html and text/plain messages.
I'm quite sure this isn't the case. The message source sets
"Content-Type: multipart/alternative". The E-Mail was generated by Horde
3, IMP 4.3.11.
Any other suggestions to fix this problem? This is kind of a show
stopper for us. We'll probably have to delay our migration to Horde 4 if
we can't find out whether this is a bug or some misconfiguration on our
side.

Kind regards,
Jens Pranaitis
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
Jan Schneider
2012-08-29 09:55:17 UTC
Permalink
Post by Jens Pranaitis
Post by Jens Pranaitis
This would happen if the message is not a multipart/alternative message
and is, instead, separate text/html and text/plain messages.
I'm quite sure this isn't the case. The message source sets
"Content-Type: multipart/alternative". The E-Mail was generated by Horde
3, IMP 4.3.11.
Any other suggestions to fix this problem? This is kind of a show
stopper for us. We'll probably have to delay our migration to Horde
4 if we can't find out whether this is a bug or some
misconfiguration on our side.
If the message format is correct, then your IMAP server is returning
invalid data. If you can provide a message source of such a message,
and an IMAP log of loading such a message, we could maybe tell you more.
--
Jan Schneider
The Horde Project
http://www.horde.org/
Jens Pranaitis
2012-08-29 10:18:22 UTC
Permalink
Post by Jan Schneider
Post by Jens Pranaitis
Any other suggestions to fix this problem? This is kind of a show
stopper for us. We'll probably have to delay our migration to Horde 4
if we can't find out whether this is a bug or some misconfiguration on
our side.
If the message format is correct, then your IMAP server is returning
invalid data. If you can provide a message source of such a message, and
an IMAP log of loading such a message, we could maybe tell you more.
Sure, I've attached a sample HTML message generated by Horde4 and the
IMAP log of the message. I removed stuff from the IMAP which seemed to
be related to other private messages, if you need the complete log I can
send it to you privately.
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imap-html-txt-transaction.log
Type: text/x-log
Size: 7194 bytes
Desc: not available
URL: <http://lists.horde.org/archives/imp/attachments/20120829/a6f672ac/attachment.bin>
-------------- next part --------------
Return-Path: <pranaitis at phil-fak.uni-duesseldorf.de>
Received: from smtp2.phil-fak.uni-duesseldorf.de (smtp2.phil-fak.uni-duesseldorf.de [134.99.24.106])
by sokrates (Cyrus v2.4.16) with LMTPA;
Wed, 29 Aug 2012 12:01:13 +0200
X-Sieve: CMU Sieve 2.4
Received: from smtp2.phil-fak.uni-duesseldorf.de (localhost [127.0.0.1])
by smtp2.phil-fak.uni-duesseldorf.de (Postfix) with ESMTP id B683320091
for <pranaitis at phil.hhu.de>; Wed, 29 Aug 2012 11:59:40 +0200 (CEST)
X-DKIM: OpenDKIM Filter v2.0.1 smtp2.phil-fak.uni-duesseldorf.de B683320091
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
d=phil-fak.uni-duesseldorf.de; s=mail-out; t=1346234380;
bh=G8MkwPyRCBIWKeJuRrJdmAC0Sz+cy6+KdAUEXH4LDhg=;
h=Date:Message-ID:From:To:Subject:Content-Type:MIME-Version;
b=kN7Nv1qx/cO/UblFmqA4ed2ZPztXa13Gule2MVZFRyiI/muhyCY4kPkLaFEhPhH1i
72W+5n5WHO1yWS9KLAIUHjhsu6MkR7dnCIE2yLHpZcKwwcu9/xXa2lWI/87rbRSGyr
/J5lkU4ZUiQEivr/pjovWZR9K7KnjJa/8pZjUl+E=
Received: from localhost (webmail2.phil-fak.uni-duesseldorf.de [134.99.24.101])
by smtp2.phil-fak.uni-duesseldorf.de (Postfix) with ESMTPA id 91C0320090
for <pranaitis at phil.hhu.de>; Wed, 29 Aug 2012 11:59:40 +0200 (CEST)
Received: from sna-lnx3.phil-fak.uni-duesseldorf.de
(sna-lnx3.phil-fak.uni-duesseldorf.de [134.99.58.10]) by
webmail2.phil-fak.uni-duesseldorf.de (Horde Framework) with HTTP; Wed, 29
Aug 2012 12:01:13 +0200
Date: Wed, 29 Aug 2012 12:01:13 +0200
Message-ID: <20120829120113.Horde.emKOee0spPtQPehpjkFgqAA at webmail2.phil-fak.uni-duesseldorf.de>
From: Jens Pranaitis <pranaitis at phil-fak.uni-duesseldorf.de>
To: pranaitis at phil.hhu.de
Subject: this is a html sample message
User-Agent: Internet Messaging Program (IMP) H4 (5.0.23)
Content-Type: multipart/alternative; boundary="=_G5O9Bu0spPtQPehpjiMQqAA"
MIME-Version: 1.0
X-Virus-Scanned: ClamAV using ClamSMTP

This message is in MIME format.

--=_G5O9Bu0spPtQPehpjiMQqAA
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; DelSp=Yes
Content-Description: Plaintext Message
Content-Disposition: inline

Hey,
this is just a test.

--=_G5O9Bu0spPtQPehpjiMQqAA
Content-Type: text/html; charset=ISO-8859-1
Content-Description: HTML Message
Content-Disposition: inline

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p><br>
Hey,<br>
this is just a test.</p>
</body>
</html>
--=_G5O9Bu0spPtQPehpjiMQqAA--
Jan Schneider
2012-08-29 10:30:00 UTC
Permalink
Post by Jens Pranaitis
Post by Jan Schneider
Post by Jens Pranaitis
Any other suggestions to fix this problem? This is kind of a show
stopper for us. We'll probably have to delay our migration to Horde 4
if we can't find out whether this is a bug or some misconfiguration on
our side.
If the message format is correct, then your IMAP server is returning
invalid data. If you can provide a message source of such a message, and
an IMAP log of loading such a message, we could maybe tell you more.
Sure, I've attached a sample HTML message generated by Horde4 and
the IMAP log of the message. I removed stuff from the IMAP which
seemed to be related to other private messages, if you need the
complete log I can send it to you privately.
FWIW this message displays fine here in both Horde 4 and 5. Michael
might be able to say more about the log.
--
Jan Schneider
The Horde Project
http://www.horde.org/
Jens Pranaitis
2012-08-29 12:36:11 UTC
Permalink
Post by Jan Schneider
FWIW this message displays fine here in both Horde 4 and 5. Michael
might be able to say more about the log.
Just to make sure we're on the same page here: The message renders
correctly for me as well. My problem is having both plain text and html
displayed at the same time. Especially with longer message this can be
frustrating. I attached a screenshot of the test message to this mail.
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mail :: this is a html sample message.png
Type: image/png
Size: 27657 bytes
Desc: not available
URL: <Loading Image...>
Jan Schneider
2012-08-29 12:44:42 UTC
Permalink
Post by Jens Pranaitis
Post by Jan Schneider
FWIW this message displays fine here in both Horde 4 and 5. Michael
might be able to say more about the log.
Just to make sure we're on the same page here: The message renders
correctly for me as well. My problem is having both plain text and
html displayed at the same time. Especially with longer message this
can be frustrating. I attached a screenshot of the test message to
this mail.
Yes, I don't see this, just the HTML part.
--
Jan Schneider
The Horde Project
http://www.horde.org/
Michael M Slusarz
2012-08-29 13:33:23 UTC
Permalink
Post by Jan Schneider
Post by Jens Pranaitis
Post by Jan Schneider
FWIW this message displays fine here in both Horde 4 and 5. Michael
might be able to say more about the log.
Just to make sure we're on the same page here: The message renders
correctly for me as well. My problem is having both plain text and
html displayed at the same time. Especially with longer message
this can be frustrating. I attached a screenshot of the test
message to this mail.
Yes, I don't see this, just the HTML part.
This can't happen with base IMP (just like Jan, I don't see it
either). This could only happen if you have broken the
multipart/alternative configuration in mime_drivers.php.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]
Jens Pranaitis
2012-08-29 13:40:16 UTC
Permalink
Post by Jan Schneider
Post by Jens Pranaitis
Post by Jan Schneider
FWIW this message displays fine here in both Horde 4 and 5. Michael
might be able to say more about the log.
Just to make sure we're on the same page here: The message renders
correctly for me as well. My problem is having both plain text and
html displayed at the same time. Especially with longer message this
can be frustrating. I attached a screenshot of the test message to
this mail.
Yes, I don't see this, just the HTML part.
This can't happen with base IMP (just like Jan, I don't see it either).
This could only happen if you have broken the multipart/alternative
configuration in mime_drivers.php.
I didn't touch the mime_drivers.php file, I created a
mime_drivers.local.php with the contents mentioned in the first post of
this thread. The file looks correct to me, but if you see any errors I'd
really appreciate it if you could point them out.
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
Oscar del Rio
2012-08-30 03:57:34 UTC
Permalink
Post by Jens Pranaitis
I didn't touch the mime_drivers.php file, I created a
mime_drivers.local.php with the contents mentioned in the first post
of this thread. The file looks correct to me, but if you see any
errors I'd really appreciate it if you could point them out.
Have you tried with a minimal mime_drivers.local.php as documented.
All you should need is:

<?php
$mime_drivers['html']['inline'] = true;
Jens Pranaitis
2012-09-04 08:18:13 UTC
Permalink
Post by Oscar del Rio
Have you tried with a minimal mime_drivers.local.php as documented.
<?php
$mime_drivers['html']['inline'] = true;
Thanks, that solved the problem for me!
--
IKM-Serviceteam der Philosophischen Fakult?t
HHU D?sseldorf
Loading...