go-message icon indicating copy to clipboard operation
go-message copied to clipboard

Prefer simpler addresses in headers when possible

Open bandali opened this issue 1 year ago • 2 comments

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.

bandali avatar Mar 11 '24 20:03 bandali

~~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.

emersion avatar Mar 11 '24 21:03 emersion

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.

bandali avatar Mar 11 '24 21:03 bandali