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

Undeliverable mail: attachment parsing error #334

Closed
bastian-schur opened this issue Apr 4, 2018 · 4 comments
Closed

Undeliverable mail: attachment parsing error #334

bastian-schur opened this issue Apr 4, 2018 · 4 comments

Comments

@bastian-schur
Copy link

Hi,

i've parsed a undeliverable mail with the original mail as attachment. When i use the getAttachments function from Message i get the attachments from the original mail ( attached as .eml file ) and not the correct attachments for this mail. The content of the attachments is always null!

@Slamdunk
Copy link
Collaborator

Slamdunk commented Apr 4, 2018

Hi, we need:

  1. the original mail content retrieved with the $message->getRawMessage()
  2. the calls that you do to this library
  3. what you expect exactly

@bastian-schur
Copy link
Author

bastian-schur commented Apr 4, 2018

Hi,

  1. sorry the mail is an internal document - i cant post this!
    if ( $message->hasAttachments() ) {
        foreach ( $message->getAttachments() as $attachment ) {
            nodusDebug( 'work on attachment ' . $attachment->getFilename() );
            try {
                $content = $attachment->getDecodedContent();
            } catch ( \Exception $e ) {
                $content = base64_decode( $attachment->getContent() );;
            }

            if ( !empty( $content ) ) {
                // Create File in Database
            }
        }
    }
  1. The Mail has one attachment: random_name.eml ( Attached E-Mail ). When i open the attached email with thunderbird i can see 5 images as attachments.
    The getAttachments() function returns the 5 images from the .eml attachment AND the .eml file! I expect only the .eml file and not the integrated attachments from it.

@Slamdunk
Copy link
Collaborator

Slamdunk commented Apr 4, 2018

I'm sorry but without the original email we can't reproduce the bug.

Maybe you can:

  1. Send the email to my personal email, I'll dig into the bug and drop the sensitive content
  2. Post here the email with the sensitive content stripped out

@bastian-schur
Copy link
Author

I try to generate a testmail an give you more feedback!

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

No branches or pull requests

2 participants