Mail app keeps throwing Horde_Mime_Exception after PHP & Mail limits adjusted (Nextcloud AIO)

Hi everyone,

I’m running Nextcloud using Nextcloud All-in-One (AIO, Docker) and I’m facing a persistent issue with the Mail app.

Problem:
The Mail app keeps throwing the following error repeatedly in the logs:

Horde_Mime_Exception: Message size exceeds maximum permitted

What I already tried:

  • Increased PHP limits inside nextcloud-aio-nextcloud container:
    • memory_limit = 2G
    • upload_max_filesize = 2G
    • post_max_size = 2G
    • max_execution_time = 3600
  • Restarted the container and verified via php -i (values are applied correctly)
  • Set Mail app limit:
    php occ config:app:set mail max_message_size --value=50
  • Restarted Nextcloud again

Current behavior:

  • The error still appears in nextcloud.log
  • It seems the Mail app keeps trying to parse an existing large email
  • CLI commands like mail:account:list are not available in my setup
  • mail:account:debug requires an account-id, but there is no clear way to list account IDs via occ

Questions:

  1. What is the recommended way to identify the specific email (UID / folder) that causes Horde_Mime_Exception?
  2. Is there an official way to list mail account IDs via occ in current Mail app versions?
  3. Should lowering mail max_message_size skip already-existing large emails automatically, or is manual intervention required?
  4. Is deleting / moving the large email from the IMAP server the only supported fix?

Environment:

  • Nextcloud: AIO (Docker)
  • Mail app: enabled (default AIO version)
  • PHP-FPM inside container
  • Database: PostgreSQL (AIO)

Any guidance from maintainers or users who faced the same issue would be greatly appreciated.
Thanks in advance!

Can you please post the full raw log message. The stack trace is needed. Instructions for doing so can be found in the support template.

  1. Should lowering mail max_message_size skip already-existing large emails automatically, or is manual intervention required?

Neither – there is no such configuration value.

See the Admin Manual section entitled: Groupware->Mail->Troubleshooting->Get account IDs.

the log just showing that