-
Notifications
You must be signed in to change notification settings - Fork 19
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
Multipart emails with base64 encoded plaintext and html parts causing recursive thread locking. #130
Comments
Hello @outreach-soren, Thanks for the bug report.
Yes, Sisimai::MIME.mimedocode (called from Sisimai::Message::Email) support both Base64 and Quoted-Printable encodings.
MIME encoded message body is decoded to plain text before calling each scan method in Sisimai::Bite::* and Sisimai::RFC3464 inside of Sisimai::Message::Email.parse method. However, the value of diagnosis is encoded text, it may be a bug of Sisimai::MIME class. And then, "diagnosis" property is for keeping an error message of the email bounce and is used for deciding the value of "reason" property inside of Sisimai::Data.make method. If "diagnosis" property keeps the entire message body, it is a bug of Sisimai::MIME class. Would you post the entire email message including headers to this issue ? (or send us) Thanks |
Hey @azumakuniyuki, thanks for the quick reply.
I can't post the original message that caused the issue for confidentiality reasons but I will post the body structure that I believe is causing the problem. |
Here's the entire body with the content of the actual parts omitted. If there are other aspects that would be helpful to see then let me know and I can post more.
|
Hello, I've created a sample email based on your post: https://gist.github.com/azumakuniyuki/cd0f093d7b72f93a22dfe523464c7d04 Email headers are copied from https://github.com/sisimai/set-of-emails/blob/master/maildir/bsd/email-office365-08.eml, delivery status field is copied from https://github.com/sisimai/set-of-emails/blob/master/maildir/bsd/rfc3464-29.eml. Is the sample email on Gist the same structure with the bounce mail you have ? And then, would you tell me how to get a bounce mail which have the same structure ?
Thanks. |
Hey @azumakuniyuki, thanks for that the structure is roughly the same but after experimenting a bit I've realized that the issue actually does not occur without the attached mailing. To make things easier I've created this slimmed down version of the original problem email, which I've verified does reproduce the issue of the body not being decoded. This is directly based on the original message. https://gist.github.com/outreach-soren/ed8aa7160c18071894dbc4874072cd63 To reproduce run
The thread locking does not occur with this case as the body is much smaller than the actual message, but the root issue of the body not being decoded correctly does occur. |
@outreach-soren Hello, Thanks for the sample email ! I've got the following results which have no decoded base64 test in "diagnosticcode". I'll try to fix code to decode MIME encoded text.
Thanks. |
Great, that's the same result I get. Thank you so much for taking a look! |
Hey @azumakuniyuki, I've continued debugging this for a while, and in the flow I am following at least, the Have you made any progress on this issue? I'd also be curious as to whether you have any insight on the above. My concern is that even emails that do not cause this particular issue may not be getting decoded correctly before they are scanned for bounce data. |
Hello, I'm trying to implement a new method for decoding MIME encoded text (to flatten multipart) in Sisimai::MIME module, to rewrite code for calling Sisimai::MIME module in Sisimai::Message::Email.parse method, but it is not progressing because my main job is busy... Debugging summary is the following:
|
Hey @azumakuniyuki, thanks for the update. I'm glad you see the same issue that I see. It sounds like my concerns will be resolved by the changes you outline. I appreciate you taking the time to work on it. If you have more detailed action items I would be happy to help out to get this issue resolved. Thanks! |
@outreach-soren I'm sorry for the late reply :-( Debug is in 80% progress and we will be able to commit fixed code in a couple of days. |
@outreach-soren I've tagged Thanks. |
Hey @azumakuniyuki! Pulled and checked out the most recent version locally and it resolves the issue for the original message, as well as every other test case I've thrown at it. Thanks so much for resolving this! |
Hey @azumakuniyuki, I'm attempting to debug an issue that we encountered here at Outreach a little while ago, where a multipart/report message with an immediately nested multipart/alternative block, with base64 encoded text/plain and text/html sub-sections, caused Sisimai to recursively lock threads in the vm that was trying to process the message.
I've been digging into the cause of this issue and I have a few questions for you.
Sisimai::Data.make(data: the_created_message, hook: nil, input: 'email')
. What is the intention behind appending every line of the body to the diagnosis property? Is this necessary?Insight would be greatly appreciated.
Thanks
The text was updated successfully, but these errors were encountered: