From: Walter Alejandro Iglesias Subject: Re: [patch] Adding In-Reply-To: support to mail(1) To: Tim Chase Cc: tech@openbsd.org Date: Thu, 1 Feb 2024 16:25:54 +0100 Hi, Some months ago I posted this patch: https://marc.info/?t=169616631000001&r=1&w=2 It was originally intended to add MIME headers to mail(1), but in the process I added other functionalities, also headers related. To facilitate the review now I split that diff in the first two below, and added a third one which solves some Subject issues[*]. They must be applied in the given order. 1. Message-ID, In-Reply-To and User-Agent: https://en.roquesor.com/Downloads/MailOpenBSD/mail_message-id_1.diff 2. MIME headers: https://en.roquesor.com/Downloads/MailOpenBSD/mail_mime_2.diff 3. Process Subject: wrap lines longer than 76 columns and base64 encode valid UTF-8: https://en.roquesor.com/Downloads/MailOpenBSD/mail_b64subject_3.diff (*) mail(1) doesn't do any process with the Subject, it doesn't wrap it at less of 76 columns, it doesn't remove control characters, it doesn't add a leading space when a subject contains a new line, what makes smtpd to cancel the delivery and print an error message: $ echo Hello | mail -s "$(printf 'Hello\nWorld')" sendmail: command failed: 550 5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant P.S.: Tomorrow I have surgery on my leg, so in case someone is interested in my patches this time, keep in mind that it'll probably take me a while to respond and deal with this. -- Walter