Skip to content

Corrupted Base64 Attachments 3-5% of the Time. #21

Description

@ClaytonPulman

I would like some help, I have been using this library for some time now in testing. However I have noticed there is corruption in the Base64 output of some email attachments, some of the time. It happens from 3-5% of emails received by the application.

I am running PHP-FPM and Nginx on a Centos9 VM. I have done extensive testing, and I believe it is somewhere within this library.
I have been able to send many emails in quick succession, and compare the raw email output using "$mail" from a corrupted and non corrupted email. When comparing just the Base64 values of the same attachment over two different emails the base64 is corrupted sometimes by a single character. I can sometimes simply add a "0" to the front of a line within the base64 text and it will make the attachment work (base64 validated, and decode works). The strange thing also is the Base64 value within the raw email output will be short, breaking the base64 encoded data.

I have traced the error all the way back to the client.php file, even before it leverages the Zend Mail framework. I have even replaced this all together to use "ZBateson\MailMimeParser" to parse the data, and the issue is still present.

To cross out the thought of corruption in transit of the email to the library (before it gets to the server) I also have tried sending emails from multiple SMTP servers (Apple and Microsoft) both the same, I have also addressed the email to another address also (cc) and compared the received raw output, and the cc addressed email arriving in another mailbox is fine. The issue is somewhere within the library or within the Webserver.

Do you have any ideas?

I have already tried replacing the version of PHP from latest, to version 7, updated the mailparse, all without proper resolution of the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions