This patch is a replacement of QUEUE_EXTRA feature of std qmail.
It allow use of this feature only when it is needed; you need
only to write a new control file 'extraqueue' containing the
extra recipient.

 Tullio Andreatta <tullio@logicom.it>

diff -c Makefile.orig Makefile
*** Makefile.orig	Tue Apr  3 08:51:35 2001
--- Makefile	Tue Apr  3 08:56:04 2001
***************
*** 1421,1431 ****
  qmail-queue: \
  load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o \
  datetime.a seek.a ndelay.a open.a sig.a alloc.a substdio.a error.a \
! str.a fs.a auto_qmail.o auto_split.o auto_uids.o
  	./load qmail-queue triggerpull.o fmtqfn.o now.o \
! 	date822fmt.o datetime.a seek.a ndelay.a open.a sig.a \
! 	alloc.a substdio.a error.a str.a fs.a auto_qmail.o \
! 	auto_split.o auto_uids.o 
  
  qmail-queue.0: \
  qmail-queue.8
--- 1421,1432 ----
  qmail-queue: \
  load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o \
  datetime.a seek.a ndelay.a open.a sig.a alloc.a substdio.a error.a \
! str.a fs.a auto_qmail.o auto_split.o auto_uids.o control.o \
! stralloc.a getln.a
  	./load qmail-queue triggerpull.o fmtqfn.o now.o \
! 	date822fmt.o control.o stralloc.a getln.a datetime.a seek.a \
! 	ndelay.a open.a sig.a alloc.a substdio.a error.a str.a fs.a \
! 	auto_qmail.o auto_split.o auto_uids.o 
  
  qmail-queue.0: \
  qmail-queue.8
diff -c qmail-control.9.orig qmail-control.9
*** qmail-control.9.orig	Tue Apr  3 09:09:19 2001
--- qmail-control.9	Tue Apr  3 09:10:10 2001
***************
*** 51,56 ****
--- 51,57 ----
  .I doublebouncehost	\fIme	\fRqmail-send
  .I doublebounceto	\fRpostmaster	\fRqmail-send
  .I envnoathost	\fIme	\fRqmail-send
+ .I extraqueue	\fR(none)	\fRqmail-queue
  .I helohost	\fIme	\fRqmail-remote
  .I idhost	\fIme	\fRqmail-inject
  .I localiphost	\fIme	\fRqmail-smtpd
***************
*** 72,77 ****
--- 73,79 ----
  .SH "SEE ALSO"
  qmail-inject(8),
  qmail-qmqpc(8),
+ qmail-queue(8),
  qmail-remote(8),
  qmail-send(8),
  qmail-showctl(8),
diff -c qmail-queue.8.orig qmail-queue.8
*** qmail-queue.8.orig	Tue Apr  3 09:07:18 2001
--- qmail-queue.8	Tue Apr  3 09:06:03 2001
***************
*** 24,29 ****
--- 24,33 ----
  sees end-of-file before the extra 0 byte,
  it aborts without placing the message into the queue.
  
+ If the control file
+ .I extraqueue
+ exists, its content is added to recipient list.
+ 
  Every envelope recipient address
  should contain a username,
  an @ sign,
***************
*** 93,100 ****
  .TP
  .B 55
  Unable to read a configuration file.
- (Not used by
- .BR qmail-queue .)
  .TP
  .B 56
  Problem making a network connection from this host.
--- 97,102 ----
***************
*** 148,154 ****
  .SH "SEE ALSO"
  addresses(5),
  envelopes(5),
- qmail-control(5),
  qmail-header(5),
  qmail-inject(8),
  qmail-qmqpc(8),
--- 150,155 ----
diff -c qmail-queue.c.orig qmail-queue.c
*** qmail-queue.c.orig	Tue Apr  3 08:48:06 2001
--- qmail-queue.c	Tue Apr  3 08:48:13 2001
***************
*** 11,21 ****
  #include "datetime.h"
  #include "now.h"
  #include "triggerpull.h"
- #include "extra.h"
  #include "auto_qmail.h"
  #include "auto_uids.h"
  #include "date822fmt.h"
  #include "fmtqfn.h"
  
  #define DEATH 86400 /* 24 hours; _must_ be below q-s's OSSIFIED (36 hours) */
  #define ADDR 1003
--- 11,24 ----
  #include "datetime.h"
  #include "now.h"
  #include "triggerpull.h"
  #include "auto_qmail.h"
  #include "auto_uids.h"
  #include "date822fmt.h"
  #include "fmtqfn.h"
+ #include "stralloc.h"
+ #include "control.h"
+ 
+ stralloc extraqueue = {0};
  
  #define DEATH 86400 /* 24 hours; _must_ be below q-s's OSSIFIED (36 hours) */
  #define ADDR 1003
***************
*** 159,164 ****
--- 162,168 ----
   sig_blocknone();
   umask(033);
   if (chdir(auto_qmail) == -1) die(61);
+  if (control_readline(&extraqueue, "control/extraqueue") == -1) die(55);
   if (chdir("queue") == -1) die(62);
  
   mypid = getpid();
***************
*** 227,233 ****
    }
   if (len >= ADDR) die(11);
  
!  if (substdio_bput(&ssout,QUEUE_EXTRA,QUEUE_EXTRALEN) == -1) die_write();
  
   for (;;)
    {
--- 231,242 ----
    }
   if (len >= ADDR) die(11);
  
!  if (extraqueue.s && extraqueue.len)
!   {
!    if (substdio_bput(&ssout,"T",1) == -1) die_write();
!    if (substdio_bput(&ssout,extraqueue.s,extraqueue.len) == -1) die_write();
!    if (substdio_bput(&ssout,"\0",1) == -1) die_write();
!   }
  
   for (;;)
    {
diff -c qmail-showctl.c.orig qmail-showctl.c
*** qmail-showctl.c.orig	Tue Apr  3 08:51:35 2001
--- qmail-showctl.c	Tue Apr  3 09:03:31 2001
***************
*** 225,230 ****
--- 225,231 ----
    do_str("doublebouncehost",1,"doublebouncehost","2B recipient host: ");
    do_str("doublebounceto",0,"postmaster","2B recipient user: ");
    do_str("envnoathost",1,"envnoathost","Presumed domain name is ");
+   do_lst("extraqueue","No extra recipient.","Extra recipient for queued message: '","'.");
    do_str("helohost",1,"helohost","SMTP client HELO host name is ");
    do_str("idhost",1,"idhost","Message-ID host name is ");
    do_str("localiphost",1,"localiphost","Local IP address becomes ");
***************
*** 278,283 ****
--- 279,285 ----
      if (str_equal(d->d_name,"doublebouncehost")) continue;
      if (str_equal(d->d_name,"doublebounceto")) continue;
      if (str_equal(d->d_name,"envnoathost")) continue;
+     if (str_equal(d->d_name,"extraqueue")) continue;
      if (str_equal(d->d_name,"helohost")) continue;
      if (str_equal(d->d_name,"idhost")) continue;
      if (str_equal(d->d_name,"localiphost")) continue;

