From: Walter Alejandro Iglesias Subject: Re: Adding Message-ID to mail(1) To: tech@openbsd.org Date: Wed, 28 Aug 2024 09:38:00 +0200 On Mon, Aug 26, 2024 at 11:38:29AM +0200, Walter Alejandro Iglesias wrote: > On Mon, Aug 26, 2024 at 11:08:52AM +0200, Walter Alejandro Iglesias wrote: > > I don't remember if GNU mailutils version is able to read headers > > included in the same file you feed with the body (perhaps Mutt?) In > > this case you should be able to use a loop like this: > > > > for i in `cat /etc/lots_of_recipients`; do > > mail $i < body_including_headers.txt > > done > > > > But, so far, with the OpenBSD version of mail you can't do that. You > > cannot pass other headers than From, To, Cc, Bcc and Subject, and only > > in the ways explained in the man page. > > > > You can do the following with the bsd-mailx version you find in Debian > as a package: > > for i in `cat /etc/lots_of_recipients`; do > mail -a "Message-ID: " $i < body.txt > done > > It would be ideal to add such option to openbsd mail, in fact that was > my first idea years ago. I opted for a simpler solution according to > the approach of this project. > Or simply do this: $ echo Hello | mail -s hello `cat lots_of_recipients` You can also use an alias to many recipients. This is one symptom among thousands of how uselessly we complicate our lives and get lost in our own abstractions. Fun fact: after downloading the sources of the debian bsd-mailx package I mentioned, I discovered that it's a lightly patched version of OpenBSD mail(1). They only added the MIME headers in a very similar way to how I did with my patches except for it sets the Content-Type based in user's locale, which is not applicable to OpenBSD. For the '-a' option I mentioned earlier they added a generic header variable to the headers struct and a function that just does some grammar filtering. I didn't stop to think about this enough but at first glance, I do not see that it'll be welcome in this project to allow the user such flexibility. -- Walter