I'm using the 0.5 patch. I tried to find the way to send the badmailfrom-badmailto and mfcheck rejection messages to my smtpd logfile. There is a patch at http://www.svm.cz/~jirka/qmail/ for this, I wrote the differences into the smtpd.c. It works vell in that case, when I don't use the smtp authentication. After the authentication the smtpd send these error messages to the smtp-session, not into the logfile. I know that there is a 2>&1 at the and of the smtpd run script, which redirect the stderr to the stdout (as I see the patch above send the errormessage to the stderr), but this will cause problem only in that case, when I use the smtp authentication.
I notice that the SMTP AUTH patch includes the following line:
if (fd_copy(2,1) == -1) return err_pipe();
I'm not sure why it does that, and why the call to vchkpw needs to use descriptors 2 and 3. There was a patch to that patch posted to the vpopmail list that fixed the problem of closing file descriptor 3 in the parent, perhaps the fdcopy (2,1) should be in the child process as well.
--- qmail-smtpd.c.orig Sat Jan 18 09:13:50 2003 +++ qmail-smtpd.c Sat Jan 18 19:51:09 2003 @@ -459,14 +459,13 @@ if (!stralloc_0(&resp)) die_nomem();
if (fd_copy(2,1) == -1) return err_pipe(); - close(3); if (pipe(pi) == -1) return err_pipe(); - if (pi[0] != 3) return err_pipe(); switch(child = fork()) { case -1: return err_fork(); case 0: close(pi[1]); + if (0 > fd_copy(3,pi[0])) _exit(1); sig_pipedefault(); execvp(*childargs, childargs); _exit(1);
-- Tom Collins [EMAIL PROTECTED]