summaryrefslogtreecommitdiffstats
path: root/qmail-send.c
diff options
context:
space:
mode:
Diffstat (limited to 'qmail-send.c')
-rw-r--r--qmail-send.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/qmail-send.c b/qmail-send.c
index ef8fe30..4bec118 100644
--- a/qmail-send.c
+++ b/qmail-send.c
@@ -44,6 +44,8 @@
44 44
45int lifetime = 604800; 45int lifetime = 604800;
46 46
47int bouncemaxbytes = 50000;
48
47stralloc percenthack = {0}; 49stralloc percenthack = {0};
48struct constmap mappercenthack; 50struct constmap mappercenthack;
49stralloc locals = {0}; 51stralloc locals = {0};
@@ -742,9 +744,17 @@ I tried to deliver a bounce message to this address, but the bounce bounced!\n\
742 qmail_fail(&qqt); 744 qmail_fail(&qqt);
743 else 745 else
744 { 746 {
747 int bytestogo = bouncemaxbytes;
748 int bytestoget = (bytestogo < sizeof buf) ? bytestogo : sizeof buf;
745 substdio_fdbuf(&ssread,read,fd,inbuf,sizeof(inbuf)); 749 substdio_fdbuf(&ssread,read,fd,inbuf,sizeof(inbuf));
746 while ((r = substdio_get(&ssread,buf,sizeof(buf))) > 0) 750 while (bytestoget > 0 && (r = substdio_get(&ssread,buf,bytestoget)) > 0) {
747 qmail_put(&qqt,buf,r); 751 qmail_put(&qqt,buf,r);
752 bytestogo -= bytestoget;
753 bytestoget = (bytestogo < sizeof buf) ? bytestogo : sizeof buf;
754 }
755 if (r > 0) {
756 qmail_puts(&qqt,"\n\n--- End of message stripped.\n");
757 }
748 close(fd); 758 close(fd);
749 if (r == -1) 759 if (r == -1)
750 qmail_fail(&qqt); 760 qmail_fail(&qqt);
@@ -1439,6 +1449,7 @@ fd_set *rfds;
1439/* this file is too long ---------------------------------------------- MAIN */ 1449/* this file is too long ---------------------------------------------- MAIN */
1440 1450
1441int getcontrols() { if (control_init() == -1) return 0; 1451int getcontrols() { if (control_init() == -1) return 0;
1452 if (control_readint(&bouncemaxbytes,"control/bouncemaxbytes") == -1) return 0;
1442 if (control_readint(&lifetime,"control/queuelifetime") == -1) return 0; 1453 if (control_readint(&lifetime,"control/queuelifetime") == -1) return 0;
1443 if (control_readint(&concurrency[0],"control/concurrencylocal") == -1) return 0; 1454 if (control_readint(&concurrency[0],"control/concurrencylocal") == -1) return 0;
1444 if (control_readint(&concurrency[1],"control/concurrencyremote") == -1) return 0; 1455 if (control_readint(&concurrency[1],"control/concurrencyremote") == -1) return 0;