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

fixed #88 PGP and S/MIME encryption #89

Merged
merged 2 commits into from
Aug 8, 2024
Merged

Conversation

dallaslu
Copy link
Contributor

@dallaslu dallaslu commented Jul 24, 2024

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

What does this implement/fix? Explain your changes.

  1. There is duplicate code in case 'text/plain' and case 'text/html' in the switch statement.
  2. The case 'multipart/signed' creates a structurally distinct $return->parts that doesn't actually reference any of the three string keys elsewhere, which, combined with the duplicate code above, may be part of the unfinished work left over from a commit 7 years ago. The key to 'multipart/signed' is that the $this->_boundarySplit function is called with the parameter $eatline specified as true.

I looked at an email containing a PGP signature and there is no other special structure. So I believe that the separate case for multipart/signed was added in the commit 7 years ago, possibly for experimental and testing purposes, such as trying to verify PGP signatures. But it wasn't done and it wasn't tested.

With a simple modification, z-push can synchronize related PGP messages with the client without interrupting the synchronization or reporting errors. Perhaps the current simple modification does not have sufficient support for PGP mail (Mail.app for iOS does not support PGP, so I am not yet sure that the signature information is correctly synchronized with the client). But in principle, this modification doesn't break anything.

Does this close any currently open issues?

#88

Where has this been tested?

Server:

  • OS: Ubuntu
  • PHP Version: 8
  • Backend for: Mail-in-a-Box
  • Version: v69b

Smartphone:

  • Device: iPhone SE
  • OS: iOS 17.5.1
  • Mail App: Mail.app
  • Version:

@matidau matidau changed the title fixed #88 fixed #88 PGP and S/MIME encryption Jul 26, 2024
@matidau
Copy link
Collaborator

matidau commented Jul 26, 2024

Thanks for the PR @dallaslu

I will need to review and test this with the Zimbra backend as well as it makes use of the Mail_mimeDecode. There are a few other Issues and PRs ahead of this one, but will come back to it.

Cheers,
Mat

@matidau
Copy link
Collaborator

matidau commented Aug 1, 2024

Hi @dallaslu

I've started testing this and I'm getting the following error:

01/08/2024 17:00:25 [1253066] [FATAL] [mail@xxx.id.au] Fatal error: /usr/local/lib/z-push/include/mimeDecode.php:357 - Unclosed '{' on line 331 does not match ')' (4)

Do you mind reviewing?

@dallaslu
Copy link
Contributor Author

dallaslu commented Aug 1, 2024

Looks like I missed a commit to fix typo. It has been resolved and tested with the new version.

@matidau matidau merged commit 12a6300 into Z-Hub:develop Aug 8, 2024
2 checks passed
matidau added a commit to matidau/Z-Push that referenced this pull request Aug 8, 2024
matidau added a commit that referenced this pull request Aug 8, 2024
fixed #88 PGP and S/MIME encryption
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.

2 participants