New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offlineImap behind davmail not syncing INBOX only #479

Closed
secomi opened this Issue Jun 11, 2017 · 29 comments

Comments

Projects
None yet
2 participants
@secomi

secomi commented Jun 11, 2017

General informations

  • system/distribution (with version): Cygwin
  • offlineimap version (offlineimap -V): offlineimap v7.1.1, imaplib2 v2.57 (bundled), Python v2.7.13, OpenSSL 1.0.2k 26 Jan 2017
  • Python version: Python 2.7.13
  • server name or domain: davmail -> exchange 2010
  • CLI options: ./offlineimap.py -o -f INBOX

Configuration file offlineimaprc

[general]
accounts = office
maxsyncaccounts = 1
socktimeout = 60

[Account office]
localrepository = local
remoterepository = exchange
autorefresh = 5
quick = 10

[Repository local]
type = IMAP
ssl = no
remotehost = localhost
remoteport = 2143
remoteuser = REMOVED
remotepass = REMOVED

[Repository exchange]
type = IMAP
ssl = no
remotehost = localhost
remoteport = 1143
remoteuser = REMOVED
remotepass = REMOVED
maxconnections = 2
holdconnectionopen = yes
keepalive = 60
folderfilter = lambda foldername: foldername in ['INBOX', 'Sent']
createfolders = False
readonly = True

Logs, error

logDavmail.txt

No particular error reported on the offlineImap logs:
offlineimap.log.txt

Steps to reproduce the error

  • Configure Davmail to connect to an exchange server using EWS
  • Start syncing

OfflineImap will sync all the folders EXCEPT the INBOX.

test performed

  1. Exchange -> davmail -> offlineImap -> Imap hMailserver windows
    • all foders Synced except INBOX
  2. Exchange -> davmail -> offlineImap -> Maildir
    • all foders Synced except INBOX
  3. Exchange -> davmail -> Mbsync -> Maildir
    • OK INBOX syncing

offlineImap info

OfflineIMAP 7.1.1
Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v2.7.13, OpenSSL 1.0.2k 26 Jan 2017
imaplib2: 2.57 (bundled)
Remote repository 'exchange': type 'IMAP'
Host: localhost Port: 1143 SSL: False
Establishing connection to localhost:1143 (exchange)
Server welcome string: * OK [CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE] IMAP4rev1 DavMail 4.8.0-2479 server ready
Server capabilities: ('IMAP4REV1', 'AUTH=LOGIN', 'MOVE')

folderfilter= lambda foldername: foldername in ['INBOX', 'Sent']

Folderlist:
Drafts (disabled)
folder2 (disabled)
INBOX
Junk (disabled)
Sent
Sync Issues (disabled)
Sync Issues/Conflicts (disabled)
Sync Issues/Local Failures (disabled)
Sync Issues/Server Failures (disabled)
Trash (disabled)
Trash/folder2 (disabled)
Unsent Messages (disabled)

Local repository 'local': type 'MappedIMAP'
Host: localhost Port: 2143 SSL: False
Establishing connection to localhost:2143 (local)
Server welcome string: * OK IMAPrev1
Server capabilities: ('IMAP4', 'IMAP4REV1', 'CHILDREN', 'IDLE', 'QUOTA', 'SORT', 'ACL', 'NAMESPACE', 'RIGHTS=TEXK')

Folderlist:
INBOX
Sent

Comments / Questions

I was wondering if there was some specific options or name translation to apply in order to sync the INBOX for OfflineIMAP.

Thanks for your support

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 11, 2017

It looks like the INBOX was synced, though:

2017-06-11 13:51:23 INFO: Syncing INBOX: IMAP -> MappedIMAP
2017-06-11 13:51:23 DEBUG: Loading message list for MappedIMAP[INBOX]
2017-06-11 13:51:25 DEBUG: Loading message list for IMAP[INBOX]
2017-06-11 13:51:26 DEBUG: Syncing messages IMAP[INBOX] -> MappedIMAP[INBOX]

I wonder Davmail might not be showing the remote emails.

Could you run ./offlineimap.py -o -f INBOX -d ALL, please?

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 11, 2017

From the Davmail logs, I understand that it closes the socket on the local side while it's still "loading" the remote INBOX:

2017-06-11 11:29:22,423 DEBUG [ImapConnection-54326] davmail.exchange.FolderLoadThread  - Still loading INBOX (1539 messages)
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - >  1539 EXISTS
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > * 5 RECENT
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > * OK [UIDVALIDITY 1]
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > * OK [UIDNEXT 3567]
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > * FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk)
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > * OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded Junk \*)]
2017-06-11 11:29:22,424 DEBUG [ImapConnection-54326] davmail  - > HBKD7 OK [READ-ONLY] EXAMINE completed
2017-06-11 11:29:22,540 INFO  [ImapConnection-54326] davmail.connection  - DISCONNECT - 127.0.0.1:54326 
@secomi

This comment has been minimized.

secomi commented Jun 11, 2017

Attached the logs performed with a clean local IMAP.

  1. the info output before
    Infolist-before.txt

  2. The sync, where the inbox gets created
    offlineimap2.log.txt

  3. the info list after
    Infolist-after.txt

Could it be that there is a particular behavior for the inbox. As if all the emails are in another folder, all the emails gets sync without any issue.

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 11, 2017

For offlineimap, the INBOX thread is stopping gently:

Folder INBOX [acc: office]:
 Syncing INBOX: IMAP -> MappedIMAP
 Loading message list for MappedIMAP[INBOX]
 Loading message list for IMAP[INBOX]
 Syncing messages IMAP[INBOX] -> MappedIMAP[INBOX]
 []: Not syncing to read-only repository 'exchange'
[thread]: Unregister thread 'Folder INBOX [acc: office]'

This means that the syncing thread did not find messages. There is no particular behavior in offlineimap for the INBOX. All the folders are processed the same way. I don't know for davmail.

Does syncing works if you copy the INBOX emails into another folder like "INBOX2"?

@secomi

This comment has been minimized.

secomi commented Jun 11, 2017

Does syncing works if you copy the INBOX emails into another folder like "INBOX2"?

Yes if you copy to "Folder2" it does work.

  1. based on your connection comment, I did a test disabling the keepalive on davmail:
    davmail-keepalive

OfflineImap then correctly sync to a "Maildir" type:

maildirOK.txt

Strangely doing 2 connections, after the first couple of emails.

  1. Trying to do the same with the IMAP hmailserver. OffelineImap crash with the following exception:

crash-offilineImap.txt

I changed the "maxconnections = 2" to "maxconnections = 1" , but it crash as well with the same error.

Maybe there is a specific parameter to apply ?

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 11, 2017

Strangely doing 2 connections, after the first couple of emails.

The second sync thread needs to be fully started (login, etc). Hence, the short delay.

Trying to do the same with the IMAP hmailserver. OffelineImap crash with the following exception:
crash-offilineImap.txt

I changed the "maxconnections = 2" to "maxconnections = 1" , but it crash as well with the same error.

Maybe there is a specific parameter to apply ?

I'm afraid there's not much we can do. Offlineimap tries to upload a new email but the hmailserver did not returned the created UID as expected. This might be because the server is refusing the email for some reason (max size, headers, whatever).
IOW, it looks like the policy rules between both IMAP servers differ. I guess there's not much we can do to make the hmailserver accept the offending email(s). Do you have logs of the hmailserver?

However, we might like to improve our strategy here by warning instead of stopping the sync. Ideally, we would store the failed uploads in a local maildir. I say "ideally" because I don't think this will be implemented.

nicolas33 added a commit to nicolas33/offlineimap that referenced this issue Jun 11, 2017

IMAP/IMAP: continue to sync if the local side does not return a valid…
… UID on upload

There's no reason we should abort the full sync.

Github-ref: OfflineIMAP#479
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 11, 2017

The above patch does this: continue the run even if some emails cannot be stored on the local side. Could you try with the above version, please?

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

Sure, I just downloaded it on another PC today.
I ll do some tests.

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

test 1: Option "singlethreadperfolder = yes"

  1. SYNC OK ! connection reset by peer on the first run.

run1-ERROR-connection-reset.txt

  1. run2, run3, run4 are OK

run2-run3-run4-OK.txt

test2: singlethreadperfolder = no

  1. 1st sync seems to hang, I had to kill after a while once the last message was synced
  2. run2 OK

runSingleThread-no.txt

I will now run in daemon mode and see if I have issues

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 13, 2017

So, it looks like we are still having issues with threads in IMAP/IMAP mode. I've improved the doc.

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

Yes but so far the issue was only on the 1st sync.
Because for the last 30min, the daemon is correctly syncing.
and that is awesone !

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 13, 2017

Are you running the daemon with singlethreadperfolder disabled? If so, we might like to check after some days.

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

The deamon is running with the default singlethreadperfolder configuration which I understand to be set to NO according to the documentation.

For now the sync has been running without any error.
I ll be able to make more tests at the end of the week.

Let me reshare my actual configuration:

[general]
accounts = office
ui = TTYUI

[Account office]
localrepository = local-hmailserver
remoterepository = remote-exchange
autorefresh = 3
#quick = 10

[Repository remote-exchange]
# DavMail server is used.
# Option "Enable Keepalived: DISABLED"
type = IMAP
ssl = no
maxconnections = 2
#singlethreadperfolder = yes
folderfilter = lambda foldername: foldername in ['INBOX', 'Sent']
remotehost = localhost
remoteport = 1143
remoteuser = REMOVED
remotepass = REMOVED


[Repository local-hmailserver]
# only index enabled.
type = IMAP
ssl = no
remotehost = localhost
remoteport = 2143
remoteuser = REMOVED
remotepass = REMOVED
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 13, 2017

Ok, thanks. I've added a section about Davmail in the FAQ, too.

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 13, 2017

Oh, and or you running the patched version or the vanilla 7.1.1?

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

Actually I just did a git clone this morning. So if there was a particular procedure to apply the patch I missed it my bad.

I just retried with my original installation. And it synced most of the INBOX, but failed for the last couple of emails:

Administrator@blabla ~/offlineimap
$ ./offlineimap.py -o
OfflineIMAP 7.1.1
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v2.7.13, OpenSSL 1.0.2k  26 Jan 2017
Account sync office:
 *** Processing account office
 Establishing connection to localhost:1143 (exchange)
 Establishing connection to localhost:2143 (local)
Folder Sent [acc: office]:
 Syncing Sent: IMAP -> MappedIMAP
Folder INBOX [acc: office]:
 Syncing INBOX: IMAP -> MappedIMAP
 Establishing connection to localhost:1143 (exchange)
 Copy message UID 3712 (1/28) exchange:INBOX -> local
 Copy message UID 3738 (2/28) exchange:INBOX -> local
 Copy message UID 3739 (3/28) exchange:INBOX -> local
Copy message from exchange:INBOX:
 Can't parse FETCH response, can't find UID: %s
 imap
 ERROR: Copying message 3738 [acc: office]
  Backend could not find uid for message, returned 0
Folder INBOX [acc: office]:
 Copy message UID 3740 (4/28) exchange:INBOX -> local
Thread 'Copy message from exchange:INBOX' terminated with exception:
Traceback (most recent call last):
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/threadutil.py", line 160, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/UIDMaps.py", line 271, in savemessage
    "returned %s"% newluid)
ValueError: Backend could not find uid for message, returned 0
[...]

Attached the log of hMailserver:
hmailserver_2017-06-14.log.txt

But I didn't see any particular error.

I need to see how to apply the patch, and retry ... as well as making a couple of more tests in the next days

@secomi

This comment has been minimized.

secomi commented Jun 13, 2017

below the output with the patch applied:

$ ./offlineimap.py -o
OfflineIMAP 7.1.1---PATCH-APPLIED
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v2.7.13, OpenSSL 1.0.2k  26 Jan 2017
Account sync office:
 *** Processing account office
 Establishing connection to localhost:1143 (exchange)
 Establishing connection to localhost:2143 (local)
Folder Sent [acc: office]:
 Syncing Sent: IMAP -> MappedIMAP
Folder INBOX [acc: office]:
 Syncing INBOX: IMAP -> MappedIMAP
 Establishing connection to localhost:1143 (exchange)
 Copy message UID 3712 (1/28) exchange:INBOX -> local
 Copy message UID 3738 (2/28) exchange:INBOX -> local
 Copy message UID 3739 (3/28) exchange:INBOX -> local
Copy message from exchange:INBOX:
 Can't parse FETCH response, can't find UID: %s
 imap
 ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3738' from 'INBOX'
Folder INBOX [acc: office]:
 Copy message UID 3740 (4/28) exchange:INBOX -> local
 Copy message UID 3741 (5/28) exchange:INBOX -> local
 Copy message UID 3743 (6/28) exchange:INBOX -> local
 Copy message UID 3744 (7/28) exchange:INBOX -> local
 Copy message UID 3745 (8/28) exchange:INBOX -> local
 Copy message UID 3746 (9/28) exchange:INBOX -> local
 Copy message UID 3747 (10/28) exchange:INBOX -> local
Copy message from exchange:INBOX:
 Can't parse FETCH response, can't find UID: %s
 imap
 ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3712' from 'INBOX'
Folder INBOX [acc: office]:
 Copy message UID 3756 (11/28) exchange:INBOX -> local
 Copy message UID 3757 (12/28) exchange:INBOX -> local
 Copy message UID 3758 (13/28) exchange:INBOX -> local
 Copy message UID 3760 (14/28) exchange:INBOX -> local
 Copy message UID 3761 (15/28) exchange:INBOX -> local
 Copy message UID 3762 (16/28) exchange:INBOX -> local
 Copy message UID 3763 (17/28) exchange:INBOX -> local
 Copy message UID 3764 (18/28) exchange:INBOX -> local
Copy message from exchange:INBOX:
 Can't parse FETCH response, can't find UID: %s
 imap
 ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3763' from 'INBOX'
Folder INBOX [acc: office]:
 Copy message UID 3765 (19/28) exchange:INBOX -> local
 Copy message UID 3766 (20/28) exchange:INBOX -> local
 Copy message UID 3767 (21/28) exchange:INBOX -> local
 Copy message UID 3768 (22/28) exchange:INBOX -> local
 Copy message UID 3769 (23/28) exchange:INBOX -> local
 Copy message UID 3770 (24/28) exchange:INBOX -> local
 Copy message UID 3771 (25/28) exchange:INBOX -> local
 Copy message UID 3772 (26/28) exchange:INBOX -> local
 Copy message UID 3773 (27/28) exchange:INBOX -> local
 Copy message UID 3774 (28/28) exchange:INBOX -> local
Copy message from exchange:INBOX:
 Can't parse FETCH response, can't find UID: %s
 imap
 ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3761' from 'INBOX'
Account sync office:
 *** Finished account 'office' in 1:02
ERROR: Exceptions occurred during the run!
ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3738' from 'INBOX'

Traceback:
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/UIDMaps.py", line 274, in savemessage
    OfflineImapError.ERROR.MESSAGE

ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3712' from 'INBOX'

Traceback:
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/UIDMaps.py", line 274, in savemessage
    OfflineImapError.ERROR.MESSAGE

ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3763' from 'INBOX'

