1 (edited by nicolasb827 2024-01-16 16:35:51)

Topic: Is there any objections not to change DB collation to utf8mb4 ?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  1.6.8
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version:  FreeBSD 13.1-RELEASE
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello,
I have the well known error of mix collation:

Jan  6 00:24:53 client postfix/proxymap[43711]: warning: mysql:/usr/local/etc/postfix/mysql/transport_maps_user.cf: query failed: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='
Jan  6 00:24:53 client postfix/trivial-rewrite[42662]: warning: proxy:mysql:/usr/local/etc/postfix/mysql/transport_maps_user.cf lookup error for "Lo?c.guilhomond@example.com"
Jan  6 00:24:53 client postfix/trivial-rewrite[42662]: warning: transport_maps lookup failure

according to MySQL:

root@127.0.0.1 [vmail]> show create table domain;
[...]
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |

BUT proxymap is using utf8mb4 by default (as set in proxymap man page)
Proxymap may be configured, but for postfix 3.9+ only (available port version is 3.8+ now)

So, my question is:
is there anything that will make ALTER TABLE .. utf8mb4 impossible ?
Do you have any other/better solution to handle this error ?

alter table admin convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table alias convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table alias_domain convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table anyone_shares convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table deleted_mailboxes convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table domain convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table domain_admins convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table forwardings convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table last_login convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table mailbox convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table maillist_owners convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table moderators convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table recipient_bcc_domain convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table recipient_bcc_user convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table sender_bcc_domain convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table sender_bcc_user convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table sender_relayhost convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table share_folder convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table used_quota convert to character set utf8mb4 collate utf8mb4_general_ci;

Thank you.
Nicolas.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Is there any objections not to change DB collation to utf8mb4 ?

You can convert them to utf8mb4, and iRedMail should switch to it too in the future.