Mail account won't load "Sync faile for INBOX. Data too long for column 'email' at row 1"

I’m running the Mail App V 1.9.1 and Nextcloud 21.0.0. As database I’m running MariaDB 10.4.18. Webserver is nginx on an Ubuntu 20.4.2 VM For quite some time I have the problem that one of my four mail accounts won’t load any messages in the mail app. This also leads to the problem that the priority inbox won’t ever finish loading. If I delete this specific Mail account everything works as intended. The odd thing is that I had the mail app working just fine with all four accounts.

In the log I get this error message which quite honestly doesn’t tell me anything. Can you help me decipher it?

{“reqId”:“3DpWxfUpPQ0Vu5RYOMO0”,“level”:3,“time”:“2021-03-11T18:25:34+00:00”,“remoteAddr”:“2003:f4:5716:6700:19eb:e70:ce68:6709”,“user”:“admin”,“app”:“mail”,“method”:“POST”,“url”:"/apps/mail/api/mailboxes/170/sync",“message”:{“Exception”:“OCA\Mail\Exception\ServiceException”,“Message”:“Sync failed for 13:INBOX: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘email’ at row 1”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",“line”:121,“function”:“sync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",“line”:161,“function”:“syncMailbox”,“class”:“OCA\Mail\Service\Sync\SyncService”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:218,“function”:“sync”,“class”:“OCA\Mail\Controller\MailboxesController”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:127,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“Line”:238,“Previous”:{“Exception”:“Doctrine\DBAL\Exception\DriverException”,“Message”:“An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘email’ at row 1”,“Code”:1406,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",“line”:1728,“function”:“convert”,“class”:“Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",“line”:1667,“function”:“handleDriverException”,“class”:“Doctrine\DBAL\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",“line”:1146,“function”:“convertExceptionDuringQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:257,“function”:“executeStatement”,“class”:“Doctrine\DBAL\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",“line”:213,“function”:“executeStatement”,“class”:“OC\DB\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",“line”:286,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Db/MessageMapper.php",“line”:309,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:293,“function”:“insertBulk”,“class”:“OCA\Mail\Db\MessageMapper”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:218,“function”:“runInitialSync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",“line”:121,“function”:“sync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",“line”:161,“function”:“syncMailbox”,“class”:“OCA\Mail\Service\Sync\SyncService”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:218,“function”:“sync”,“class”:“OCA\Mail\Controller\MailboxesController”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:127,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",“Line”:114,“Previous”:{“Exception”:“Doctrine\DBAL\Driver\PDO\Exception”,“Message”:“SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘email’ at row 1”,“Code”:1406,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",“line”:84,“function”:“new”,“class”:“Doctrine\DBAL\Driver\PDO\Exception”,“type”:"::"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",“line”:1136,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:257,“function”:“executeStatement”,“class”:“Doctrine\DBAL\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",“line”:213,“function”:“executeStatement”,“class”:“OC\DB\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",“line”:286,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Db/MessageMapper.php",“line”:309,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:293,“function”:“insertBulk”,“class”:“OCA\Mail\Db\MessageMapper”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:218,“function”:“runInitialSync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",“line”:121,“function”:“sync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",“line”:161,“function”:“syncMailbox”,“class”:“OCA\Mail\Service\Sync\SyncService”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:218,“function”:“sync”,“class”:“OCA\Mail\Controller\MailboxesController”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:127,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",“Line”:26,“Previous”:{“Exception”:“PDOException”,“Message”:“SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘email’ at row 1”,“Code”:“22001”,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",“line”:82,“function”:“execute”,“class”:“PDOStatement”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",“line”:1136,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:257,“function”:“executeStatement”,“class”:“Doctrine\DBAL\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",“line”:213,“function”:“executeStatement”,“class”:“OC\DB\Connection”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",“line”:286,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Db/MessageMapper.php",“line”:309,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:293,“function”:“insertBulk”,“class”:“OCA\Mail\Db\MessageMapper”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",“line”:218,“function”:“runInitialSync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",“line”:121,“function”:“sync”,“class”:“OCA\Mail\Service\Sync\ImapToDbSynchronizer”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",“line”:161,“function”:“syncMailbox”,“class”:“OCA\Mail\Service\Sync\SyncService”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:218,“function”:“sync”,“class”:“OCA\Mail\Controller\MailboxesController”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:127,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",“Line”:82}}},“CustomMessage”:“Sync failed for 13:INBOX: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘email’ at row 1”},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“21.0.0.18”,“id”:“604a625f1df28”}

We are aware: Too long email address breaks sync · Issue #3608 · nextcloud/mail · GitHub

however the fix will take a bit of time.

Hey,
Is there any updates on this issue ?
We have the exact same issue here for one user.
Is there any way to detect the mail which is causing the issue and remove it ?
Many thanks for your help
Nico