6.0.0
7/1/26

[#12294] Cannot open message
Summary Cannot open message
Queue IMP
Queue Version 6.0.5
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester azurit (at) pobox (dot) sk
Created 6/3/13 (4776 days ago)
Due
Updated 6/5/13 (4774 days ago)
Assigned 6/4/13 (4775 days ago)
Resolved 6/5/13 (4774 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
347 Michael Slusarz Deleted Original Message
 
297 Michael Slusarz Deleted Original Message
 
237 Michael Slusarz Deleted Original Message
 
477 azurit (at) pobox (dot) sk Comment #31 Reply to this comment
Fixed, thanks! Can you, please, remove all attachments as they can 
containt private data? Thank you.
306 Michael Slusarz Comment #30
State ⇒ Resolved
Reply to this comment
IMP 6.0.6.  It was an issue with using the wrong variable name.  Not 
sure why I wasn't seeing this however.
376 Git Commit Comment #29 Reply to this comment
Changes have been made in Git (master):

commit ba2f9031f787ba404e0645e42678d3e344cdbccc
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Jun 5 12:48:17 2013 -0600

     [mms] Fix displaying some HTML messages that contain blocked CSS 
rules (Bug #12294).

     Conflicts:
             imp/docs/CHANGES
             imp/package.xml

  imp/docs/CHANGES             |    2 ++
  imp/lib/Mime/Viewer/Html.php |    4 ++--
  2 files changed, 4 insertions(+), 2 deletions(-)

http://git.horde.org/horde-git/-/commit/ba2f9031f787ba404e0645e42678d3e344cdbccc
386 Git Commit Comment #28 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_0):

commit a61408f869b7f3795e8fba2976c7df9724c476db
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Jun 5 12:48:17 2013 -0600

     [mms] Fix displaying some HTML messages that contain blocked CSS 
rules (Bug #12294).

  imp/docs/CHANGES             |    2 ++
  imp/lib/Mime/Viewer/Html.php |    4 ++--
  imp/package.xml              |    2 ++
  3 files changed, 6 insertions(+), 2 deletions(-)

http://git.horde.org/horde-git/-/commit/a61408f869b7f3795e8fba2976c7df9724c476db
1810 azurit (at) pobox (dot) sk Comment #27 Reply to this comment
489 azurit (at) pobox (dot) sk Comment #26 Reply to this comment
I got this:
[05-Jun-2013 11:05:00 Europe/Bratislava] PHP Fatal error:  Call to a 
member function appendChild() on a non-object in 
/usr/share/horde/imp/lib/Mime/Viewer/Html.php on line 512
58 azurit (at) pobox (dot) sk Comment #25 Reply to this comment
This second commit is little strange - i don't have file imp/lib/Images.php.
3311 Git Commit Comment #24 Reply to this comment
Changes have been made in Git (master):

commit c02cf9f512a29f4160bb39e0b54d922b57a69940
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Tue Jun 4 13:02:24 2013 -0600

     [mms] Catch and ignore errors from contacts backend when 
determining whether to show images in a message (Bug #12294).

  imp/docs/CHANGES   |    8 ++++++++
  imp/lib/Images.php |   33 ++++++++++++++++++++-------------
  2 files changed, 28 insertions(+), 13 deletions(-)

http://git.horde.org/horde-git/-/commit/c02cf9f512a29f4160bb39e0b54d922b57a69940
447 Michael Slusarz Comment #23 Reply to this comment
imp/lib/Mime/Viewer/Html.php

I would trace the code (renderIMP method), putting in breakpoints 
until you reach the point where it doesn't work anymore.
97 azurit (at) pobox (dot) sk Comment #22 Reply to this comment
Can you give me any hints where should i start? For exampe filenames. 
Thank you.
237 Michael Slusarz Comment #21 Reply to this comment
You need to trace the code then to find out exactly what is broken for 
you.  I can verify that the CSS parsing code works perfectly for me 
and I can view the message part just fine.
257 azurit (at) pobox (dot) sk Comment #20 Reply to this comment
This, unfortunately, didn't resolve the problem. Any ideas?
527 Michael Slusarz Comment #19
State ⇒ Feedback
Reply to this comment
There is nothing wrong with the new CSS code.

The only thing I could reproduce is if the image lookup in Turba was 
broken.  So this patch might help.
447 Git Commit Comment #18 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_0):

commit 4997624663ad7ab4541c1778877c5652b7247125
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Tue Jun 4 13:02:24 2013 -0600

     [mms] Catch and ignore errors from contacts backend when 
determining whether to show images in a message (Bug #12294).

  imp/docs/CHANGES         |    2 ++
  imp/lib/Ui/Imageview.php |   32 +++++++++++++++++++-------------
  imp/package.xml          |    4 ++--
  3 files changed, 23 insertions(+), 15 deletions(-)

http://git.horde.org/horde-git/-/commit/4997624663ad7ab4541c1778877c5652b7247125
36 Michael Slusarz Comment #17
Assigned to Michael Slusarz
State ⇒ Assigned
Reply to this comment
OK - there is some sort of difference between Html.php from 6.0.5 
(which doesn't work) and 6.1 (which works).  Which is why I couldn't 
reproduce.
512 azurit (at) pobox (dot) sk Comment #16 Reply to this comment
I used 'git bisect' and here is the winner:
https://github.com/horde/horde/commit/2b5411859c870bffc70c0aff60ced9d9038b78ec

I also checked if it's correct and copy file 
'imp/lib/Mime/Viewer/Html.php' from 6.0.4 to 6.0.5 and problem 
disappears.
4211 azurit (at) pobox (dot) sk Comment #15 Reply to this comment
I tried to downgrade imp to 6.0.4 and problem disappears. I have all 
packages on newest stable versions so problem must be really directly 
in imp and was introduced in 6.0.5.
238 azurit (at) pobox (dot) sk Comment #14 Reply to this comment
Ok guys, i was able to find a problem with, at least, debug output.

File: Horde/Imap/Client/Base/Debug.php
Function: _write (at the end of file)

This is at the end of function _write:
         if (substr($msg, -1) == "\n") {
             fwrite($this->_stream, $pre . $msg);
             $this->_buffer = null;
         } else {
             $this->_buffer = $pre . $msg;
         }

Data which are ok goes into the 'if'. The missing part of data is 
going to the 'else'. Looks like the missing part does not have the EOL 
character so IMP is considering it as partial message and is not 
processing it. The same thing is, probably, hapening also when 
displaying the message.
57 azurit (at) pobox (dot) sk Comment #13 Reply to this comment
I have more and more reports from users, this starts after upgrading 
from 6.0.4 to 6.0.5. Where should i start with debugging?
119 Michael Slusarz Comment #12 Reply to this comment
Attaching what i got via telnet. I wasn't logging IMAP communication
This is still not useful.  You need to trace why in the Imap Client 
code this text is not being recognized.  I don't care what the actual 
text is.  (E.g. this could be some weird fread() boundary issue, so 
only by debugging the actual code reading the stream in Imap_Client 
are you going to determine the root cause).
589 azurit (at) pobox (dot) sk Comment #11
New Attachment: data.txt
Reply to this comment
Attaching what i got via telnet. I wasn't logging IMAP communication 
by syslog but directly into the file with:
     'debug' => '/tmp/imp-debug.txt',
     'debug_raw' => true,
in my backends.local.php
59 Jan Schneider Comment #10 Reply to this comment
And what *is* the data? It's well possible that some data is stripped 
by syslog, if that is your logging backend.
317 azurit (at) pobox (dot) sk Comment #9 Reply to this comment
Hm, this is strange, i got the data when sending it by telnet. I also 
can see the data in tcpdump when sniffing the communication. They are 
only missing in IMP debug log.
67 Michael Slusarz Comment #8 Reply to this comment
I tried to install Courier 4.10 and it still doesn't work. The 
interesting it that i'm able to correctly open the message via 
Thunderbird.
This doesn't mean anything.  Thunderbird may use another command to 
get that body part.

As mentioned - I can't reproduce with any of my test servers.  So I 
can't do anything more from this side.

You can try to manually login to your IMAP server (i.e. via telnet) 
and issue these commands and see how it responds:

1 SELECT "INBOX"
2 UID FETCH 404611 (BODY.PEEK[2.2])
26 azurit (at) pobox (dot) sk Comment #7 Reply to this comment
I tried to install Courier 4.10 and it still doesn't work. The 
interesting it that i'm able to correctly open the message via 
Thunderbird.
155 Michael Slusarz Comment #6
State ⇒ Not A Bug
Reply to this comment
This is a server bug that can't be worked around (unless new evidence 
can be produced otherwise).  If an IMAP server doesn't provide us with 
required data input, there's nothing we can do and no way to workaround.
75 Michael Slusarz Comment #5 Reply to this comment
On which version of Courier are you able to reproduce it?
I'm *not* able to reproduce it.  My Courier test VM is running 4.12.0.
315 azurit (at) pobox (dot) sk Comment #4 Reply to this comment
On which version of Courier are you able to reproduce it? I'm using 
4.8.0. Sholud i contact the Courier author?
504 Michael Slusarz Comment #3
Priority ⇒ 1. Low
State ⇒ Feedback
Reply to this comment
This appears to be a broken IMAP server.

According to your IMAP log, the request for BODY part 2.2 is returning 
no data, although the server is claiming there should be 2256 octets 
of literal data:

C: 9 UID FETCH 404611 (BODY.PEEK[2.2])
S: * 3983 FETCH (UID 404611 BODY[2.2] {2256}
S: )
S: 9 OK FETCH completed.


I can verify this works for me on my Courier test server:

C: 8 UID FETCH 1 (BODY.PEEK[2.2])
S: * 1 FETCH (UID 1 BODY[2.2] {2256}
S: [LITERAL DATA: 2256 bytes]
S: )
S: 8 OK FETCH completed.
392 azurit (at) pobox (dot) sk Comment #2
New Attachment: 1370267560.M453632P28419V0000000000000902I0000000006EB8DB5_0.server00,S=9473:2,S
Reply to this comment
Attaching also that message.
32 azurit (at) pobox (dot) sk Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
New Attachment: imp-debug.txt
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Type ⇒ Bug
Summary ⇒ Cannot open message
Reply to this comment
I'm getting this error when trying to open one specific message:
Error when communicating with the server.

Attaching the IMAP log. Notice that IMP is disconnecting early at the 
end (it usually sends few other commands when opening a message).

Saved Queries