Skip to content

Conversation

@Diogofornazari
Copy link

Released under the GNU Affero General Public License (AGPL), version 3

Fix for 0-byte attachments and broken MIME structure in IMAP backend

Description: This PR fixes the bug reported in Issue #NUMERO_DA_SUA_ISSUE.

Changes proposed in this pull request:

Fixed add_sub_part:

Now explicitly blacklists Content-Length and Content-Transfer-Encoding headers from the original message to prevent data corruption (0-byte attachments).

Identifies message/rfc822 as a container, preventing it from being treated as an empty file body.

Forces base64 encoding only on file leaves, not on containers.

Fixed add_extra_sub_parts:

Added logic to handle nested MIME structures recursively without flattening them incorrectly.

Introduced $inside_container flag to preserve body text within forwarded .eml attachments.

Prevented duplication of attachments in the root message when multipart structures are processed.

Testing

Environment: Z-Push 2.7.5 / PHP 8.3 / Dovecot 2.3.20.

Client: Outlook 2511 (ActiveSync).

Result: Forwarded emails with attachments now arrive with correct file sizes. Nested .eml attachments open correctly with body and attachments intact.

Fixes #180

Manfred Kutas and others added 30 commits April 1, 2021 00:11
…ned-error-in-sprintf to develop

* commit 'cf4af808225f09433aebd11abd8b51697d80182f':
  ZP-1621 BackendCombined: Fix typo in ImportFolderDeletion(). Released under the Affero GNU General Public License (AGPL) version 3.
…ing-quote-resulting-in-failed-rfc822-check to develop

* commit '1063692500aaaf3bbdb4cfbe5e76f37e9bb02f24':
  ZP-1441 Utils: remove double whitespace in address, renaming and fix typos. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1441 BackendMaildir: disable validation of atoms in address-headers. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1441 Mail_RFC822: disable validation of atoms in address-headers. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1441 Mail_RFC822: remove quote-adding workaround, add updates from Pear/Mail source (GitHub). Released under the Affero GNU General Public License (AGPL) version 3.
…dprovider-increase-maxwaitcycles-value to develop

* commit 'cbda3cc019947c17dbfa8fbf19e293e092b99097':
  ZP-1623 IpcMemcachedProvider: Increase maxWaitCycles value. Released under the Affero GNU General Public License (AGPL) version 3.
…to-user-for-post-requests-only to develop

* commit 'c5fdcd25dfea18883f7261423ab5ac5ba06b06fd':
  ZP-1625 Save device data in POST requests only.
…ero GNU General Public License (AGPL) version 3.
…om-sync-filter-type-support to develop

* commit '1fe318d07bc0e1a9785b56d5e36857e08ef83add':
  ZP-1624 . Added MAX_CUSTOM_FILTERTYPE control. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1624 . Replaced tabs with spaces. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1624 1 year custom sync filter type support. Released under the Affero GNU General Public License (AGPL) version 3.
Released under the Affero GNU General Public License (AGPL) version 3.
…rialize state machine data read from disk

Merge in ZHUB/z-push from feature/ZP-1626-retry-loop-when-failing-to-unserialize-state-machine-data-read-from-disk to develop

* commit 'f313344b891192323074bd2d0338bb29ea161471':
  ZP-1626 . Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1626 . First version. Released under the Affero GNU General Public License (AGPL) version 3.
…s' of https://stash.kopano.io/scm/zhub/z-push into bugfix/ZP-1617-the-ios-devices-send-two-accept-responses
…responses

Merge in ZHUB/z-push from bugfix/ZP-1617-the-ios-devices-send-two-accept-responses to develop

* commit 'b939cad5f177695caaec3035c15a6e7a92d4a659':
  ZP-1617 ios devices send two responses.
  ZP-1617 Meeting response sent twice on an ios device.
Added display of loaded Backend

Released under the Affero GNU General Public License (AGPL) version 3.
Merge in ZHUB/z-push from bugfix/ZP-1632-syntax-error-in-kopano-backend-2.6.3 to develop

* commit 'b23f06a01b615446cdd5b19d3383b767610ce974':
  Added missing $
…Removed SafeGetContentsUnserialize not more needed. Released under the Affero GNU General Public License (AGPL) version 3.
…er the Affero GNU General Public License (AGPL) version 3.
…ity (not used in ActiveSync specifications). Released under the Affero GNU General Public License (AGPL) version 3.
Merge in ZHUB/z-push from feature/ZP-1626-retry-loop-when-failing-to-unserialize-state-machine-data-read-from-disk to develop

* commit '41c1aac2012fb62ea7565a4a81bfc25fe9993668':
  ZP-1626 . SafeGetContents is now able to unserialize with opt param. Removed SafeGetContentsUnserialize not more needed. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1626 . Re-added SafeGetContents. Released under the Affero GNU General Public License (AGPL) version 3.
…ncelled exception. Released under the Affero GNU General Public License (AGPL) version 3.
…nstancetype by checking for RRULE, RECURRENCE-ID and existing event. Released under the Affero GNU General Public License (AGPL) version 3.
… under the Affero GNU General Public License (AGPL) version 3.
…ons to VEVENTs as iCalender does not inherit. Released under the Affero GNU General Public License (AGPL) version 3.
…. Released under the Affero GNU General Public License (AGPL) version 3.
… to recipients array. Released under the Affero GNU General Public License (AGPL) version 3.
Released under the Affero GNU General Public License (AGPL) version 3.
…te-fix-loss-of-content-with-outlook-and-koe

ZP-1615 BackendStickyNote: Fix loss of content with Outlook and KOE on ChangeMessage() without changes.
matidau and others added 30 commits November 1, 2024 11:44
…n, update or deletion

AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@127bb01
AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@51a0e0d
AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@171677a
…an attendee to a standard appointment on the mobile)

AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@5c2e7a5
…ug when switching calendars during creation)

AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@f0b90a8
… be treated as floats

AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@eba9428
Removed reference to wiki.z-hub.io and replaced with link to Github documentation.
Simplify Nginx directive with case-insensitive match.
to use parameters to prevent SQL Injection
CVE-2025-8264
as reported by Snyk and XBOW
CVE-2025-8264 - Imap - update user_identity getIdentityFromSql, to use parameters to prevent SQL Injection
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.