Mail: Unable to index inbox mail

Created on 7 Aug 2020  路  5Comments  路  Source: nextcloud/mail

Hi,

Nextcloud 19.0.1
Mail 1.4.1

I've the following error message while syncing my inbox :

OCA\Mail\Exception\ServiceException: Sync failed for 3:INBOX: An exception occurred while executing 'INSERT INTO oc_mail_recipients (message_id, type, label, email) VALUES(?, ?, ?, ?)' with params [3279, 0, "\x65\x74\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x73\x40\x6c\x65\x70\x65\x74\x69\x74\x76\x61\x70\x6f\x74\x65\x75\x72\x2e\x63\x6f\x6d\xc8\x6a\x2b\xff", "\x65\x74\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x73\x40\x6c\x65\x70\x65\x74\x69\x74\x76\x61\x70\x6f\x74\x65\x75\x72\x2e\x63\x6f\x6d\xc8\x6a\x2b\xff"]: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xC8j+\xFF' for column nextcloud.oc_mail_recipients.label at row 1

My label column is already in utf8 :

******** 4. row ********
TABLE_CATALOG: def
TABLE_SCHEMA: nextcloud
TABLE_NAME: oc_mail_recipients
COLUMN_NAME: label
ORDINAL_POSITION: 4
COLUMN_DEFAULT: NULL
IS_NULLABLE: YES
DATA_TYPE: varchar
CHARACTER_MAXIMUM_LENGTH: 255
CHARACTER_OCTET_LENGTH: 1020
NUMERIC_PRECISION: NULL
NUMERIC_SCALE: NULL
DATETIME_PRECISION: NULL
CHARACTER_SET_NAME: utf8mb4
COLLATION_NAME: utf8mb4_bin
COLUMN_TYPE: varchar(255)
COLUMN_KEY:
EXTRA:
PRIVILEGES: select,insert,update,references
COLUMN_COMMENT:
IS_GENERATED: NEVER
GENERATION_EXPRESSION: NULL

Other folders sync and display correctly.

I tried removing account and re-creating it, same result, the sync fail always on the same message.

If you need more informations just ask I'll do my best ! :-)

1. to develop bug

All 5 comments

Hi,

I've isolated the mail that cause nextcloud mail to fail : it contains an badly formatted recipient :

X-Amavis-Alert: BAD HEADER SECTION, Non-encoded non-ASCII data (and not UTF-8)
(char C8 hex): From:
[email protected]\x{C8}j+\x{FF}\x{7F}

I removed this email from my INBOX and now it works for me.

The bug is still present, removing the e-mail is a workaround.

Thanks,

I believe this is an issue with MySQL 4-byte support as after I enabled this support by following the commands listed here everything started working again for me.

Just follow those steps to enable the support and it should fix the problem. This will also fix files that have emojis in their name.

That can be a problem as well. But some systems are using the 4-byte support already and there is still data outside the utf-8 charset that then causes issues.

Hi, for information my database is already in 4-byte and I still had the problem.
I think the buggy character is not UTF8, preventing it to be written in database

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cheesewizz picture cheesewizz  路  5Comments

StCyr picture StCyr  路  4Comments

jancborchardt picture jancborchardt  路  4Comments

jancborchardt picture jancborchardt  路  5Comments

ChristophWurst picture ChristophWurst  路  3Comments