[PR #944] [MERGED] [FIX] Stalwart: fix jmap 0.7.0 msg_header keys(message-id,message_id) #1166

Closed
opened 2026-02-25 21:37:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/944
Author: @Shadow243
Created: 4/11/2024
Status: Merged
Merged: 4/18/2024
Merged by: @kroky

Base: masterHead: jmap-stalwart-new-release-check


📝 Commits (1)

  • 4b1226d [FIX] Stalwart: fix jmap 0.7.0 msg_header keys(message-id,message_id)

📊 Changes

1 file changed (+7 additions, -2 deletions)

View changed files

📝 modules/smtp/modules.php (+7 -2)

📄 Description

Pull Request Description

Title: Update Draft Saving Functionality for Stalwart 0.7.0 Compatibility

Description:

Issue:
In Stalwart release 0.5.0, the message ID field was consistently labeled as "message-id" in the response data when saving drafts. However, with the release of Stalwart 0.7.0, there has been a change where the message ID field is now labeled as "message_id". This inconsistency has caused issues when attempting to save drafts as our codebase was expecting the previous format.

Solution:
To ensure compatibility with Stalwart 0.7.0 and future versions, this pull request updates the draft saving functionality to handle both "message-id" and "message_id" fields in the response data. The code now checks for the existence of both keys and compares their values accordingly. This change allows our application to seamlessly handle drafts saved using both versions of Stalwart.

Changes Made:

  • Modified the draft saving logic to accommodate both "message-id" and "message_id" fields in the response data.
  • Implemented a conditional check to handle the different field names and ensure compatibility across Stalwart versions.
  • Tested the updated functionality to verify correct behavior when saving drafts with Stalwart 0.7.0.

This pull request aims to resolve the compatibility issue with Stalwart 0.7.0 and improve the robustness of our draft saving feature for future releases.

    [0] => array(
        "uid" => "eaaaaaba",
        "flags" => "",
        "internal_date" => "2024-04-11T16:52:40Z",
        "size" => 609,
        "date" => "2024-04-11T16:52:38Z",
        "from" => "Steven NG <steven@lab14.evoludata.com>",
        "to" => "muhngesteven@gmail.com",
        "subject" => "Test Stalwart release 0.7.0",
        "content-type" => "",
        "timestamp" => 1712854360,
        "charset" => "",
        "x-priority" => "",
        "type" => "jmap",
        "references" => "",
        "message_id" => "52336d427c7dcbbcc5cbb3d57a485d12@Stevens-MacBook-Pro.local",
        "x_auto_bcc" => ""
    ),
    [1] => array(
        "uid" => "d2aaaaa3",
        "flags" => "",
        "internal_date" => "2024-04-11T16:52:03Z",
        "size" => 615,
        "date" => "2024-04-11T16:52:02Z",
        "from" => "Steven NG <steven@lab14.evoludata.com>",
        "to" => "muhngesteven@gmail.com",
        "subject" => "Test Stalwart release 0.7.0",
        "content-type" => "",
        "timestamp" => 1712854323,
        "charset" => "",
        "x-priority" => "",
        "type" => "jmap",
        "references" => "",
        "message_id" => "db0bd6557d9ae16ebce56259ba73fbd6@Stevens-MacBook-Pro.local",
        "x_auto_bcc" => ""
    ),
    [2] => array(
        // and so on for the remaining elements...
    ),
    // Remaining elements truncated for brevity
}

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/944 **Author:** [@Shadow243](https://github.com/Shadow243) **Created:** 4/11/2024 **Status:** ✅ Merged **Merged:** 4/18/2024 **Merged by:** [@kroky](https://github.com/kroky) **Base:** `master` ← **Head:** `jmap-stalwart-new-release-check` --- ### 📝 Commits (1) - [`4b1226d`](https://github.com/cypht-org/cypht/commit/4b1226d57048894db0988f38ae5ff2ddb72b7636) [FIX] Stalwart: fix jmap 0.7.0 msg_header keys(message-id,message_id) ### 📊 Changes **1 file changed** (+7 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `modules/smtp/modules.php` (+7 -2) </details> ### 📄 Description ### Pull Request Description **Title:** Update Draft Saving Functionality for Stalwart 0.7.0 Compatibility #### Description: **Issue:** In Stalwart release 0.5.0, the message ID field was consistently labeled as "message-id" in the response data when saving drafts. However, with the release of Stalwart 0.7.0, there has been a change where the message ID field is now labeled as "message_id". This inconsistency has caused issues when attempting to save drafts as our codebase was expecting the previous format. **Solution:** To ensure compatibility with Stalwart 0.7.0 and future versions, this pull request updates the draft saving functionality to handle both "message-id" and "message_id" fields in the response data. The code now checks for the existence of both keys and compares their values accordingly. This change allows our application to seamlessly handle drafts saved using both versions of Stalwart. **Changes Made:** - Modified the draft saving logic to accommodate both "message-id" and "message_id" fields in the response data. - Implemented a conditional check to handle the different field names and ensure compatibility across Stalwart versions. - Tested the updated functionality to verify correct behavior when saving drafts with Stalwart 0.7.0. This pull request aims to resolve the compatibility issue with Stalwart 0.7.0 and improve the robustness of our draft saving feature for future releases. ```array(10) { [0] => array( "uid" => "eaaaaaba", "flags" => "", "internal_date" => "2024-04-11T16:52:40Z", "size" => 609, "date" => "2024-04-11T16:52:38Z", "from" => "Steven NG <steven@lab14.evoludata.com>", "to" => "muhngesteven@gmail.com", "subject" => "Test Stalwart release 0.7.0", "content-type" => "", "timestamp" => 1712854360, "charset" => "", "x-priority" => "", "type" => "jmap", "references" => "", "message_id" => "52336d427c7dcbbcc5cbb3d57a485d12@Stevens-MacBook-Pro.local", "x_auto_bcc" => "" ), [1] => array( "uid" => "d2aaaaa3", "flags" => "", "internal_date" => "2024-04-11T16:52:03Z", "size" => 615, "date" => "2024-04-11T16:52:02Z", "from" => "Steven NG <steven@lab14.evoludata.com>", "to" => "muhngesteven@gmail.com", "subject" => "Test Stalwart release 0.7.0", "content-type" => "", "timestamp" => 1712854323, "charset" => "", "x-priority" => "", "type" => "jmap", "references" => "", "message_id" => "db0bd6557d9ae16ebce56259ba73fbd6@Stevens-MacBook-Pro.local", "x_auto_bcc" => "" ), [2] => array( // and so on for the remaining elements... ), // Remaining elements truncated for brevity } ``` Related Issue: [https://github.com/cypht-org/cypht/issues/931](https://github.com/cypht-org/cypht/issues/931) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:37:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1166
No description provided.