cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]. Supports IMAP/SMTP, JMAP and soon EWS
http://cypht.org
GNU Lesser General Public License v2.1
1.01k stars 164 forks source link

Server supports custom headers #1152

Closed Shadow243 closed 3 months ago

Shadow243 commented 3 months ago

Description

Based on a discussion from the Stalwart GitHub issue https://github.com/stalwartlabs/mail-server/discussions/477, it appears that Stalwart's IMAP server only indexes standard headers defined in RFCs and does not support searching custom headers (such as X-Auto-Bcc) by default. This design choice is intended to optimize server performance by maintaining a manageable index size, as most users typically search by common fields like recipients, subjects, or message contents.

Key Points

A server_supports_custom_headers function is implemented to determine if the server supports searching custom headers. This function sends a test command to the server and inspects the response to check for support.

Related Issue: https://github.com/cypht-org/cypht/issues/1149

Screenshot 2024-08-09 at 03 35 41
marclaporte commented 3 months ago

@Shadow243 I am fine to do a workaround for just one server, but please add a link to https://github.com/stalwartlabs/mail-server/discussions/477 in the source code so we remove the workaround if ever Stalwart no longer needs it.

Shadow243 commented 3 months ago

@Shadow243 I am fine to do a workaround for just one server, but please add a link to stalwartlabs/mail-server#477 in the source code so we remove the workaround if ever Stalwart no longer needs it.

Done.

marclaporte commented 3 months ago

Potential regression: https://github.com/cypht-org/cypht/issues/1195