Mailing List Archive

Re: Solaris 2.5 CDE calendar manager hanging qmail-inject
> I have qmail 0.96 on some Solaris 2.5 systems and they seem to be working
> fine, but when the CDE calender manager (/usr/dt/bin/dtcm) tries to
> send mail it hangs along with a qmail-inject process for the user. ps
> shows something like this:

This has come up before. Sun's programmers can't. Not closing the
unused ends of a pipe really is a novice error.

For some reason, sendmail goes out of its way to forgive this mistake.
If you report it as a bug to Sun they will just say "oh but it works
with sendmail". (Depending how you get your kicks, you might have some
fun explaining to them why you don't want sendmail anywhere near your
systems... :-)

Here's a fix which works for Solaris, and anything POSIXish. Your
/usr/lib/sendmail is not the real sendmail, of course, but a link to, or
copy of, /var/qmail/bin/sendmail. (If you've installed qmail elsewhere,
adjust the argument to execv() below.) Remove /usr/lib/sendmail, and
install this program as /usr/lib/sendmail.

#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv) {
int i, m;
m = sysconf(_SC_OPEN_MAX);
for (i = 3; i < m; ++i)
close(i);
execv("/var/qmail/bin/sendmail", argv);
perror("exec"); return 69;
}

All it does is close all file descriptors except stdin, stdout, and
stderr---this should include the unwanted read end of the pipe,
improperly left open by dtcm---then invoke qmail's sendmail clone.

Tim.