untrusted comment: verify with openbsd-64-base.pub
RWQq6XmS4eDAcT7iguLT8P2N4KVuxYXFb9rqG8JKe0uVSFR+dDlXh5TMkn8zF8IdAJrJRVOGSb9TxFjWlPKtBZLT/57ZH2pv0gk=
OpenBSD 6.4 errata 007, November 29, 2018
The mail.mda and mail.lmtp delivery agents were not reporting temporary
failures correctly, causing smtpd to bounce messages in some cases where
it should have retried them.
int
main(int argc, char *argv[])
{
int ch;
+ int ret;
if (! geteuid())
errx(1, "mail.mda: may not be executed as root");
@@ -51,5 +54,15 @@ main(int argc, char *argv[])
if (argc > 1)
errx(1, "mail.mda: only one command is supported");
- return system(argv[0]) == 0 ? 0 : 1;
+ /* could not obtain a shell or could not obtain wait status,
+ * tempfail */
+ if ((ret = system(argv[0])) == -1)
+ errx(EX_TEMPFAIL, "%s", strerror(errno));
+
+ /* not exited properly but we have no details,
+ * tempfail */
+ if (! WIFEXITED(ret))
+ exit(EX_TEMPFAIL);
+
+ exit(WEXITSTATUS(ret));
}