After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621842 - imapx fetches flags for non-existent mails.
imapx fetches flags for non-existent mails.
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[imapx]
Depends on:
Blocks:
 
 
Reported: 2010-06-17 00:57 UTC by David Woodhouse
Modified: 2010-06-17 09:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
3am patch (1.45 KB, patch)
2010-06-17 02:00 UTC, David Woodhouse
none Details | Review

Description David Woodhouse 2010-06-17 00:57:39 UTC
adding command, fmt = 'SELECT %f'
got folder 'Deleted Items'
completing command buffer is [22] 'SELECT "Deleted Items"'
Staring command (active=1,) B00706 SELECT "Deleted Items"
camel_imapx_write: 'B00706 SELECT "Deleted Items"
'
camel_imapx_read: buffer is '* 0 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
* OK [UIDVALIDITY 777] UIDVALIDITY value
* OK [UIDNEXT 185] The next unique identifier value
B00706 OK [READ-WRITE] SELECT completed.
'
got untagged response
Have token 'EXISTS' id 0
exists: 0
got untagged response
Have token 'RECENT' id 0
recent: 0
got untagged response
Have token 'FLAGS' id 0
flags: 0000001f
got untagged response
Have token 'OK' id 0
got untagged response
Have token 'OK' id 0
got untagged response
Have token 'OK' id 0
Got completion response for command 00706 'SELECT'
Select ok!
** Starting next command
- we're selected on 'Deleted Items', current jobs?
-- Checking job queue
--   0 'FETCH'?
--> starting 'FETCH'
Staring command (active=1,) B00705 FETCH 1:* (UID FLAGS)
camel_imapx_write: 'B00705 FETCH 1:* (UID FLAGS)
'
[Thread 0x7fff92c54710 (LWP 4192) exited]
camel_imapx_read: buffer is 'B00705 NO The specified message set is invalid.
'


Yeah, '0 EXISTS' is a bit of a hint that 'FETCH 1:*' isn't going to do anything useful.
Comment 1 David Woodhouse 2010-06-17 02:00:26 UTC
Created attachment 163884 [details] [review]
3am patch

I think this probably fixes it; if not it's a step in the right direction. It also fixes bug #621765 while I'm at it. We were explicitly selecting a folder before issuing STATUS on it, despite that being forbidden by RFC3501. 

This fixes the code to update ifolder->exists_on_server according to the STATUS response, which was missed before. Then when the STATUS indicates that there are no messages in the folder; don't bother issuing the offending FETCH 1:* command -- just empty the folder summary.

We do need to double-check that that code path will only be reached if there are _really_ no messages on the server (hence the change to the condition for running the STATUS command). I need to think harder about whether that's sufficient, when it's not 3am.

That change also fixes the fact that we were fetching the full set of flags at startup, even when nothing had changed. However, we ought to be (asking for and) comparing UIDNEXT too, just to make sure we're not missing a change.
Comment 2 David Woodhouse 2010-06-17 02:14:10 UTC
Looks like we need to add UIDNEXT (and UIDVALIDITY!!!) to CamelIMAPXSummary?
Comment 3 David Woodhouse 2010-06-17 02:22:32 UTC
Oh, alternatively we could just use UID FETCH instead of FETCH. That is required by RFC3501 to just give empty results rather than bitching. The rest of the patch is still useful though. Will sort it out in the morning.
Comment 4 David Woodhouse 2010-06-17 09:51:46 UTC
To ssh://dwmw2@git.gnome.org/git/evolution-data-server
   a447772..4d07423  gnome-2-30 -> gnome-2-30
   87186ef..fcbb042  master -> master