6.0.0-beta1
7/20/25

[#10677] Cyrus returning OK when fetching non-existant messages
Summary Cyrus returning OK when fetching non-existant messages
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester jan (at) horde (dot) org
Created 10/24/2011 (5018 days ago)
Due
Updated 08/29/2012 (4708 days ago)
Assigned 10/24/2011 (5018 days ago)
Resolved 10/25/2011 (5017 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/29/2012 12:23:55 PM Git Commit Comment #15 Reply to this comment
Changes have been made in Git (master):

commit a9b2d0e3a882c5dd4fb230a16fd5bbb2d2a7cc0b
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Oct 24 23:01:10 2011 -0600

     Bug #10677: Further improvements to missing message error reporting

     Conflicts:

             imp/lib/Ajax/Application.php

  imp/js/dimpbase.js            |    5 ++-
  imp/lib/Ajax/Application.php  |  110 
++++++++++++-----------------------------
  imp/lib/Views/ShowMessage.php |   57 ++++++++-------------
  imp/message-dimp.php          |    5 +-
  4 files changed, 61 insertions(+), 116 deletions(-)

http://git.horde.org/horde-git/-/commit/a9b2d0e3a882c5dd4fb230a16fd5bbb2d2a7cc0b
08/29/2012 12:23:51 PM Git Commit Comment #14 Reply to this comment
Changes have been made in Git (master):

commit 4f9ed9e0737e5d7f200ed574005460d74b2473e5
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Oct 24 14:27:00 2011 -0600

     Bug #10677: Remove empty objects (i.e. messages that don't exist 
on the server)

  .../Imap_Client/lib/Horde/Imap/Client/Base.php     |   26 ++++++++++++++++---
  .../lib/Horde/Imap/Client/Data/Fetch.php           |   12 +++++++++
  2 files changed, 34 insertions(+), 4 deletions(-)

http://git.horde.org/horde-git/-/commit/4f9ed9e0737e5d7f200ed574005460d74b2473e5
08/29/2012 12:23:47 PM Git Commit Comment #13 Reply to this comment
Changes have been made in Git (master):

commit 611e41aa413064a9b2307291f4fcfc384cc43e96
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Oct 24 12:52:34 2011 -0600

     Bug #10677: Catch case where message to view no longer exists

  imp/lib/Views/ShowMessage.php |   12 ++++++++----
  1 files changed, 8 insertions(+), 4 deletions(-)

http://git.horde.org/horde-git/-/commit/611e41aa413064a9b2307291f4fcfc384cc43e96
10/25/2011 08:39:11 AM Jan Schneider Comment #12
State ⇒ Resolved
Reply to this comment
Perfect
10/25/2011 05:03:33 AM Michael Slusarz Comment #11 Reply to this comment
I see the issue now... somebody (I'm guessing you - Jan - added for 
the mobile view) added a showMessage() action.  This method is 
essentially duplicative of showPreview(), so I combined the two.  The 
only difference is that when viewing a full message, errors should 
bubble to the AJAX handler while when viewing a preview message, 
errors need to be caught and handled by the preview JS display code 
(since it is possible the message is loading in the background, in 
which case the error should not be displayed).

I think this should work now.
10/25/2011 05:01:21 AM Git Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10677: Further improvements to missing message error reporting

  4 files changed, 61 insertions(+), 115 deletions(-)
http://git.horde.org/horde-git/-/commit/85844ba939f443303dfd9e8958939c7e4e0a35b7
10/24/2011 09:13:34 PM Jan Schneider Comment #9 Reply to this comment
Getting there. It doesn't seem to throw an exception in this case 
though. What's being returned from the showMessage calls now is:
{"response":{"message":{"js":[],"mbox":"SU5CT1guVHJhc2g","uid":"1124228","error":"Angegebene Nachricht nicht 
gefunden.","errortype":"horde.error"}}}
If that's how it's supposed to return that error now, I can check for 
this in client code.
10/24/2011 08:39:31 PM Michael Slusarz Comment #8 Reply to this comment
Turns out that our error handling is TOO good.  In an effort to fix 
parsing errors of fetch data, we were creating empty objects.   
However, we weren't going back to check to see if these objects were 
actually filled with data from the server, and removing them from the 
fetch() return.

See if this second attempt works better.
10/24/2011 08:36:33 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10677: Remove empty objects (i.e. messages that don't exist on 
the server)

  2 files changed, 34 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/5091ba358df4b8291280bd9516a0f3bb9d9e71d7
10/24/2011 07:18:45 PM Jan Schneider Comment #6 Reply to this comment
That doesn't make a difference, because $fetch_ret[$uid] *is* set at 
this point:
array(1) {
   [254600]=>
   object(Horde_Imap_Client_Data_Fetch)#497 (1) {
     ["_data":protected]=>
     array(1) {
       [13]=>
       int(254600)
     }
   }
}

10/24/2011 06:53:44 PM Michael Slusarz Comment #5
Assigned to Michael Slusarz
Reply to this comment
Yes. I noticed this while using the showMessage ajax call which 
returns a complete message object in that case, but with all 
properties empty. An exception would be easier to deal with.
Still don't think this should be handled at the IMAP Client level 
though.  It is perfectly acceptable (and may be desirable) to do 
something like fetching a range of UIDs, without the expectation that 
any/all of those IDs actually exist.  This is the recommended 
behavior, for example, when syncing the local cache when CONDSTORE 
isn't available.

Existence checking needs to be done instead at the application level, 
where the code knows what the fetch results are actually being used for.

I'm assuming you are looking at this for the mobile view.  Try the fix 
I just committed.
10/24/2011 06:53:38 PM Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10677: Catch case where message to view no longer exists

  1 files changed, 8 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/b0275a41678b6af247ca3e1b8ddacf34060b30fd
10/24/2011 06:43:45 PM Jan Schneider Comment #3 Reply to this comment
Yes. I noticed this while using the showMessage ajax call which 
returns a complete message object in that case, but with all 
properties empty. An exception would be easier to deal with.
10/24/2011 05:54:59 PM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment
Guess I am not seeing what the Horde/IMP bug is?

When parsing FETCH results, we only parse a result if an untagged 
response appears (see line 4238 in Client/Socket.php).  So in a 
conversation like you provided, no fetch responses would be parsed so 
we should theoretically be returning an empty array from the fetch() 
command.

Is the issue that IMP is trying to display the message, and we are 
relying on an exception to be thrown instead of checking for array key 
existence in the return array?
10/24/2011 02:09:18 PM Jan Schneider Comment #1
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Cyrus returning OK when fetching non-existant messages
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
If trying to view a message that has been deleted, Cyrus still returns 
OK. This is probably a bug in Cyrus, but maybe we can still catch it 
somehow? This is the dialogue:

S: * OK neo Cyrus IMAP4 v2.2.13-Debian-2.2.13-19ubuntu5 server ready
C: [LOGIN Command - username: jan]
S: 1 OK User logged in
C: 2 EXAMINE INBOX
S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk $Label2 
$Label1 $Label3 $Label4 $Label5 Junk $Forwarded NotJunk foo AMMMa 
Consulting $NotJunk JunkRecorded $Junk Training $MDNSent 
KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $TODO $WATCHED 
$IGNORED H3)
S: * OK [PERMANENTFLAGS ()]
S: * 164 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 161]
S: * OK [UIDVALIDITY 968256253]
S: * OK [UIDNEXT 254528]
S: 2 OK [READ-ONLY] Completed
C: 3 SELECT INBOX
S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk $Label2 
$Label1 $Label3 $Label4 $Label5 Junk $Forwarded NotJunk foo AMMMa 
Consulting $NotJunk JunkRecorded $Junk Training $MDNSent 
KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $TODO $WATCHED 
$IGNORED H3)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen 
NonJunk $Label2 $Label1 $Label3 $Label4 $Label5 Junk $Forwarded 
NotJunk foo AMMMa Consulting $NotJunk JunkRecorded $Junk Training 
$MDNSent KMAILFORWARDED KMAILTODO KMAILWATCHED KMAILIGNORED $TODO 
$WATCHED $IGNORED H3 \*)]
S: * 164 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 161]
S: * OK [UIDVALIDITY 968256253]
S: * OK [UIDNEXT 254528]
S: 3 OK [READ-WRITE] Completed
C: 4 UID FETCH 254522 (ENVELOPE BODY[HEADER])
S: 4 OK Completed (0.000 sec)
C: 5 UID FETCH 254522 (BODYSTRUCTURE)
S: 5 OK Completed (0.000 sec)
C: 6 STATUS INBOX.horde.apps (RECENT)
S: * STATUS INBOX.horde.apps (RECENT 0)
S: 6 OK Completed
C: 7 STATUS INBOX.horde.bugs (RECENT)
S: * STATUS INBOX.horde.bugs (RECENT 0)
S: 7 OK Completed
C: 8 STATUS INBOX.horde.cvs (RECENT)
S: * STATUS INBOX.horde.cvs (RECENT 0)
S: 8 OK Completed
C: 9 STATUS INBOX.horde.dev (RECENT)
S: * STATUS INBOX.horde.dev (RECENT 0)
S: 9 OK Completed
C: 10 STATUS INBOX.horde.imp (RECENT)
S: * STATUS INBOX.horde.imp (RECENT 0)
S: 10 OK Completed
C: 11 STATUS INBOX.Privat (RECENT)
S: * STATUS INBOX.Privat (RECENT 0)
S: 11 OK Completed
C: 12 LOGOUT
S: * BYE LOGOUT received
S: 12 OK Completed

Saved Queries