Menu

#38 Pushing through davmail records messages as lost and duplicates them

1.3.0
fixed
None
1.3.1
5
2019-05-28
2017-11-12
No

I try to synchronize with an Exchange Server using davmail and found that messages that were created locally or moved are reported by mbsync as lost:

pushing message 3079, TUID n6NsbLbcbQ/m
>>> 5 APPEND "INBOX" (\Seen) {720}
pulling message 49700, TUID 5yDklxt2LcvY

+ send literal data
(1 in progress) >>> 6 UID FETCH 49700 (BODY.PEEK[])
5 OK APPEND completed
finding just copied messages on master
(1 in progress) >>> 7 CHECK
* 2983 FETCH (UID 49700 BODY[] {724}
)
6 OK UID FETCH completed
  -> new UID 3087 on slave
* 2984 EXISTS
* 10 RECENT
7 OK CHECK completed
>>> 8 UID FETCH *:* (UID)
8 OK UID FETCH completed
matching just copied messages on master
  pair(0,3079): lookup master, TUID n6NsbLbcbQ/m
  -> TUID lost
Warning: lost track of 1 pushed message(s)

The problem seems to be that davmail doesn't like 'UID FETCH :'. If I replace these with 'UID FETCH 1:*' it seems to work:

--- drv_imap.c.orig 2017-10-01 10:42:35.000000000 +0200
+++ drv_imap.c  2017-11-12 16:03:25.638590328 +0100
@@ -2388,7 +2388,7 @@
    INIT_IMAP_CMD(imap_cmd_open_box_t, cmd, cmdp->callback, cmdp->callback_aux)
    cmd->gen.param.lastuid = 1;
    imap_exec( ctx, &cmd->gen, imap_open_box_p3,

-              "UID FETCH *:* (UID)" );
+              "UID FETCH 1:* (UID)" );
 }

 static void
@@ -2922,7 +2922,7 @@
    cmd->uid = cmdp->uid;
    cmd->gen.param.lastuid = 1;
    imap_exec( ctx, &cmd->gen, imap_find_new_msgs_p3,

-              "UID FETCH *:* (UID)" );
+              "UID FETCH 1:* (UID)" );
 }

Discussion

  • Oswald Buddenhagen

    • status: reported --> open
    • assigned_to: Oswald Buddenhagen
     
  • Oswald Buddenhagen

    that's just wrong.
    but replacing *:* with just * is sufficient and correct.

     
  • Oliver Mangold

    Oliver Mangold - 2017-11-13

    Okay. I'm not familiar enough with IMAP to understand the difference, but I can confirm that with '*' it works also.

     

    Last edit: Oliver Mangold 2017-11-13
  • Oswald Buddenhagen

    • status: open --> fixed
    • Fixed In: unknown --> 1.3.1
     
  • Amer

    Amer - 2018-06-04

    Duplication problem still persists.
    It seems only first part of proposed patch above was applied and second UID FETCH at 2927 is still equal to "*:*" on master branch. Replacing it by "*" mitigates the problem. I hope it doesn't introduce any new problems, though.

     
  • Kyle Barbour

    Kyle Barbour - 2018-06-21

    Agreed with Amer, I'm having the same result, and changing the second UID FETCH seems to fix the problems.

     
  • Stefan Rueger

    Stefan Rueger - 2019-05-11

    Cool as. This also solves another problem that mbsync had with davmail/exchange:

    Asking mbsync to only synchronise a specific folder of a channel resulted in the (wrong) error:

    $ mbsync kmi:INBOX
    IMAP error: mailbox name INBOX contains server's hierarchy delimiter
    Error: channel kmi: master INBOX cannot be op./configureened.

    I compiled version 1.3.1, which fixed the problem. BTW, the github download misses the file ChangeLog, which means that the compilation process (under ubuntu) mentioned in the README file only worked after creating the empty file (touch ChangeLog) before carrying out ./autogen.sh, ./configure, make sudo make install.

     

Log in to post a comment.

MongoDB Logo MongoDB