Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server supports custom headers #1152

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

Shadow243
Copy link
Member

@Shadow243 Shadow243 commented Aug 9, 2024

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

  • Custom Header Search Not Supported: Stalwart currently does not support searching for custom headers (e.g., X-Auto-Bcc) because these headers are not indexed.

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

@Shadow243 Shadow243 force-pushed the server-supports-custom-headers branch from 2b053be to b1bd138 Compare August 9, 2024 00:30
@marclaporte marclaporte requested a review from kroky August 9, 2024 01:40
@marclaporte
Copy link
Member

@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.

@Shadow243 Shadow243 force-pushed the server-supports-custom-headers branch from b1bd138 to 39c7a6a Compare August 9, 2024 08:09
@Shadow243
Copy link
Member Author

@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.

modules/imap/hm-imap.php Outdated Show resolved Hide resolved
@Shadow243 Shadow243 force-pushed the server-supports-custom-headers branch from 39c7a6a to 73f5997 Compare August 10, 2024 13:06
@Shadow243 Shadow243 force-pushed the server-supports-custom-headers branch from 73f5997 to 700f49c Compare August 10, 2024 13:07
@marclaporte marclaporte requested a review from kroky August 10, 2024 16:15
@kroky kroky merged commit 8ba9b4d into cypht-org:master Aug 12, 2024
6 checks passed
@marclaporte
Copy link
Member

Potential regression: #1195

@@ -1099,7 +1099,7 @@ public function search($target='ALL', $uids=false, $terms=array(), $esearch=arra
if ($only_auto_bcc) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same conditions must have been here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants