X-Git-Url: https://git.distorted.org.uk/~mdw/fastforward/blobdiff_plain/8d5530c492ec12fb0878d828a372ef5ee2e909f3..HEAD:/qmail.c diff --git a/qmail.c b/qmail.c index 0fe0dfa..4de4a2c 100644 --- a/qmail.c +++ b/qmail.c @@ -1,3 +1,4 @@ +#include #include "substdio.h" #include "readwrite.h" #include "wait.h" @@ -7,7 +8,15 @@ #include "qmail.h" #include "auto_qmail.h" -static char *binqqargs[2] = { "bin/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) struct qmail *qq; @@ -15,6 +24,7 @@ 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; }