Mail fails loading e-mails from large account

Hi,
is there a limit to the size of email accounts or the number of messages? As I am not able to use your mail app, even though all the login data seem to be correct. It obviously works with other smaller accounts. The account however comprises 1600 MB.
Here the results of occ mail:account:diagnose for the larger account:

IMAP capabilities:
    - AUTH
    - ENABLE
    - ID
    - IDLE
    - IMAP4REV1
    - LITERAL+
    - LOGIN-REFERRALS
    - SASL-IR

    Account has 5322 messages in 20 mailboxes

Thanks for helping

5322 is actually not that big. The app should handle this with ease. Do you have anything in your logs?

If not, try lowering your log level to 0/debug or even enable debug mode. Then run the sync via CLI with occ mail:account:sync <accountid>. The logs should have some hopefully useful info afterwards.

An error occurs while running the given command. Here is the log entry:

    [mail] Error: OCA\Mail\Exception\ServiceException: Sync failed for 34:INBOX: An exception occurred while executing 'INSERT INTO `oc_mail_messages` (`uid`, `message_id`, `mailbox_id`, `subject`, `sent_at`, `flag_answered`, `flag_deleted`, `flag_draft`, `flag_flagged`, `flag_seen`, `flag_forwarded`, `flag_junk`, `flag_notjunk`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [7283, "<email-address>", 147, "<subject>", 1571563570, false, false, false, false, true, false, false, false]:

    SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x94\x8D' for column `nextcloud`.`oc_mail_messages`.`subject` at row 1 at <<closure>>

    0. <path to webserver>/htdocs/apps/mail/lib/Service/Sync/SyncService.php line 126
       OCA\Mail\Service\Sync\ImapToDbSynchronizer->sync(OCA\Mail\Account {}, OCA\Mail\Db\Mailbox {id: 147}, 42, [], true)
    1. <path to webserver>/htdocs/apps/mail/lib/Controller/FoldersController.php line 124
       OCA\Mail\Service\Sync\SyncService->syncMailbox(OCA\Mail\Account {}, "INBOX", 42, [], false, null)
    2. <path to webserver>/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 170
       OCA\Mail\Controller\FoldersController->sync(34, "SU5CT1g=", [], true, null)
    3. <path to webserver>/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 99
       OC\AppFramework\Http\Dispatcher->executeController(OCA\Mail\Controller\FoldersController {}, "sync")
    4. <path to webserver>/htdocs/lib/private/AppFramework/App.php line 125
       OC\AppFramework\Http\Dispatcher->dispatch(OCA\Mail\Controller\FoldersController {}, "sync")
    5. <path to webserver>/htdocs/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
       OC\AppFramework\App::main("OCA\\Mail\\Cont ... r", "sync", OC\AppFramework\ ... {}, {accountId: "34" ... "})
    6. <<closure>>
       OC\AppFramework\Routing\RouteActionHandler->__invoke({accountId: "34" ... "})
    7. <path to webserver>/htdocs/lib/private/Route/Router.php line 299
       call_user_func(OC\AppFramework\ ... {}, {accountId: "34" ... "})
    8. <path to webserver>/htdocs/lib/base.php line 1008
       OC\Route\Router->match("/apps/mail/api/ ... c")
    9. <path to webserver>/htdocs/index.php line 38
       OC::handleRequest()

    POST /index.php/apps/mail/api/accounts/34/folders/SU5CT1g%3D/sync
    from <IP-address> by <username> at 2020-06-04T15:29:44+00:00

Make sure you follow https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/mysql_4byte_support.html 100%.

Thank you. This worked for me.

1 Like