Steps to reproduce
This issue is surfaced with an email account that is hosted on Purelymail (puremail.com):
- Configure a Purelymail account in Nextcloud Mail via IMAP (
imap.purelymail.com:993, SSL/TLS).
- Ensure the account has a
Sent folder configured as the default Sent folder.
- Let the initial synchronization complete.
- Enable per-account Mail debug logging:
php occ mail:account:debug <account-id> --on
- Run:
php occ mail:account:sync -vvv <account-id>
- Observe the failure while syncing the
Sent folder.
- Check the IMAP debug log and observe:
C: STATUS Sent (PERMFLAGS)
S: BAD STATUS failed. Illegal arguments.
Expected behavior
Nextcloud Mail should successfully synchronize the Sent folder and determine whether permanent/custom message flags are supported without issuing an unsupported IMAP STATUS data item. The account sync should complete successfully.
Actual behavior
Synchronization aborts while processing the Sent folder with:
OCA\Mail\Exception\ServiceException:
Could not get message flag options from IMAP: IMAP error reported by server.
The IMAP log shows that Nextcloud/Horde issues:
C: STATUS Sent (PERMFLAGS)
and Purelymail responds:
S: BAD STATUS failed. Illegal arguments.
Immediately before this, Purelymail successfully reports:
S: * OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen \*)]
Mail app version
5.10.11
Nextcloud version
34.0.2
Mailserver or service
Purelymail (https://purelymail.com/)
Operating system
Ubuntu Linux 26.04
PHP engine version
PHP 8.3
Nextcloud memory caching
memcache.local: \OC\Memcache\APCu; memcache.distributed: not configured
Web server
Apache (supported)
Database
PostgreSQL
Additional info
Purelymail rejects STATUS Sent (PERMFLAGS) with BAD STATUS failed. Illegal arguments. However, it successfully returns PERMANENTFLAGS during SELECT/EXAMINE. RFC 9051 STATUS data items do not include PERMFLAGS and so maybe that's why it doesn't support it?
Nextcloud Mail legitimately needs to determine whether a mailbox supports permanent/custom flags for IMAP-backed tags and message flags. However, Purelymail already supplies this information through the standard PERMANENTFLAGS response to SELECT/EXAMINE. The subsequent Horde-generated STATUS (PERMFLAGS) query appears redundant and causes synchronization to abort on servers that reject that non-standard STATUS item.
Steps to reproduce
This issue is surfaced with an email account that is hosted on Purelymail (puremail.com):
imap.purelymail.com:993, SSL/TLS).Sentfolder configured as the default Sent folder.Sentfolder.Expected behavior
Nextcloud Mail should successfully synchronize the
Sentfolder and determine whether permanent/custom message flags are supported without issuing an unsupported IMAPSTATUSdata item. The account sync should complete successfully.Actual behavior
Synchronization aborts while processing the
Sentfolder with:The IMAP log shows that Nextcloud/Horde issues:
and Purelymail responds:
Immediately before this, Purelymail successfully reports:
Mail app version
5.10.11
Nextcloud version
34.0.2
Mailserver or service
Purelymail (https://purelymail.com/)
Operating system
Ubuntu Linux 26.04
PHP engine version
PHP 8.3
Nextcloud memory caching
memcache.local: \OC\Memcache\APCu; memcache.distributed: not configured
Web server
Apache (supported)
Database
PostgreSQL
Additional info
Purelymail rejects STATUS Sent (PERMFLAGS) with BAD STATUS failed. Illegal arguments. However, it successfully returns PERMANENTFLAGS during SELECT/EXAMINE. RFC 9051
STATUSdata items do not includePERMFLAGSand so maybe that's why it doesn't support it?Nextcloud Mail legitimately needs to determine whether a mailbox supports permanent/custom flags for IMAP-backed tags and message flags. However, Purelymail already supplies this information through the standard PERMANENTFLAGS response to SELECT/EXAMINE. The subsequent Horde-generated STATUS (PERMFLAGS) query appears redundant and causes synchronization to abort on servers that reject that non-standard STATUS item.