6.0.0-git
2019-04-25

[#10434] downloading a mailbox doesn't work
Summary downloading a mailbox doesn't work
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester vilius (at) lnk (dot) lt
Created 2011-08-17 (2808 days ago)
Due
Updated 2011-08-19 (2806 days ago)
Assigned 2011-08-17 (2808 days ago)
Resolved 2011-08-18 (2807 days ago)
Milestone
Patch No

History
2011-08-19 17:22:37 Git Commit Comment #18 Reply to this comment
Changes have been made in Git for this ticket:

Clean up for for Bug #10434

  2 files changed, 12 insertions(+), 11 deletions(-)
http://git.horde.org/horde-git/-/commit/09dad4627974e59ac6d8fde17c309db8c721d07f
2011-08-18 23:20:05 Jan Schneider Comment #17
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Nice shot!
2011-08-18 22:50:42 Michael Slusarz Comment #16 Reply to this comment
Try this shot in the dark fix attempt.
2011-08-18 22:49:53 Git Commit Comment #15 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10434: Shot in the dark fix

  1 files changed, 43 insertions(+), 30 deletions(-)
http://git.horde.org/horde-git/-/commit/19b38eff40e9cf314f6ba2900acb516a55e71e94
2011-08-18 22:28:18 Michael Slusarz Comment #14 Reply to this comment
It looks good until there. For some reason this code is called twice,
That's because there are 2 query calls in IMP_Folder::generateMbox().   
One is for size only, the next is for envelope, imap date, and 
fullText of the message.

[Show Quoted Text - 11 lines]
This is correct - the object has the size information (key 12).
array
   empty
For some reason, the call to grab the full text of the message is 
resetting the results array.

2011-08-18 21:54:31 Jan Schneider Comment #13 Reply to this comment

[Show Quoted Text - 14 lines]
It looks good until there. For some reason this code is called twice, 
but both times the $ret contents looks fine:

array
   1 =>
     object(Horde_Imap_Client_Data_Fetch)[439]
       protected '_data' =>
         array
           14 => int 1
           13 => int 39078
           12 => int 5796

and

array
   1 =>
     object(Horde_Imap_Client_Data_Fetch)[477]
       protected '_data' =>
         array
           14 => int 1
           13 => int 39078
           9 =>
             object(Horde_Imap_Client_Data_Envelope)[591]
               protected '_data' =>
                 array
                   'date' =>
                     object(Horde_Imap_Client_DateTime)[592]
                       ...
                   'subject' => string '[Tickets #8353] Re: Sort out 
LDAP preferences mess with user bindings' (length=69)
                   'in_reply_to' => string 
'<whups-8353-fa27ef3ef6570e32a79e74deca7c1bc3@bugs.horde.org>' 
(length=60)
                   'message_id' => string 
'<20090616114609.ooocc4w@bugs.horde.org>' (length=39)
                   'from' =>
                     array
                       ...
                   'to' =>
                     array
                       ...
           11 =>
             object(Horde_Imap_Client_DateTime)[593]
               private '_datetime' => null
               private '_error' => boolean false
               private '_string' => string '16-Jun-2009 17:48:14 
+0200' (length=26)

but after the _fetch() call, in the second run, $ret is empty. so 
these are contents of $ret after _fetch():

array
   1 =>
     object(Horde_Imap_Client_Data_Fetch)[439]
       protected '_data' =>
         array
           14 => int 1
           13 => int 39078
           12 => int 5796

and

array
   empty

2011-08-18 21:44:13 Michael Slusarz Comment #12 Reply to this comment
You are both using caching.  Check to make sure the default fetch 
entries are set correctly (Horde_Imap_Client::fetch(), line 2080; 
$ret variable).  $ret should be an array with sequence numbers as 
keys and empty Data objects as values.
In a mailbox with 1 message, I get the following for $ret:

array(1) {
   [1]=>
   object(Horde_Imap_Client_Data_Fetch)#228 (1) {
     ["_data":protected]=>
     array(0) {
     }
   }
}

For cached data ($data):

array(1) {
   [1699]=>
   array(2) {
     ["HICenv"]=>
     object(Horde_Imap_Client_Data_Envelope)#230 (1) {
       ["_data":protected]=>
       array(7) {
  [snip]
     }
     ["HICdate"]=>
     object(Horde_Imap_Client_DateTime)#234 (3) {
       ["_datetime":"Horde_Imap_Client_DateTime":private]=>
       NULL
       ["_error":"Horde_Imap_Client_DateTime":private]=>
       bool(false)
       ["_string":"Horde_Imap_Client_DateTime":private]=>
       string(26) "23-Nov-2010 12:11:02 -0700"
     }
   }
}

And for the second $ret:

array(1) {
   [1]=>
   object(Horde_Imap_Client_Data_Fetch)#228 (1) {
     ["_data":protected]=>
     array(4) {
       [14]=>
       int(1)
       [13]=>
       int(1699)
       [9]=>
       object(Horde_Imap_Client_Data_Envelope)#230 (1) {
[snip]
       }
       [11]=>
       object(Horde_Imap_Client_DateTime)#234 (3) {
         ["_datetime":"Horde_Imap_Client_DateTime":private]=>
         NULL
         ["_error":"Horde_Imap_Client_DateTime":private]=>
         bool(false)
         ["_string":"Horde_Imap_Client_DateTime":private]=>
         string(26) "23-Nov-2010 12:11:02 -0700"
       }
     }
   }
}

2011-08-18 21:38:12 Michael Slusarz Comment #11 Reply to this comment
Same here. I tried to step-debug it, but I got completely lost in 
the Imap_Client code. Several times.
You are both using caching.  Check to make sure the default fetch 
entries are set correctly (Horde_Imap_Client::fetch(), line 2080; $ret 
variable).  $ret should be an array with sequence numbers as keys and 
empty Data objects as values.

Then check the cached data in Horde_Imap_Client_Base::fetch() (line 
2117; $data variable).  Make sure that cached data is valid.

If all looks good, check to make sure the return variable is still 
correctly set before we start calling _fetch() to grab the data we 
don't have (line 2204; foreach loop).
2011-08-18 21:23:16 Jan Schneider Comment #10 Reply to this comment
Someone else will have to track down because I can't reproduce any of this.
One place to start: what IS the value of $size returned from the
fetch() call in IMP_Folder::generateMbox()?
Empty Array() for me.
Same here. I tried to step-debug it, but I got completely lost in the 
Imap_Client code. Several times.
2011-08-18 20:53:26 vilius (at) lnk (dot) lt Comment #9 Reply to this comment
Someone else will have to track down because I can't reproduce any of this.
One place to start: what IS the value of $size returned from the 
fetch() call in IMP_Folder::generateMbox()?
Empty Array() for me.
2011-08-18 18:44:25 Michael Slusarz Comment #8 Reply to this comment
Someone else will have to track down because I can't reproduce any of this.
One place to start: what IS the value of $size returned from the 
fetch() call in IMP_Folder::generateMbox()?
2011-08-17 23:01:11 Michael Slusarz Comment #7
Taken from Michael Slusarz
Reply to this comment
Someone else will have to track down because I can't reproduce any of this.
2011-08-17 20:52:23 Jan Schneider Comment #6 Reply to this comment

[Show Quoted Text - 9 lines]
I'm getting this error too now. $size is an empty array there, even 
though the server seem to return the correct answer:

