From fd24fd2c901418730f41fbacc47749204ef7bab4 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 1 Oct 2003 01:28:03 +0100 Subject: [PATCH] qmail: Indirect via QMAILQUEUE environment variable to find qmail-queue. This lets us insert a filter program, say a spam checker, between qmail-smtpd and the mail queue, with the right to refuse a message before it's accepted by the SMTP server. --- Makefile | 4 ++-- debian/changelog | 1 + qmail.c | 13 ++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9230887..6bf4a6c 100644 --- a/Makefile +++ b/Makefile @@ -1483,12 +1483,12 @@ load qmail-send.o qsutil.o control.o constmap.o newfield.o prioq.o \ trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \ datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \ lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \ -auto_split.o +auto_split.o env.a ./load qmail-send qsutil.o control.o constmap.o newfield.o \ prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \ qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \ wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \ - substdio.a error.a str.a fs.a auto_qmail.o auto_split.o + substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a qmail-send.0: \ qmail-send.8 diff --git a/debian/changelog b/debian/changelog index 721be9b..91b7e0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ qmail (1.03-4) non-free; urgency=low * twiddle build system for missed Debians. + * indirect qmail-queue via QMAILQUEUE environment variable -- Mark Wooding Wed, 1 Oct 2003 01:16:00 +0100 diff --git a/qmail.c b/qmail.c index 4b7f3ef..9432b4b 100644 --- a/qmail.c +++ b/qmail.c @@ -6,8 +6,17 @@ #include "fd.h" #include "qmail.h" #include "auto_qmail.h" +#include "env.h" -static char *binqqargs[2] = { "/usr/sbin/qmail-queue", 0 } ; +static char *binqqargs[2] = { 0, 0 } ; + +static void setup_qqargs() +{ + if(!binqqargs[0]) + binqqargs[0] = env_get("QMAILQUEUE"); + if(!binqqargs[0]) + binqqargs[0] = "/usr/sbin/qmail-queue"; +} int qmail_open(qq) struct qmail *qq; @@ -15,6 +24,8 @@ struct qmail *qq; int pim[2]; int pie[2]; + setup_qqargs(); + if (pipe(pim) == -1) return -1; if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; } -- 2.11.0