duesee / imap-codec

Rock-solid and complete codec for IMAP
Apache License 2.0
35 stars 13 forks source link

higher-level(feat): Handle {De,En}coding of Mailbox #370

Open duesee opened 9 months ago

duesee commented 9 months ago

Rust MUAs need to handle {de,en}coding of mailbox (i.e., folder) names on their own. This means, that it might be required to use "decode_utf7", "decode_base64", ... before being able to display a mailbox. Ideally, the higher-level library already does that.

Questions:

duesee commented 9 months ago

From my reading of RFC 3501 (IMAP4rev1), modified UTF-7 is the only thing we need to care about in mailbox names.

RFC 9051 (IMAP4rev2) says:

Support for the Mailbox International Naming Convention described in this section is not required for IMAP4rev2-only clients and servers. It is only used for backward compatibility with IMAP4rev1 implementations.

Encoding is also relevant in an Envelope (e.g., in an email subject). Here we can have, e.g., =?UTF-8?Q?<data>?=, =?base64?Q?<data>?=, ...

soywod commented 2 months ago

It is exactly what I used to do with imap (and what I am doing right now with imap-flow). It could be great to integrate encoding/decoding inside the lib!