Commit graph

6 commits

Author SHA1 Message Date
e7c717d0fc
"Rename Mime10 to MIME10 in codebase
Renamed field 'Mime10' to 'MIME10' across multiple files for canonical representation and consistency with standard MIME naming format in the protocol."
2023-10-13 15:23:28 +02:00
07a3450103
Added SPDX license header 2023-10-13 15:08:53 +02:00
f60b689b03
Refactor EML file parsing and header extraction
We can no parse simple mails (multipart is not working yet). The existing implementation was made more efficient by refactoring the EML file parsing and header extraction mechanism. Added 'strings' and 'bytes' packages to facilitate these changes. Previously, headers and body were parsed separately which was unnecessarily complex and increased the chance of errors. Now, with the new function 'readEML' and the helper function 'parseEMLBodyParts', we are able to parse headers and body together which not only simplifies the code but also increases its reliability. Specifically, 'bytes.Buffer' now helps us capture body while parsing, which removes need for separate handling. Additionally, certain headers like 'charset' and body types are also accounted for in the new implementation, enhancing the completeness of information extracted from EML files.
2023-10-13 15:06:28 +02:00
3d50370a4c
Extract and set charset from email content type
The diff modifies how the email library handles the extraction of the mime media type from an email header. It uses the mime.ParseMediaType function to parse the content type header. The function gives back the media type as a string and a mapping of different associated parameters. This mapping was previously just printed, but now the charset parameter is also used for setting the charset of the email if it exists.
2023-09-27 11:29:58 +02:00
d733b6e17d
Making slight progress on EML parsing 2023-09-21 13:50:36 +02:00
d8d2a6e714
Add EML parsing functionality to mail package
Added two new functions `EMLToMsg` and `readEML` to the `mail` package. `EMLToMsg` function opens and parses a .eml file and returns a pre-filled Msg pointer. `readEML` opens an EML file and uses net/mail to parse the header and body. These changes are made to provide support for EML file parsing, which is a common requirement in many email-based applications.
2023-09-15 13:16:14 +02:00