"Possible hole detected"

Sometimes, for whatever reason, every em Client instance I have will not receive a particular message, while every Android mail client I have, does receive it. This seems to be an issue since version 7. When it does happen, I see logs such as this below. In this case, message 46595 is the ID of the message that was not downloaded to emClient. Instead, I’ll get the ellipsis next to my Inbox. Clicking refresh doesn’t fix it, unless I either repair the folder or go offline and back online again. This doesn’t happen a lot, but it’s annoying when it does.

What does this error/warning mean? What can it indicate? I can post more logs if needed. Thanks.

23:36:50.475|06D| >>> SynchronizeMessagesAsync(foler: /Inbox): Possible hole detected - tempMaxUid = 46583 and maxUid = 46595, goto Possible hole search

Anyone? Still getting this as of 8.2. Thanks.

Anyone? I can’t tell if this is emClient or my mail server.

It looks like a broken message on the server, and the Android device may compensate for that.

You could delete the message from the server using the other device, or your webmail interface, then restart eM Client and see if there is any difference.

Thank you for the response. Restarting or rebuilding the INBOX folder usually works, just very annoying. How can I determine which message is causing the issue? I don’t see any errors besides the occasional “Possible hole detected” one.

I found out more for you @binarydad.

What is happening is that the message isn’t broken, but it is missed in the sync. This can happen if the sync is interrupted in some inconvenient way.

I wanted to gather some logs even if someone else is able to assist. I think the issue is emClient is getting out of sync with the total message count. In all cases, my Android phones (Samsung Email app) receives the email, but emClient (on all clients) simply cannot see the new message unless I either 1) rebuild the INBOX folder cache, 2) close/restart emclient, or 3) read the message on the Android device (causing it to show up as read in emclient).

The parts below are both from my mail server (hMailServer) and emClient’s log. In the first section, it appears to be notifying the connected clients that there’s a new message. In the second, the Android phone is receiving it. There IS the “read operation failed” message, but I understand this is not actually an error in hmailserver.

Finally, the last section is emClient saying it did receive the “exists” notification, but because it believes the message count is the same, it did not pull it in.

After noticing this issue, another email came in, which cause 2 emails to now show up in emclient (the original missing one, and the new one).

So, I am not an expert in the IMAP protocol at all, but it seems to be something with the message count getting out of sync.


-- notifying connected clients that new message exists
"IMAPD"	376	7	"2021-09-13 14:00:10.351"	""	"SENT: * 4442 EXISTS"
"IMAPD"	376	7	"2021-09-13 14:00:10.351"	""	"SENT: * 1 RECENT"
"IMAPD"	376	2	"2021-09-13 14:00:10.351"	""	"SENT: * 4442 EXISTS"
"IMAPD"	376	2	"2021-09-13 14:00:10.351"	""	"SENT: * 1 RECENT"
"IMAPD"	376	21	"2021-09-13 14:00:10.351"	""	"SENT: * 4442 EXISTS"
"IMAPD"	376	21	"2021-09-13 14:00:10.351"	""	"SENT: * 1 RECENT"
"IMAPD"	376	69	"2021-09-13 14:00:10.351"	""	"SENT: * 4442 EXISTS"
"IMAPD"	376	69	"2021-09-13 14:00:10.351"	""	"SENT: * 1 RECENT"

