Ari Arantes Filho wrote:
> Is it possible the put just the header of the message or just a few lines?

  Yes, here is a patch that does the job. It defaults to bounce 50k of
text max, but you can change that limit in a control/bouncemaxbytes
file.

  Best regards,
             -Jedi.
-- 
         Frank DENIS aka Jedi/Sector One aka DJ Chrysalis <[EMAIL PROTECTED]>
                -> Software : http://www.jedi.claranet.fr <-
                 -> Music : http://www.mp3.com/chrysalis <-
diff -u ../qmail-1.03/qmail-send.c ./qmail-send.c
--- ../qmail-1.03/qmail-send.c  Mon Jun 15 12:53:16 1998
+++ ./qmail-send.c      Wed Jun 24 20:06:29 1998
@@ -44,6 +44,8 @@
 
 int lifetime = 604800;
 
+int bouncemaxbytes = 50000;
+
 stralloc percenthack = {0};
 struct constmap mappercenthack;
 stralloc locals = {0};
@@ -740,9 +742,17 @@
      qmail_fail(&qqt);
    else
     {
+     int bytestogo = bouncemaxbytes;
+     int bytestoget = (bytestogo < sizeof buf) ? bytestogo : sizeof buf;
      substdio_fdbuf(&ssread,read,fd,inbuf,sizeof(inbuf));
-     while ((r = substdio_get(&ssread,buf,sizeof(buf))) > 0)
+     while (bytestoget > 0 && (r = substdio_get(&ssread,buf,bytestoget)) > 0) {
        qmail_put(&qqt,buf,r);
+       bytestogo -= bytestoget;
+       bytestoget = (bytestogo < sizeof buf) ? bytestogo : sizeof buf;
+     }
+     if (r > 0) {
+       qmail_puts(&qqt,"\n\n--- End of message stripped.\n");
+     }
      close(fd);
      if (r == -1)
        qmail_fail(&qqt);
@@ -1442,6 +1452,7 @@
 /* this file is too long ---------------------------------------------- MAIN */
 
 int getcontrols() { if (control_init() == -1) return 0;
+ if (control_readint(&bouncemaxbytes,"control/bouncemaxbytes") == -1) return 0;   
  if (control_readint(&lifetime,"control/queuelifetime") == -1) return 0;
  if (control_readint(&concurrency[0],"control/concurrencylocal") == -1) return 0;
  if (control_readint(&concurrency[1],"control/concurrencyremote") == -1) return 0;

Reply via email to