- Server operating system version
- Ubuntu 24.04.3 LTS
- Plesk version and microupdate number
- Obsidian 18.0.71 Update #2
We’re running into major performance issues on our Plesk server when IMAP clients try to open large emails. Some messages (around 30–36MB) take over 90 seconds to load via IMAP (UID FETCH), even though the same message is read almost instantly using cat in the shell.
System info:
Issue
When opening (large) messages (for example 35mb) are opened in clients like iOS Mail, iPadOS, or mobile email apps, loading via IMAP is extremely slow (25–90+ seconds). Oddly, this does not happen in Roundcube (webmail) or Outlook for Windows — they open the same emails quickly.
We suspect this isn't a client-side issue, though, because even when reading the same message over SSH using doveadm fetch, it takes equally long. However, when fetching the exact same message from the filesystem with cat, it returns in milliseconds.
What we tested:
1) Direct read speed (instant):
2) Dovecot IMAP fetch (very slow, tried on empty mailbox):
3) Moved mail to a clean test folder:
No performance difference.
4) Tried Dovecot config tweaks:
- maildir_very_dirty_syncs = yes → no noticeable improvement
- mmap_disable = yes → made it even slower
- mail_attachment_detection_options = add-flags → no effect
- Forced reindex with doveadm force-resync → no effect
- Indexing in custom path using :INDEX= → same performance
5) Mail count does not seem to be the problem:
Even in mailboxes with less than 1000 messages, large mails load just as slowly.
Example from logs:
Normal:
Not normal:
Question:
Why does Dovecot take this long to deliver large messages via IMAP, even though:
- The underlying file can be read instantly
- Disk I/O is very fast
- Maildir index files are in place
- The mailbox is small and clean
Is this a known issue with large MIME multipart messages? Or is there any Dovecot/Plesk-specific tuning required for better performance in these cases? I can't imagine this is normal on a very fast server.
We’d really appreciate any insights or solutions.
System info:
- OS: Ubuntu 24.04.3 LTS
- Plesk: Obsidian 18.0.71 Update #2
- Mailserver: Postfix + Dovecot (via Plesk)
- Filesystem: ext4 on SSD (/dev/vda1)
- Disk performance: ~511 MB/s (tested with dd if=/dev/zero of=/tmp/testfile bs=1M count=1024 oflag=dsync)
Issue
When opening (large) messages (for example 35mb) are opened in clients like iOS Mail, iPadOS, or mobile email apps, loading via IMAP is extremely slow (25–90+ seconds). Oddly, this does not happen in Roundcube (webmail) or Outlook for Windows — they open the same emails quickly.
We suspect this isn't a client-side issue, though, because even when reading the same message over SSH using doveadm fetch, it takes equally long. However, when fetching the exact same message from the filesystem with cat, it returns in milliseconds.
What we tested:
1) Direct read speed (instant):
Code:
time cat /var/qmail/.../.Test/cur/... > /dev/null
→ real 0.007s
2) Dovecot IMAP fetch (very slow, tried on empty mailbox):
Code:
time doveadm fetch -u [email protected] text mailbox INBOX.Test uid 1
→ real 27.6s (in some case up to 90s+)
3) Moved mail to a clean test folder:
No performance difference.
4) Tried Dovecot config tweaks:
- maildir_very_dirty_syncs = yes → no noticeable improvement
- mmap_disable = yes → made it even slower
- mail_attachment_detection_options = add-flags → no effect
- Forced reindex with doveadm force-resync → no effect
- Indexing in custom path using :INDEX= → same performance
5) Mail count does not seem to be the problem:
Even in mailboxes with less than 1000 messages, large mails load just as slowly.
Example from logs:
Normal:
Code:
Disconnected: Connection closed (UID FETCH finished 0.019 secs ago) rcvd=189, sent=1410
Disconnected: Connection closed (UID FETCH finished 0.019 secs ago) rcvd=955, sent=3815
Disconnected: Connection closed (UID FETCH finished 1.227 secs ago) rcvd=1529, sent=10815
Not normal:
Code:
Disconnected: Connection closed (UID FETCH finished 93.437 secs ago) rcvd=11195, sent=59313632
Disconnected: Connection closed (UID FETCH finished 50.468 secs ago) rcvd=756, sent=1160928
Disconnected: Connection closed (UID FETCH finished 161.791 secs ago) rcvd=1438, sent=1811659
Question:
Why does Dovecot take this long to deliver large messages via IMAP, even though:
- The underlying file can be read instantly
- Disk I/O is very fast
- Maildir index files are in place
- The mailbox is small and clean
Is this a known issue with large MIME multipart messages? Or is there any Dovecot/Plesk-specific tuning required for better performance in these cases? I can't imagine this is normal on a very fast server.
We’d really appreciate any insights or solutions.