-- updating IMAP status, telling Android phone ( that there is a new message
"IMAPD"	2296	93	"2021-09-13 14:00:11.398"	""	"SENT: 811 OK UID completed"
"IMAPD"	3944	93	"2021-09-13 14:00:11.429"	""	"RECEIVED: 812 UID FETCH 68390 (UID BODYSTRUCTURE)"
"IMAPD"	3944	93	"2021-09-13 14:00:11.429"	""	"SENT: * 4442 FETCH (UID 68390 BODYSTRUCTURE ("TEXT" "HTML" ("CHARSET" "us-ascii") NIL "9 outstanding tasks" "quoted-printable" 806 14))"
"IMAPD"	3944	93	"2021-09-13 14:00:11.429"	""	"SENT: 812 OK UID completed"
"IMAPD"	2484	93	"2021-09-13 14:00:11.492"	""	"RECEIVED: 813 UID SEARCH UID 68390"
"IMAPD"	2484	93	"2021-09-13 14:00:11.554"	""	"SENT: * SEARCH 68390"
"IMAPD"	2484	93	"2021-09-13 14:00:11.554"	""	"SENT: 813 OK UID completed"
"IMAPD"	2296	93	"2021-09-13 14:00:11.585"	""	"RECEIVED: 814 UID FETCH 68390 (UID BODY.PEEK[]<0.4096>)"
"IMAPD"	2296	93	"2021-09-13 14:00:11.585"	""	"SENT: * 4442 FETCH (UID 68390 BODY[]<0> {1256}"
"IMAPD"	2296	93	"2021-09-13 14:00:11.585"	""	"SENT: )"
"IMAPD"	2296	93	"2021-09-13 14:00:11.585"	""	"SENT: 814 OK UID completed"
"IMAPD"	2484	93	"2021-09-13 14:00:11.632"	""	"RECEIVED: 815 UID FETCH 68390 (UID BODY.PEEK[TEXT])"
"IMAPD"	2484	93	"2021-09-13 14:00:11.632"	""	"SENT: * 4442 FETCH (UID 68390 BODY[TEXT] {806}"
"IMAPD"	2484	93	"2021-09-13 14:00:11.632"	""	"SENT: )"
"IMAPD"	2484	93	"2021-09-13 14:00:11.632"	""	"SENT: 815 OK UID completed"
"DEBUG"	2296	"2021-09-13 14:00:11.960"	"The read operation failed. Bytes transferred: 0 Remote IP:, Session: 93, Code: 2, Message: End of file"
"DEBUG"	2296	"2021-09-13 14:00:11.960"	"Ending session 93"


14:00:01.200|06A| 09: * 4442 EXISTS
14:00:01.200|061| 09: --- Received EXISTS notification with the same message count as we are already aware - ignored
14:00:01.257|061| 09: * 1 RECENT

Also, I should note that I deleted an email just before this. This was done on my Android phone, which moves the message to the inbox. I don’t believe the app syncs the trash folder with the IMAP server, so could this behavior cause some sort of message-count-out-of-sync issue, thus causing emclient to think it has all it needs?

It really feels like emClient needs to honor the “X RECENT” flag.

And honestly, this issue has plagued me for years. Every so often I sink time into it, but never really get anywhere. I can’t tell which part of my setup is causing issues.

However, seeing that the server is sending a “1 RECENT” flag to emClient and it appears to be ignored, seems like there’s an issue with emClient specifically.

Is there any chance at all that you have a rule, or left something in the search which is filtering out that unread email until it is read?

Not in this case, as the email is missing on all instances of computers running (all latest versions of) emClient (but shows on all instances of Samsung Email).

I think I figured something out. After many years of having this issue, I did some digging and turns out the problem lies in the android Samsung Email client. I was able to reproduce the issue consistently.

  1. Receive an email
  2. Email shows up in both emClient and Samsung Email
  3. DELETE the email in the Samsung Email app
  4. The email is deleted in both emClient and Samsung Email
  5. However, when another email is received, the email will ONLY show up in the Samsung email app
  6. The only way to get things back in sync is to read the new email in the Samsung email app. Afterward, it will instantly “appear” in emClient

I believe the Samsung email app isn’t correctly setting the IMAP flag (or something like that) when it is REMOVING the message from the “inbox” folder. In fact, it doesn’t matter which folder I move it to, as long as it’s moved out of the inbox folder, the issue will happen (again, only when deleted from the Samsung Email app).

I’ve tried 2 different android mail apps, performed the same steps, and it now works perfectly - emails can be deleted from the android app without issue and it no longer causes this out-of-sync issue.

So, no fault of emClient, though part of me still wonders if it should honor any “X RECENT” notifications instead of going by the total email count for the folder.

Thanks to those who assisted! This has been bugging me for YEARS!