Hi Lucas, Curiosity got the best of me and I confirmed the following:
1. This indeed broke in OpenBSD 5.6 when sendmail was replaced with OpenSMTPD as the default MTA and sendmail(8) became a symlink to mailwrapper(8). It was working in 5.5. 2. Alpine lets you specify an external sendmail command via runtime option, but oddly not the args passed (of which there are none when executed this way). If I take advantage of this and replace it with a phony script that captures stdin, it completes and I can write the contents to a file. 3. Alternatively, passing a proxy script that does nothing but call /usr/sbin/sendmail -t via the runtime config option, it works fine. 4. If I replace /usr/sbin/sendmail with a script and allow the hard-coded method to call it instead of the config option, it still hangs. The plot thickens. In summary: 1. sendmail(8) post-5.6 does not behave the same as pre-5.6 sendmail(8). I still have to confirm there were no changes or patches to Alpine around that time. 2. Alpine interacts differently with the sendmail tool depending on how it calls it (via hardcoded path or runtime option) - likely different code paths. The original Pine is pushing 40 years old so there is some really scary C code in there especially with string manipulation, but it's as good as it is. I may venture in and take another look, but it might be a good idea to validate why sendmail(8) on the surface doesn't appear to be 100% sendmail(tm) compatible. On Tuesday, April 29th, 2025, Lucas Gabriel Vuotto <lu...@sexy.is> wrote: > Hey Lloyd, > > On Tue, Apr 29, 2025 at 02:00:17AM +0000, Lloyd wrote: > > > There is a bug in Alpine whereby out of the box it is unable to send email > > on > > an OpenBSD box, even locally. By default, sending a message in unconfigured > > Alpine will fork out to sendmail(8) which hangs for some unknown reason and > > the sendmail wrapper process needs to be killed. Receiving mail works fine. > > > > Running /usr/sbin/sendmail -t < ~/dead.letter against the abandoned message > > works fine, so the interface between Alpine and the sendmail wrapper is > > broken. > > > > I ran a ktrace but couldn't find anything substantiative. Rather than debug > > this further, there is a much simpler patch to get Alpine working in the > > default install. The below change sets the value of smtp-server to localhost > > in the file which gets copied to /etc/pine.conf on installation. With this > > variable set, Alpine connects to the local smtpd over TCP rather than using > > the sendmail(8) utility, if the user has no smtp server defined. > > > > /etc/pine.conf is overridden by the user's ~/.pinerc so this should be a > > non-destructive change that will not impact anything but an unconfigured > > installation which falls back to using sendmail(8), which does not work. > > > > If it did work, then I believe --with-smtp-msa-flags=-t should be set in > > the Makefile as well since the hard-coded defaults pass bogus flags to > > sendmail(8). This didn't work either so it really doesn't matter, I believe > > the issue lies somewhere in the threading mechanism and how it forks out > > to sendmail. It's possible a prior security-related change broke something. > > > > This issue dates back to at least OpenBSD 6.8: > > > > https://marc.info/?l=openbsd-misc&m=161141614219034&w=2 > > > I'm not an alpine user, but got curious about this issue. Would you mind > sharing the bits of `ktrace -di alpine` related to exec functions with > me? It's important you share only those bits, as ktrace output might > include data like passwords. > > For the record, I verified that adding --with-smtp-msa-flags=-t does > indeed set it in the code, so that should be working. > > Lucas