(1313614177,3587) C: 4 UID SEARCH ALL
(1313614177,3946) S: * SEARCH 39078 48164 49071 49240 49702 49948 
50009 50018 50084 50120 50194 50343 50474 50476 50526 50527 50528 
50588 50598 50721 50725 50729 50749 50756 50765 50810 50820 50845 
50875 50951 51076 51104 51117 51126 51157 51161 51165 51166 51169 51170
(1313614177,3957) S: 4 OK Completed (40 msgs in 0.000 secs)
Deleted messages from cache (mailbox: INBOX.horde.bugs; UIDs: 51168)
Retrieved from cache (mailbox: INBOX.horde.bugs; UIDs: 51165:51166)
(1313614177,4029) C: 5 FETCH 1:36,39:40 (RFC822.SIZE)
(1313614177,4347) S: * 1 FETCH (RFC822.SIZE 5796)
(1313614177,4355) S: * 2 FETCH (RFC822.SIZE 4036)
(1313614177,4361) S: * 3 FETCH (RFC822.SIZE 5234)
(1313614177,4367) S: * 4 FETCH (RFC822.SIZE 4064)
(1313614177,4372) S: * 5 FETCH (RFC822.SIZE 4059)
(1313614177,4378) S: * 6 FETCH (RFC822.SIZE 5149)
(1313614177,4384) S: * 7 FETCH (RFC822.SIZE 4661)
(1313614177,4389) S: * 8 FETCH (RFC822.SIZE 5184)
(1313614177,4395) S: * 9 FETCH (RFC822.SIZE 6375)
(1313614177,4400) S: * 10 FETCH (RFC822.SIZE 4568)
(1313614177,4406) S: * 11 FETCH (RFC822.SIZE 4169)
(1313614177,4412) S: * 12 FETCH (RFC822.SIZE 5098)
(1313614177,4417) S: * 13 FETCH (RFC822.SIZE 5299)
(1313614177,4423) S: * 14 FETCH (RFC822.SIZE 4290)
(1313614177,4429) S: * 15 FETCH (RFC822.SIZE 4901)
(1313614177,4434) S: * 16 FETCH (RFC822.SIZE 5551)
(1313614177,4440) S: * 17 FETCH (RFC822.SIZE 4337)
(1313614177,4448) S: * 18 FETCH (RFC822.SIZE 3974)
(1313614177,4454) S: * 19 FETCH (RFC822.SIZE 4603)
(1313614177,4459) S: * 20 FETCH (RFC822.SIZE 4069)
(1313614177,4465) S: * 21 FETCH (RFC822.SIZE 4441)
(1313614177,4471) S: * 22 FETCH (RFC822.SIZE 4170)
(1313614177,4477) S: * 23 FETCH (RFC822.SIZE 5765)
(1313614177,4482) S: * 24 FETCH (RFC822.SIZE 4276)
(1313614177,4488) S: * 25 FETCH (RFC822.SIZE 4532)
(1313614177,4494) S: * 26 FETCH (RFC822.SIZE 4068)
(1313614177,4499) S: * 27 FETCH (RFC822.SIZE 4144)
(1313614177,4505) S: * 28 FETCH (RFC822.SIZE 4288)
(1313614177,4511) S: * 29 FETCH (RFC822.SIZE 4261)
(1313614177,4516) S: * 30 FETCH (RFC822.SIZE 4103)
(1313614177,4522) S: * 31 FETCH (RFC822.SIZE 5665)
(1313614177,4528) S: * 32 FETCH (RFC822.SIZE 4252)
(1313614177,4533) S: * 33 FETCH (RFC822.SIZE 4317)
(1313614177,4539) S: * 34 FETCH (RFC822.SIZE 4140)
(1313614177,4546) S: * 35 FETCH (RFC822.SIZE 5296)
(1313614177,4552) S: * 36 FETCH (RFC822.SIZE 4550)
(1313614177,4558) S: * 39 FETCH (RFC822.SIZE 4034)
(1313614177,4564) S: * 40 FETCH (RFC822.SIZE 4037)
(1313614177,4569) S: 5 OK Completed (0.000 sec)
(1313614177,4593) C: 6 UID SEARCH 1:40
(1313614177,4949) S: * SEARCH 39078 48164 49071 49240 49702 49948 
50009 50018 50084 50120 50194 50343 50474 50476 50526 50527 50528 
50588 50598 50721 50725 50729 50749 50756 50765 50810 50820 50845 
50875 50951 51076 51104 51117 51126 51157 51161 51165 51166 51169 51170
(1313614177,4969) S: 6 OK Completed (40 msgs in 0.000 secs)
Stored in cache (mailbox: INBOX.horde.bugs; UIDs: 
39078,48164,49071,49240,49702,49948,50009,50018,50084,50120,50194,50343,50474,50476,50526:50528,50588,50598,50721,50725,50729,50749,50756,50765,50810,50820,50845,50875,50951,51076,51104,51117,51126,51157,51161,51165:51166,51169:51170)
2011-08-17 17:53:23 vilius (at) lnk (dot) lt Comment #5 Reply to this comment
I'm using traditional view.
2011-08-17 16:59:08 Michael Slusarz Comment #4
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
I don't get this error, but a different one, even after fixing the encoding:

2011-08-17T14:33:02+02:00 ERR: HEADHORDE [imp] IMAP error: Mailbox 
does not exist [pid 3412 on line 340 of 
"/home/jan/horde-git/imp/lib/Imap.php"]
Works fine for me - I don't see this.
2011-08-17 12:41:34 Jan Schneider Comment #3
Assigned to Michael Slusarz
State ⇒ Assigned
Reply to this comment
I don't get this error, but a different one, even after fixing the encoding:

2011-08-17T14:33:02+02:00 ERR: HEADHORDE [imp] IMAP error: Mailbox 
does not exist [pid 3412 on line 340 of 
"/home/jan/horde-git/imp/lib/Imap.php"]
2011-08-17 12:40:16 Git Commit Comment #2 Reply to this comment
Changes have been made in Git for this ticket:

Encode download mailbox (Bug #10434).

  1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/86f9002044376dc831b2b2706f60a00fe3c16b46
2011-08-17 09:52:45 vilius (at) lnk (dot) lt Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ downloading a mailbox doesn't work
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
Reply to this comment
Downloading a mailbox doesn't work in latest release and git of IMP.

Logs say:

2011-08-17T12:48:14+03:00 NOTICE: HORDE [imp] PHP ERROR: Undefined 
offset: 1 [pid 30275 on line 339 of 
"/var/www/html/horde/imp/lib/Folder.php"]

And

[17-Aug-2011 12:48:57] PHP Fatal error:  Call to a member function 
getSize() on a non-object in /var/www/html/horde/imp/lib/Folder.php on 
line 339

Saved Queries