1 --- qmail-queue.8.orig 2008-08-21 22:22:59.007351087 +0400
2 +++ qmail-queue.8 2008-08-21 22:25:04.846922397 +0400
5 Internal bug; e.g., segmentation fault.
8 +Custom error (=bounce) messages.
9 +You have to write the error message to file descriptor 6
10 +and exit 82, in order to use the custom message.
11 +Format of the message:
13 +Dthis is a custom fatal error message
15 +Zthis is a custom temporary failure message
18 Envelope format error.
20 --- qmail.c.orig 2008-08-21 22:22:59.040684449 +0400
21 +++ qmail.c 2008-08-21 22:33:33.936870949 +0400
30 if (pipe(pim) == -1) return -1;
31 if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
32 + if (pipe(pierr) == -1) {
33 + close(pim[0]); close(pim[1]);
34 + close(pie[0]); close(pie[1]);
38 switch(qq->pid = vfork()) {
40 close(pim[0]); close(pim[1]);
41 close(pie[0]); close(pie[1]);
42 + close(pierr[0]); close(pierr[1]);
47 + close(pierr[0]); /* we want to receive data */
48 if (fd_move(0,pim[0]) == -1) _exit(120);
49 if (fd_move(1,pie[0]) == -1) _exit(120);
50 + if (fd_move(6,pierr[1]) == -1) _exit(120);
51 if (chdir(auto_qmail) == -1) _exit(61);
52 execv(*binqqargs,binqqargs);
56 qq->fdm = pim[1]; close(pim[0]);
57 qq->fde = pie[1]; close(pie[0]);
58 + qq->fderr = pierr[0]; close(pierr[1]);
59 substdio_fdbuf(&qq->ss,write,qq->fdm,qq->buf,sizeof(qq->buf));
68 + static char errstr[256];
72 if (!qq->flagerr) if (substdio_flush(&qq->ss) == -1) qq->flagerr = 1;
74 + substdio_fdbuf(&qq->ss,read,qq->fderr,qq->buf,sizeof(qq->buf));
75 + while (substdio_bget(&qq->ss,&ch,1) && len < 255) {
79 + if (len > 0) errstr[len]='\0'; /* add str-term */
82 if (wait_pid(&wstat,qq->pid) != qq->pid)
83 return "Zqq waitpid surprise (#4.3.0)";
85 case 81: return "Zqq internal bug (#4.3.0)";
86 case 120: return "Zunable to exec qq (#4.3.0)";
88 + if (exitcode == 82 && len > 2)
90 if ((exitcode >= 11) && (exitcode <= 40))
91 return "Dqq permanent problem (#5.3.0)";
92 return "Zqq temporary problem (#4.3.0)";
93 --- qmail.h.orig 2008-08-21 22:22:59.040684449 +0400
94 +++ qmail.h 2008-08-21 22:33:50.590203369 +0400