Traceback:
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/UIDMaps.py", line 274, in savemessage
    OfflineImapError.ERROR.MESSAGE

ERROR: server of repository 'INBOX' did not return a valid UID (got '0') for UID '3761' from 'INBOX'

Traceback:
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/cygdrive/c/Users/Administrator/offlineimap/offlineimap/folder/UIDMaps.py", line 274, in savemessage
    OfflineImapError.ERROR.MESSAGE

and subsequent runs fail with a similar trace.

I ll have to investigate better the differences between the 2 laptops.

nicolas33 added a commit that referenced this issue Jun 14, 2017

IMAP/IMAP: continue to sync if the local side does not return a valid…
… UID on upload

There's no reason we should abort the full sync.

Github-ref: #479
Tested-by: https://github.com/secomi
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>

nicolas33 added a commit that referenced this issue Jun 14, 2017

folder/IMAP: improve the warning when we can't parse the returned UID
Github-ref: #479
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 14, 2017

So, the first patch is improving things by allowing to continue on error: applied.

I've made yet another patch to improve the warning because we could not parse the response from hmailserver and could not find the created UID.

Please, try with the current "next" branch which includes the first patch.

@secomi

This comment has been minimized.

secomi commented Jun 14, 2017

I switched to the branch next.
The first run got a couple of errors see the attached logs:
sync-with-branch-next.txt

Then the 2nd run, also fails on the same couple of emails, see the attached log:
sync-with-branch-next-run2.txt

Tomorrow I will be able to retry on the install which didn't create problem.

nicolas33 added a commit to nicolas33/offlineimap that referenced this issue Jun 15, 2017

folder/IMAP: introduce dedicated parsing for davmail (not supporting …
…UIDPLUS)

Some returned responses end with ')' rather than 'UID XXX)' as expected.

BTW, a better policy could be to request for the 'X-OfflineIMAP' header only
rather than fetching all the headers and looking for it manually.

Also:
- Strip the output when error occurs: we don't need the full response unless
  'imap' debug mode is enabled.
- Improve the comments.

Github-ref: OfflineIMAP#479
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 15, 2017

Thanks!

It appears some items are not formatted as expected. We should have 'UID XXX)' rather than ')' only. Hence, the UID is not found.

Luckily, it looks like the UID is set in front of the previous item so we get a chance to catch it.

I've wrote a new patch to parse the first item when our historical parsing fails. Please, try the latest version above. CAUTION: this patch is NOT TESTED.

@secomi

This comment has been minimized.

secomi commented Jun 15, 2017

Thanks,
I did apply the patch on top of the branch 'next' and removed the .pyc of the corresponding file.

The first run produced some erors, but it could have been because I connected to the webmail. My bad.

uid-fix-scratch.txt

Then the run2 and run3 didn't report any issue:
uid-fix-run2.txt
uid-fix-run3.txt

I ll do more tests this tonight

@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 15, 2017

Yes, I think runs 2 & 3 are not relevant enough since there are few new emails. I would not be surprised the first run was with the real exchange because the reported errors are not the same (does not have a message with UID XXX) and what we usually get with Microsoft.

@secomi

This comment has been minimized.

secomi commented Jun 18, 2017

Syncing after a couple of days, created plenty of messages like the one below:

Folder INBOX [acc: office]:
Copy message UID 3962 (13/110) exchange:INBOX -> local
Copy message from exchange:INBOX:
savemessage: Searching mails for new Message-ID failed. Could not determine new UID.

resync-after-2-days.txt

Also on friday I couldn't make the sync work again on the on I successfuly manage to have working. I will apply all the patch on the right branch next monday.

I also got plenty of ducplicated messages . i ll need to investigate it further as well.

nicolas33 added a commit to nicolas33/offlineimap that referenced this issue Jun 18, 2017

folder/IMAP: introduce dedicated parsing for davmail (not supporting …
…UIDPLUS)

Some returned responses end with ')' rather than 'UID XXX)' as expected.

BTW, a better policy could be to request for the 'X-OfflineIMAP' header only
rather than fetching all the headers and looking for it manually.

Also:
- Strip the output when error occurs: we don't need the full response unless
  'imap' debug mode is enabled.
- Improve the comments.

Github-ref: OfflineIMAP#479
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 18, 2017

I will apply all the patch on the right branch next monday.

Yes, please. The above branch has all the patches.

I also got plenty of ducplicated messages . i ll need to investigate it further as well.

This is to expect: emails are uploaded to the server but offlineimap still can't assign UIDs for some of them. On next run, all the non-assigned emails are assumed not uploaded and re-uploaded. I think the above branch will fix this.

@secomi

This comment has been minimized.

secomi commented Jun 20, 2017

ok, I just switch to this branch. I didn't see at first that was another repository.
I ll be running this new branch. I got some negative UID this time:

Copy message UID 4215 (156/159) remote-exchange:INBOX -> local-hmailserver
 Copy message UID 4216 (157/159) remote-exchange:INBOX -> local-hmailserver
 Copy message UID 4218 (158/159) remote-exchange:INBOX -> local-hmailserver
 Copy message UID 4219 (159/159) remote-exchange:INBOX -> local-hmailserver
 Deleting 43 messages (325,3254,3467,3515:3516,3621,3638,3640,3738,3744,3779,3781,3805,3808:3809,3813,3820:3821,3843,3848,3850,3853:3854,3862:3868,3870:3871,3900:3902,3905:3906,3909,3913,3915,3924,3933,3949) in MappedIMAP[INBOX]
 Adding flag S to 76 messages on INBOX
 Copy message UID -11 (1/22) local-hmailserver:INBOX -> remote-exchange
 Copy message UID -22 (2/22) local-hmailserver:INBOX -> remote-exchange
 Copy message UID -21 (3/22) local-hmailserver:INBOX -> remote-exchange
Copy message from local-hmailserver:INBOX:
 savemessage: Searching mails for new Message-ID failed. Could not determine new UID on INBOX.
 savemessage: Searching mails for new Message-ID failed. Could not determine new UID on INBOX.
Folder INBOX [acc: office]:
 Copy message UID -20 (4/22) local-hmailserver:INBOX -> remote-exchange
 Copy message UID -19 (5/22) local-hmailserver:INBOX -> remote-exchange
Copy message from local-hmailserver:INBOX:
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 20, 2017

If there are issues the "imap" debug mode will help.

@secomi

This comment has been minimized.

secomi commented Jun 27, 2017

Just to provide an update, as I have been running the https://github.com/nicolas33/offlineimap.git branch: origin/ns/davmail-resp-parsing

for some days on a daily basis and I could not spot any particular issue when running. At least for now.

I ll of course continue to us it in the coming days and see if this create also problem with "outlook" or the webmail.

nicolas33 added a commit that referenced this issue Jun 27, 2017

folder/IMAP: introduce dedicated parsing for davmail (not supporting …
…UIDPLUS)

Some returned responses end with ')' rather than 'UID XXX)' as expected.

BTW, a better policy could be to request for the 'X-OfflineIMAP' header only
rather than fetching all the headers and looking for it manually.

Also:
- Strip the output when error occurs: we don't need the full response unless
  'imap' debug mode is enabled.
- Improve the comments.

Github-ref: #479
Tested-by: https://github.com/secomi
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33

This comment has been minimized.

Member

nicolas33 commented Jun 27, 2017

Thank you much for the feedback. Patch applied into the official next branch.
Please, close this issue when it's ok for you.

@secomi

This comment has been minimized.

secomi commented Jul 4, 2017

I haven't faced particular problem after using this particular branch. So I am closing the ticket.
@nicolas33 thank you so for your support and the proposed fix.
Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment