emersion / go-message

✉️ A streaming Go library for the Internet Message Format and mail messages
MIT License
373 stars 108 forks source link

Prefer simpler addresses in headers when possible #178

Open bandali0 opened 4 months ago

bandali0 commented 4 months ago

It seems that the mail package almost always puts double-quotes around the 'name' part of addresses e.g. in From, To, etc. headers - even for pure ASCII names without commas, etc. - and I believe it also always wraps the address part in < and >:

It would be nice if the package would make these transformations only if necessary, and otherwise keep the simpler forms.

emersion commented 4 months ago

In both of these cases, I believe the "transformation" is necessary per the RFC. Nevermind, both are allowed.

Still I don't really understand why more complicated logic to format these is desirable.

bandali0 commented 4 months ago

My reasoning was that if the slightly shorter/cleaner and more visually pleasing forms (very subjective, I know) are permitted by the RFC, then maybe we'd consider keeping them as-is, unless otherwise required. But I agree that always doing something is indeed inherently simpler than only sometimes doing it. I suppose the how much depends on the case at hand, and as the author/expert here you're arguably the best of judge that. :slightly_smiling_face: So if you think it's too much complexity or not worth it, I'd understand, please feel free to close this issue.