-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
Oh and for some context at first we though the bug was #1624 |
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? |
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 !) |
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? |
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. |
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 |
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. |
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. |
I've been testing with DMARC-reports the last few days, and it was working, until today, when it suddently stoped working for mimecast.org and google.com. In postal headers, it says "attachment; filename=google.com!!1719619200!1719705599.zip", and if I download the mail, it has an attachment, but when it reaches the HTTP-endpoint, it does not have an attachment, but the size of the request indicates there is an attachment there. |
@Laaknor I just ran into the exact same issue. Did you manage to find a workaround ? |
No, I have temporary changed my DMARC-handling to another solution with a shared mailbox. |
@sinnbeck our work around was to ask for the sender to change the message, so not really, sorry. |
@Laaknor Ah too bad. I might try setting it up with mailgun instead then. At least until a fix is made down the line :) Thanks! @arthurzenika Sadly it is dmarc emails from google and has the issue, so I don't think I can ask them to fix it :( |
This is one of the bugs I have offered (offer still stands btw) to sponsor getting fixed, but I have received no communication on actually doing so after the offer in the discord. I'm also not sure the best way to go about it. |
@deefdragon Sad to hear that. I wish I had the understanding to make a pr myself, but sadly I know nothing about mail parsing :/ |
I want to see if I can find a workaround for this, but I am unable to recreate the issue when sending an email myself. Does anyone know of a way to trigger the bug from a mail client (outlook, gmail etc) ? |
I believe I have found a work around. Instead of letting postal parse the email, I just send the raw message to my server as form data, and then use a mime parser there to extract the attachment. In testing it worked like a charm. I will report back if there are any issues down the line :) |
I have been running it for 4 days now and everything seems to be working as expected :) 30 reports so far and several of them from google. |
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
Expected behaviour
For the attachment to be displayed and downloadable in the webUI
Environment details
Additional information/context
postal_example.eml.gz
The text was updated successfully, but these errors were encountered: