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

Handling of Multipart message fails #1

Closed
dceejay opened this issue Oct 13, 2020 · 2 comments
Closed

Handling of Multipart message fails #1

dceejay opened this issue Oct 13, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@dceejay
Copy link

dceejay commented Oct 13, 2020

Hi,

If a send a simple multipart message and catch it with your micromta code - then pass it to letterparser It fails to decode the parts...

Here is the incoming multipart

{
  recipients: [ 'Mike@foo.bar' ],
  sender: 'me@myserver.com',
  message: 'Content-Type: multipart/mixed; boundary="--_NmP-79d22631bd047a69-Part_1"\r\n' +
    'From: me@myserver.com\r\n' +
    'To: Mike@foo.bar\r\n' +
    'Subject: New Subject\r\n' +
    'Message-ID: <4392b49b-91b4-fad0-34a5-115a5cc96fa6@myserver.com>\r\n' +
    'Date: Tue, 13 Oct 2020 19:12:21 +0000\r\n' +
    'MIME-Version: 1.0\r\n' +
    '\r\n' +
    '----_NmP-79d22631bd047a69-Part_1\r\n' +
    'Content-Type: text/plain; charset=utf-8\r\n' +
    'Content-Transfer-Encoding: 7bit\r\n' +
    '\r\n' +
    'More words I have an attachment\r\n' +
    '----_NmP-79d22631bd047a69-Part_1\r\n' +
    'Content-Type: text/plain; name="c:/temp/foo.txt"\r\n' +
    'Content-Transfer-Encoding: base64\r\n' +
    'Content-Disposition: attachment; filename="c:/temp/foo.txt"\r\n' +
    '\r\n' +
    'U29tZSBzbWFsbCB3b3JkcyB0byB0ZXN0IGF0dGFjaG1lbnQ=\r\n' +
    '----_NmP-79d22631bd047a69-Part_1--'
}

If I add some debug I can that for some reason in line 43 of parser.js you do

    var split = value
        .toLowerCase()

which then ends up with parameters['boundary'] being all lower case which for the message above you can see is not the case... so I'm not sure why you make it all lowercase ?

However If I remove that then I do get a return object with multiple "body"s - but they are both empty strings.... so something else is also not working...

Many thanks

PS the email above was generated using nodemailer, in case that matters.

@mat-sz mat-sz self-assigned this Oct 14, 2020
@mat-sz mat-sz added the bug Something isn't working label Oct 14, 2020
@mat-sz
Copy link
Owner

mat-sz commented Oct 14, 2020

Thank you for your bug report and investigation, I will take a look at this right now.

@mat-sz
Copy link
Owner

mat-sz commented Oct 14, 2020

Resolved with 0.0.3.

@mat-sz mat-sz closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants