X-Git-Url: https://git.distorted.org.uk/~mdw/ezmlm/blobdiff_plain/f8beb284087c279acfb30506f5bb32baa4949b44..25a55efedbea9031ccca8a8f91a657781198a1c5:/qmail.c diff --git a/qmail.c b/qmail.c index 1ee257b..5c204c0 100644 --- a/qmail.c +++ b/qmail.c @@ -1,3 +1,4 @@ +#include #include "substdio.h" #include "readwrite.h" #include "wait.h" @@ -10,7 +11,15 @@ #include "stralloc.h" #include "idx.h" -static char *binqqargs[2] = { PROG_QMAIL_QUEUE, 0 } ; +static char *binqqargs[2] = { 0, 0 } ; + +static void setup_qqargs() +{ + if(!binqqargs[0]) + binqqargs[0] = getenv("QMAILQUEUE"); + if(!binqqargs[0]) + binqqargs[0] = "/usr/sbin/qmail-queue"; +} int qmail_open(qq,sa) struct qmail *qq; @@ -21,6 +30,8 @@ stralloc *sa; unsigned i,j; char **cpp; + setup_qqargs(); + qq->msgbytes = 0L; if (pipe(pim) == -1) return -1; if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }