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

Missing attachment when email is not multipart and only contains an attachment #2727

Open
arthurzenika opened this issue Dec 20, 2023 · 8 comments
Labels

Comments

@arthurzenika
Copy link

Describe the bug

When an email has no text or html content and is not multipart and only contains an attachment, postal doesn't show the attachment in the webUI.

To Reproduce

  1. Send the attached email
  2. Click on incoming messages, choose the email
  3. Click on Attachments
  4. See "There are no attachments for this message."

Expected behaviour

For the attachment to be displayed and downloadable in the webUI

Environment details

  • OS: n/a
  • Browser n/a
  • Version : 2.1.4
  • Type : n/a

Additional information/context

postal_example.eml.gz

@arthurzenika
Copy link
Author

Oh and for some context at first we though the bug was #1624

@willpower232
Copy link
Collaborator

I presume you're sending this message with SMTP and not the API? And also that the message arrives at its destination okay with the attachment intact?

@arthurzenika
Copy link
Author

Indeed the message is an incoming email into postal that should then trigger an HTTP endpoint that forwards the mails to our application. To the best of my knowledge, the message does not include the attachment in the HTTP endpoint json call.

(oh and happy new year by the way !)

@willpower232
Copy link
Collaborator

Haha happy new year indeed!

Whatever sends the message with Amazon SES to Postal doesn't construct it with parts, Postal won't identify the attachment at all. Even the scanners I've seen use message parts, are you constructing this message yourself or do you have another device involved?

@arthurzenika
Copy link
Author

I was indeed surprised to see the absence of parts in the email. The email is generated by a company that sends it to our company, we're looking into the possibility of ask them to change the way it is generated. But some mail clients seems to think the email is valid, I haven't found a tool that says the email is invalid.

@willpower232
Copy link
Collaborator

Yeah its definitely Postal being very strict in this context but I'm not sure how extensive the changes would need to be in order to parse it.

I can't immediately see where the attachments are parsed out in either lib/postal/smtp_server/client.rb or lib/postal/message_db/database.rb or lib/postal/message_db/message.rb

@catphish
Copy link
Contributor

This is definitely a bug. I never thought to look for attachments in a non-multipart email. I will see if we can fix it.

@deefdragon
Copy link

As a note, Ive encountered this before from gmail DMARC report emails. They also only send the attachment with the report, and no body text/html. I was hoping to use postal to assist in parsing and reporting of these DMARC emails, as opposed to grabbing the data by hand, but with this bug, its not yet possible.

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

No branches or pull requests

4 participants