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

Lack testing of emails using PGP and S/MIME encryption. #88

Closed
dallaslu opened this issue Jul 23, 2024 · 2 comments
Closed

Lack testing of emails using PGP and S/MIME encryption. #88

dallaslu opened this issue Jul 23, 2024 · 2 comments

Comments

@dallaslu
Copy link
Contributor

Mainly derived from mimeDecode.php. it seems its not finished supporting encrypted emails.

Currently, in 2.7.3, errors are often encountered that prevent synchronization:

23/07/2024 01:18:47 [435106] [WARN] [[email protected]] /usr/local/lib/z-push/include/mimeDecode.php:347 Undefined array key 1 (2)
23/07/2024 01:18:47 [435106] [WARN] [[email protected]] /usr/local/lib/z-push/backend/imap/imap.php:1453 Undefined array key 0 (2)
23/07/2024 01:18:47 [435106] [WARN] [email protected]] /usr/local/lib/z-push/backend/imap/imap.php:1453 Undefined array key 1 (2)
23/07/2024 01:18:47 [435106] [WARN] [[email protected]] /usr/local/lib/z-push/backend/imap/imap.php:1453 Undefined array key 2 (2)
23/07/2024 01:18:47 [445311] [WARN] [email protected]] Mobile loop detected! Messages sent to the mobile will be restricted to 1 items in order to identify the conflict

@matidau
Copy link
Collaborator

matidau commented Jul 23, 2024

Hi @dallaslu

More than likely this is a PHP8.x related error, but I can't confirm how complete it may be as I haven't done any PGP testing. I don't use PGP myself.

If you want to fully test before a release is done, I suggest you test against the develop branch.

Also happy for you to submit any PRs around this.

Cheers,
Mat

@dallaslu
Copy link
Contributor Author

dallaslu commented Jul 23, 2024

There are some confusing aspects of these places. While I don't know the details of the technical standards involved in this section, it smells bad.

The processing in this case is not in the same format as the $return->parts produced by the other cases. There's a break here, but there's another branch definition for the same case later.

/src/include/mimeDecode.php line 344:

 case 'multipart/signed': // PGP
    $parts = $this->_boundarySplit($body, $content_type['other']['boundary'], true);
    $return->parts['msg_body'] = $parts[0];
    list($part_header, $part_body) = $this->_splitBodyHeader($parts[1]);
    $return->parts['sig_hdr'] = $part_header;
    $return->parts['sig_body'] = $part_body;
    break;

Here, the index is used instead of the key to loop through the $mparts.

backend/imap/imap.php line 1455:

for ($i=0; $i < count($mparts); $i++) {
     $part = $mparts[$i];

@matidau matidau closed this as completed in a85561f Aug 8, 2024
matidau added a commit that referenced this issue Aug 8, 2024
fixed #88 PGP and S/MIME encryption
matidau added a commit to matidau/Z-Push that referenced this issue Aug 8, 2024
matidau added a commit that referenced this issue 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

No branches or pull requests

2 participants