Emails disappear from mailbox

Hello together,
We have built a Nextcloud for our school newspaper. Everything works as desired, only the emails cause problems. Setting up an email inbox often doesn’t work at first go, but then it works as desired.
After some time (several days), however, older messages disappear from the mailbox, they are not deleted but are simply no longer displayed. This problem has occurred both on our old Gmail mailbox and on our new Strato mailbox.
The logging overview also spits out a bunch of error messages related to the mail app (I post them at the bottom of the post, unfortunately I don’t know how to create collapsible quotes). All other error messages I have attached as a screenshot. By the way, the error messages always appear when I open the mail app.
About the hardware:
The whole instance runs on a Raspberry PI 3b+ in a case with HDD and fan, sufficient power supply etc.
NextcloudPi v1.31.0 runs on it
The Nextcloud version itself is 19.0.4
The problem with the mail app has always been with me, even after countless updates of Nextcloud and NextcloudPi.
I hope my error description is enough for you, if you need or want more detailed information about the hardware, please let me know, I am an absolute beginner.

Thanks for your help!
If you have any questions or need more detailed information, please contact me.


[mail] Error: OCA\Mail\Exception\ServiceException: IMAP errorAuthentication failed. at <>

OCA\Mail\Exception\ServiceException: IMAP errorAuthentication failed.

/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php - line 91:

OCA\Mail\IMAP\MailboxSync->sync(OCA\Mail\Account {}, true)

/var/www/nextcloud/lib/public/BackgroundJob/Job.php - line 80:

OCA\Mail\BackgroundJob\SyncJob->run({ accountId: 1})

/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php - line 61:

OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})

/var/www/nextcloud/cron.php - line 126:

OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

Verursacht durchHorde_Imap_Client_Exception: Authentication failed.

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 4566:

Horde_Imap_Client_Socket->_responseCode(Horde_Imap_C ... }}, Horde_Imap_C ... }})

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 4314:

Horde_Imap_Client_Socket->_getLine(Horde_Imap_C ... }})

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 4242:

Horde_Imap_Client_Socket->_sendCmdChunk(Horde_Imap_C ... }}, [ Horde_Imap ... }])

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 849:

Horde_Imap_Client_Socket->_sendCmd(Horde_Imap_C ... }})

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 512:

Horde_Imap_Client_Socket->_tryLogin("*** sensiti ... *")

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php - line 838:

Horde_Imap_Client_Socket->_login("*** sensiti ... *")

/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php - line 1389:

Horde_Imap_Client_Base->login("*** sensiti ... *")

/var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php - line 60:

Horde_Imap_Client_Base->listMailboxes("*", 5, { delimiter: ... e})

/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php - line 85:

OCA\Mail\IMAP\FolderMapper->getFolders(OCA\Mail\Account {}, Horde_Imap_C ... e})

/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php - line 91:

OCA\Mail\IMAP\MailboxSync->sync(OCA\Mail\Account {}, true)

/var/www/nextcloud/lib/public/BackgroundJob/Job.php - line 80:

OCA\Mail\BackgroundJob\SyncJob->run({ accountId: 1})

/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php - line 61:

OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})

/var/www/nextcloud/cron.php - line 126:

OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

So I’ve seen this as well. But only with two Gmail accounts. Nobody else has reported it before your topic here.

I have to say I’m still absolutely clueless about why that happens. I thought it was maybe some bug in the Gmail implementation of IMAP. But interesting to learn that another provider has the same problem.

1 Like

I’m experiencing this exact issue. I have two Gmail accounts added in my Mail application, and one of them simply vanishes emails. If there is any logging or information I can provide, please let me know!

Do you see any pattern about when the messages vanish? For me new ones show up, but then after a few minutes or so they are gone already. It’s an unsolved mystery unfortunately.

I’ve not noticed a pattern as of yet. However I do know that the only solution I have right now is to go to Gmail and switch the IMAP settings to limit the # of messages downloaded, save changes, go back in and change it back to Do not limit the number of messages in an IMAP folder. That triggers a redownload of the messages by any IMAP clients and I get my mails back for a time.

Wait, there is a setting for this?!

Thanks. Didn’t know about the option, but my account that loses messages also doesn’t have it enabled. But I wonder if there is something special about Gmails’s IMAP in any case, like they must do something different.