My main question is why isn't /bin/sh being executed with -r -- restricted mode? It seems weird that a safety-critical piece of code would just call out to /bin/sh without doing that, especially on openBSD?
https://bonedaddy.net/pabs3/log/2014/02/17/pid-preservation-...
Of course, the reason they're invoking an external MDA is because this is classically how smptds and local mail delivery is separated. Is there a great reason for that? Not really. The MDA could be embedded in the smtpd.
Also, it's a bashism. It's not implemented by the OpenBSD's /bin/sh.