Hi Walter, i did not look closely at the patch yet, and i did not dig for standards documents, which one should almost certainly do before committing such a patch unless one knows all the relevant standards by heart (which i do not), so i'm not saying this must be done differently, but instead i am merely asking questions.
1. Are you really sure that a header like MIME-Version: 1.0 is not needed when you add Content-*: headers? 2. Are you really sure that a header like Content-Disposition: inline is not needed? 3. What is the reason for not simply hardcoding Content-Transfer-Encoding: 8bit when sending UTF-8 mail? Are there really still MTAs that choke on that in 2023? quoted-printable is definitely a PITA no matter the context, so in my book, if it can be avoided, avoiding it would be a plus. 4. What's the motivation for the -y flag taking an argument and not simply hardcoding "text/plain;charset=utf-8"? OpenBSD does not support any other charset and does not plan to change that in the future. I hope your next patch isn't going to be support for text/html. =:-S 5. What's the motivation for supporting -y without -e and for supporting -e without -y ? In general, we want as few options as possible and as little configurabity as possible. If there is a sane use case for something - in this case, sending UTF-8 mail - *one* option is possibly warranted. But adding more than one option would need a very robust justification, and so would adding an option that takes an argument. Note that mail(1) is not mail/swaks. Its purpose is reading and sending mail in a *simple* way, not low-level testing or protocol debugging. I'll postpone code review and testing, maybe you can simplify this first? Yours, Ingo