Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
476 stars 168 forks source link

EML File Parsing Fails due to ALT tag in Content-Disposition section #362

Closed DisIsAbhi closed 1 year ago

DisIsAbhi commented 1 year ago

EML file with attachment contains Content-Disposition section with File name and ALT tags. if there is no ALT tag i am able to read the EML using Message.Load(fileinfo) but if there is an ALT tag then the reader throws an error that unexpected ALT, reach out to Developer for fix!

Current workaround is that i am reading the eml file, removing the ALT tag and saving it back so i can read it without errors. Thanks

Sicos1977 commented 1 year ago

Can you show me how this Content-Disposition looks like?

DisIsAbhi commented 1 year ago

I cant provide the actual file itself but it looks like this Content-Disposition: attachment; filename="Z\" alt="Filename.png". It is in the Line 4 or 5 of the EML when opened in a notepad++ I have also seen the alt tag being multiline. Content-Disposition: attachment; filename="Z\" could be in one line then alt tag could be in next line or in the same line and be multiline like below. alt="Filename.png.lfkdjgfghg flgkhflskghsfdligyusfgylosg dfglkdfglsdyfgsfg;lisyfdgh".

Sicos1977 commented 1 year ago

Can you show me the stack trace about where this exception is thrown? I can't find where I throw that message.

Sicos1977 commented 1 year ago

Support for the ALT tag is added in version 5.4.1