Skip to content

App crashes mb_convert_encoding encounters invalid encoding #12198

@abbasharoon

Description

@abbasharoon

Steps to reproduce

  1. Encode an email via an unsupported encoding e.g. x-mac-turkish
  2. Send the email to your own account
  3. Refresh your emails in Nextcloud mail app and it will start crashing when encountering the email that you sent

Expected behavior

Gracefully handle the error so that it doesn't make the whole app unusable

Actual behavior

The app crashed, you can't load the emails received prior to the buggy email

Mail app version

5.6.5

Nextcloud version

32.0.3

Mailserver or service

Custom SMTP server

Operating system

Ubuntu

PHP engine version

PHP 8.3

Nextcloud memory caching

\OC\Memcache\Redi

Web server

Nginx

Database

MySQL

Additional info

Here are the logs:

[mail] Error: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "x-mac-turkish" in file '/var/snap/nextcloud/51617/nextcloud/extra-apps/mail/lib/IMAP/Charset/Converter.php' line 62
	GET /index.php/apps/mail/api/messages?mailboxId=6&limit=20&cursor=xxxxx&sort=newest&view=singleton
	 at Dec 28, 2025, 3:51:43 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions