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

Attching a zip file file produces "Warning! Not all atthacments have been uploaded" error #1883

Open
alyandon opened this issue Jan 11, 2025 · 3 comments

Comments

@alyandon
Copy link

Describe the bug
I'm unable to attach .zip files that are well under the threshold for PHP max file upload. It seems to be something specific to the .zip file extension as I have no problems attaching large pictures (.png, .jpg) and archives that are anything but .zip (.rar, .7z).

To Reproduce
Steps to reproduce the behavior:

  1. Create a text file (test.txt)
  2. Add some text to it (e.g. abc123)
  3. Add test.txt to a zip file using utility of choice
  4. Create a new email
  5. Attempt to attach zip file to email
  6. Notice that the attachment filename is red which indicates an error.
  7. Attempt to send the email gets the ""Warning! Not all atthacments have been uploaded" error.

Expected behavior
Snappy mail should send the email or give a very specific reason as to why the attachment failed to upload.

Screenshots
image

Please complete the following information:

  • Browser: Firefox 135b02
  • unknown - IMAP is hosted service at ionos
  • PHP version: 8.1-fpm
  • SnappyMail Version: 2.38.2
  • Mode: standalone

Debug/logging information
No errors appear in nginx PHP logs or in snappy mail application logs.
Browser console window does show a "Error: Attempt to postMessage on disconnected port" error but that doesn't really seem important.

Additional context
Really at the end of my rope trying to figure this out as as usually errors show up in either the console or the server logs. This seems suspiciously like the client side snappymail app is trying to peek inside or otherwise interpret files with a .zip extension instead of treating them like an opaque binary blob.

@alyandon
Copy link
Author

alyandon commented Jan 13, 2025

On a hunch, I enabled debug logging and this turned out to be the result of the php-zip package not being installed. The error is "Class ZipArchive not found".

This is still a problem because:

  1. Why does snappymail care about .zip at all vs any other opaque binary blob I might attach to an email?
  2. My default logging level is set to Warning (4) which should still show errors

@alyandon
Copy link
Author

This is likely the culprit:

Looks like it needs a class_exists('ZipArchive') check like all the other spots ZipArchive is used?

@alyandon
Copy link
Author

And it looks like the class not found error is getting wrapped and returned as an INFO level message. That explains why it wasn't showing up in my logs.

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

1 participant