Closed saschabacardit closed 9 months ago
Hi,
Please check the nested email example to see how you could create a custom part:
https://github.com/stalwartlabs/mail-builder/blob/main/examples/nested_message.rs
Thank you, it seems I was using the library incorrectly.
I'll close the issue as I assume (correctly, or not) that the handling of these content types is beyond the intended scope of mail-builder.
I am working on a PGP compliant email application using this library and I've noticed however that adding a content_type to the headers of a message_builder such that
message_builder.header("Content-Type", "multipart/encrypted; protocol=\"application/pgp-encrypted\"")
(See https://datatracker.ietf.org/doc/html/rfc3156#section-4) Doesn't do anything, that is because when the message_builder gets transformed into a string via write the functionfn write_to(self, mut output: impl Write) -> io::Result<()>
which after adding date and message-id fields, will proceed to. callfn write_body(self, output: impl Write) -> io::Result<()>
which, before writing does set the Content-Type depending on the contents, which becomes an issue as for PGP messages it is required to have the correct multipart (see https://datatracker.ietf.org/doc/html/rfc3156#section-4 & https://datatracker.ietf.org/doc/html/rfc1847#section-2).I however, see that Stalwartlabs has a PGP compliant email application (see https://stalw.art/) so maybe I am misusing the library and this is a non-issue. If not, and mail-builder indeed does not handle custom content-types, could it be possible to make a PR for it with a possible solution or the project isn't open to them?
Apologies if this isn't the proper way to ask this sort of questions/issues, it is my first time working with open source projects.