Open rakoo opened 5 months ago
Unfortunately this approach breaks the case where values contain invalid atom characters, such as spaces for instance.
Oh well. I suppose we could have Encoder.AString
which uses an atom if the value doesn't contain special characters?
Wait, there are header field names with spaces ? This change is only for field names, not values (which should always be a string as you say)
-- Matthieu Rakotojaona
Wait, there are header field names with spaces ?
Technically yes. The only character a header field can't contain is a colon. See ftext
in RFC 5322 section 3.6.8.
Regardless, the string comes from the user of the library, which means that it can potentially be anything. We shouldn't produce invalid IMAP syntax even if the user provides an invalid header field name.
Out of curiosity, a literal also doesn't work with mailo
-- Matthieu Rakotojaona
This PR makes sure the fields in FETCH/SEARCH are atoms.
The spec says it is allowed to have strings (ie with double quotes) here, but I'm on an IMAP server that doesn't totally respect that:
The server in question is provided by mailo.com. I know this deviates from standard, but I can only guess if we send something stricter than expected then it's ok ?