| author | Tomas Zeman <tzeman@volny.cz> |
| Sun, 08 Jul 2012 12:20:20 +0200 | |
| changeset 4 | 454df9357b4b |
| parent 1 | b375914441b2 |
| permissions | -rw-r--r-- |
|
1
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
1 |
From: Bruce Guenter <bguenter-djb-qmail@qcc.sk.ca> |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
2 |
To: qmail@list.cr.yp.to |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
3 |
Subject: QMAILQUEUE patch for qmail-1.03 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
4 |
Date: Mon, 25 Jan 1999 15:37:21 -0600 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
5 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
6 |
Greetings. |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
7 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
8 |
Appended is a patch to qmail-1.03 that causes any program that would run |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
9 |
qmail-queue to look for an environment variable QMAILQUEUE. If it is |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
10 |
present, it is used in place of the string "bin/qmail-queue" when |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
11 |
running qmail-queue. This could be used, for example, to add a program |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
12 |
into the qmail-smtpd->qmail-queue pipeline that could do filtering, |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
13 |
rewrite broken headers, etc. (this is my planned usage for it). |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
14 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
15 |
This has undergone virtually no testing, but it looks so simple that it |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
16 |
almost has to be correct. No warranties, etc. Note that the chdir to |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
17 |
/var/qmail is always done before exec'ing the program. |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
18 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
19 |
Does this look like a reasonable thing to do? |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
20 |
-- |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
21 |
Bruce Guenter, QCC Communications Corp. EMail: bruce.guenter@qcc.sk.ca |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
22 |
Phone: (306)249-0220 WWW: http://www.qcc.sk.ca/~bguenter/ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
23 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
24 |
diff -u qmail-1.03-orig/Makefile qmail-1.03/Makefile |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
25 |
--- qmail-1.03-orig/Makefile Mon Jun 15 04:53:16 1998 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
26 |
+++ qmail-1.03/Makefile Tue Jan 19 10:52:24 1999 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
27 |
@@ -1483,12 +1483,12 @@ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
28 |
trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
29 |
datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
30 |
lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
31 |
-auto_split.o |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
32 |
+auto_split.o env.a |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
33 |
./load qmail-send qsutil.o control.o constmap.o newfield.o \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
34 |
prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
35 |
qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
36 |
wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
37 |
- substdio.a error.a str.a fs.a auto_qmail.o auto_split.o |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
38 |
+ substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
39 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
40 |
qmail-send.0: \ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
41 |
qmail-send.8 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
42 |
diff -u qmail-1.03-orig/qmail.c qmail-1.03/qmail.c |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
43 |
--- qmail-1.03-orig/qmail.c Mon Jun 15 04:53:16 1998 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
44 |
+++ qmail-1.03/qmail.c Tue Jan 19 09:57:36 1999 |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
45 |
@@ -6,14 +6,25 @@ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
46 |
#include "fd.h" |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
47 |
#include "qmail.h" |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
48 |
#include "auto_qmail.h" |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
49 |
+#include "env.h" |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
50 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
51 |
-static char *binqqargs[2] = { "bin/qmail-queue", 0 } ;
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
52 |
+static char *binqqargs[2] = { 0, 0 } ;
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
53 |
+ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
54 |
+static void setup_qqargs() |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
55 |
+{
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
56 |
+ if(!binqqargs[0]) |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
57 |
+ binqqargs[0] = env_get("QMAILQUEUE");
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
58 |
+ if(!binqqargs[0]) |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
59 |
+ binqqargs[0] = "bin/qmail-queue"; |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
60 |
+} |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
61 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
62 |
int qmail_open(qq) |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
63 |
struct qmail *qq; |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
64 |
{
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
65 |
int pim[2]; |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
66 |
int pie[2]; |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
67 |
+ |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
68 |
+ setup_qqargs(); |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
69 |
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
70 |
if (pipe(pim) == -1) return -1; |
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
71 |
if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
|
|
b375914441b2
mq init; added pristine patches + fix for qregex
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff
changeset
|
72 |