VM

IMAP message download fails sometimes

Bug #897447 reported by Uday Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Triaged
Low
Uday Reddy

Bug Description

Sometimes, when a lot of IMAP messages need to get downloaded, the download fails in the middle with the message:

Retrieval from udrimap:INBOX signaled: (vm-imap-protocol-error expected (BODY[] string) in FETCH response)

As far as I can tell, there is no bug in the code. If the uncompiled code vm-imap.el is used, it works fine. Moreover, the code in question, vm-imap-retrieve-to-target is the same as in VM 8.10.

It seems to be a race between the IMAP process and VM. The compiled code probably runs faster and looks for the end of the message body before the IMAP process finished delivering it. It always fails at the same message. So it is reproducible.

Redoing vm-get-new-mail gets the remaining mail eventually.

Tags: imap
Revision history for this message
Uday Reddy (reddyuday) wrote :

Here is some detail about what is happening. For a server response like this

* 2219 FETCH (BODY[] {1932}

)
the log should look like this:

   retrieve response #<marker at 155669 in IMAP localhost 22:45:17>
   object #<buffer>"*" 155670 (atom 155669 155670)
   object #<buffer>"2219" 155675 (atom 155671 155675)
   object #<buffer>"FETCH" 155681 (atom 155676 155681)
   object #<buffer>
   object #<buffer>"BODY" 155687 (atom 155683 155687)
   object #<buffer>
   object #<buffer>155689 (close-bracket)
   155689 (vector)
   object #<buffer>
   object #<buffer>"1932" 155695
   (atom 155691 155695)
   object #<buffer>155696 (close-brace)
   object #<buffer>155698 (end-of-line)
   157630 (string 155698 157630)
   object #<buffer>157631 (close-paren)
   157631
   (list
    (atom 155683 155687)
    (vector)
    (string 155698 157630))

Notice that after (close-brace), VM recognized (end-of-line)_and then read a string.

For a bad parse of this input:

* 2220 FETCH (BODY[] {1234}

MIME-Version: 1.0

......

the log looked like this:

   retrieve response #<marker at 155701 in IMAP localhost 22:45:17>
   object #<buffer>"*" 155702 (atom 155701 155702)
   object #<buffer>"2220" 155707 (atom 155703 155707)
   object #<buffer>"FETCH" 155713 (atom 155708 155713)
   object #<buffer>
   object #<buffer>"BODY" 155719 (atom 155715 155719)
   object #<buffer>
   object #<buffer>155721 (close-bracket)
   155721 (vector)
   object #<buffer>155723 (open-brace)
   object #<buffer>"12" "1234" 155727 (atom 155723 155727)
   object #<buffer>155728 (close-brace)
   object #<buffer>"MIME-Version:" 155743 (atom 155730 155743)

There was no (end-of-line) recognized after (close-brace). There was no error generated either (which should have arisen if there was actually no end-of-line). So, why didn' the end-of-line get logged?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.