summaryrefslogtreecommitdiffstats
path: root/qmail-send.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 02:42:39 +0100
committermanuel <manuel@mausz.at>2013-02-04 02:42:39 +0100
commitd2b166c433e97c710ec6906493a3bd400d731491 (patch)
treeaf1d09a4c31ddb794715ec57d23ce1d98e92e018 /qmail-send.c
parent881bcbeb395bd6a06e8bcac3d97b2ca3ed3e2f67 (diff)
downloadqmail-d2b166c433e97c710ec6906493a3bd400d731491.tar.gz
qmail-d2b166c433e97c710ec6906493a3bd400d731491.tar.bz2
qmail-d2b166c433e97c710ec6906493a3bd400d731491.zip
[PATCH] Increase limits for large mail systems
big-concurrency
Diffstat (limited to 'qmail-send.c')
-rw-r--r--qmail-send.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/qmail-send.c b/qmail-send.c
index 7e6a8ac..ef8fe30 100644
--- a/qmail-send.c
+++ b/qmail-send.c
@@ -262,6 +262,8 @@ char *recip;
262 while (!stralloc_copys(&comm_buf[c],"")) nomem(); 262 while (!stralloc_copys(&comm_buf[c],"")) nomem();
263 ch = delnum; 263 ch = delnum;
264 while (!stralloc_append(&comm_buf[c],&ch)) nomem(); 264 while (!stralloc_append(&comm_buf[c],&ch)) nomem();
265 ch = delnum >> 8;
266 while (!stralloc_append(&comm_buf[c],&ch)) nomem();
265 fnmake_split(id); 267 fnmake_split(id);
266 while (!stralloc_cats(&comm_buf[c],fn.s)) nomem(); 268 while (!stralloc_cats(&comm_buf[c],fn.s)) nomem();
267 while (!stralloc_0(&comm_buf[c])) nomem(); 269 while (!stralloc_0(&comm_buf[c])) nomem();
@@ -906,41 +908,42 @@ int c;
906 dline[c].len = REPORTMAX; 908 dline[c].len = REPORTMAX;
907 /* qmail-lspawn and qmail-rspawn are responsible for keeping it short */ 909 /* qmail-lspawn and qmail-rspawn are responsible for keeping it short */
908 /* but from a security point of view, we don't trust rspawn */ 910 /* but from a security point of view, we don't trust rspawn */
909 if (!ch && (dline[c].len > 1)) 911 if (!ch && (dline[c].len > 2))
910 { 912 {
911 delnum = (unsigned int) (unsigned char) dline[c].s[0]; 913 delnum = (unsigned int) (unsigned char) dline[c].s[0];
914 delnum += (unsigned int) ((unsigned int) dline[c].s[1]) << 8;
912 if ((delnum < 0) || (delnum >= concurrency[c]) || !d[c][delnum].used) 915 if ((delnum < 0) || (delnum >= concurrency[c]) || !d[c][delnum].used)
913 log1("warning: internal error: delivery report out of range\n"); 916 log1("warning: internal error: delivery report out of range\n");
914 else 917 else
915 { 918 {
916 strnum3[fmt_ulong(strnum3,d[c][delnum].delid)] = 0; 919 strnum3[fmt_ulong(strnum3,d[c][delnum].delid)] = 0;
917 if (dline[c].s[1] == 'Z') 920 if (dline[c].s[2] == 'Z')
918 if (jo[d[c][delnum].j].flagdying) 921 if (jo[d[c][delnum].j].flagdying)
919 { 922 {
920 dline[c].s[1] = 'D'; 923 dline[c].s[2] = 'D';
921 --dline[c].len; 924 --dline[c].len;
922 while (!stralloc_cats(&dline[c],"I'm not going to try again; this message has been in the queue too long.\n")) nomem(); 925 while (!stralloc_cats(&dline[c],"I'm not going to try again; this message has been in the queue too long.\n")) nomem();
923 while (!stralloc_0(&dline[c])) nomem(); 926 while (!stralloc_0(&dline[c])) nomem();
924 } 927 }
925 switch(dline[c].s[1]) 928 switch(dline[c].s[2])
926 { 929 {
927 case 'K': 930 case 'K':
928 log3("delivery ",strnum3,": success: "); 931 log3("delivery ",strnum3,": success: ");
929 logsafe(dline[c].s + 2); 932 logsafe(dline[c].s + 3);
930 log1("\n"); 933 log1("\n");
931 markdone(c,jo[d[c][delnum].j].id,d[c][delnum].mpos); 934 markdone(c,jo[d[c][delnum].j].id,d[c][delnum].mpos);
932 --jo[d[c][delnum].j].numtodo; 935 --jo[d[c][delnum].j].numtodo;
933 break; 936 break;
934 case 'Z': 937 case 'Z':
935 log3("delivery ",strnum3,": deferral: "); 938 log3("delivery ",strnum3,": deferral: ");
936 logsafe(dline[c].s + 2); 939 logsafe(dline[c].s + 3);
937 log1("\n"); 940 log1("\n");
938 break; 941 break;
939 case 'D': 942 case 'D':
940 log3("delivery ",strnum3,": failure: "); 943 log3("delivery ",strnum3,": failure: ");
941 logsafe(dline[c].s + 2); 944 logsafe(dline[c].s + 3);
942 log1("\n"); 945 log1("\n");
943 addbounce(jo[d[c][delnum].j].id,d[c][delnum].recip.s,dline[c].s + 2); 946 addbounce(jo[d[c][delnum].j].id,d[c][delnum].recip.s,dline[c].s + 3);
944 markdone(c,jo[d[c][delnum].j].id,d[c][delnum].mpos); 947 markdone(c,jo[d[c][delnum].j].id,d[c][delnum].mpos);
945 --jo[d[c][delnum].j].numtodo; 948 --jo[d[c][delnum].j].numtodo;
946 break; 949 break;
@@ -1538,7 +1541,7 @@ void main()
1538 numjobs = 0; 1541 numjobs = 0;
1539 for (c = 0;c < CHANNELS;++c) 1542 for (c = 0;c < CHANNELS;++c)
1540 { 1543 {
1541 char ch; 1544 char ch, ch1;
1542 int u; 1545 int u;
1543 int r; 1546 int r;
1544 do 1547 do
@@ -1546,7 +1549,13 @@ void main()
1546 while ((r == -1) && (errno == error_intr)); 1549 while ((r == -1) && (errno == error_intr));
1547 if (r < 1) 1550 if (r < 1)
1548 { log1("alert: cannot start: hath the daemon spawn no fire?\n"); _exit(111); } 1551 { log1("alert: cannot start: hath the daemon spawn no fire?\n"); _exit(111); }
1552 do
1553 r = read(chanfdin[c],&ch1,1);
1554 while ((r == -1) && (errno == error_intr));
1555 if (r < 1)
1556 { log1("alert: cannot start: hath the daemon spawn no fire?\n"); _exit(111); }
1549 u = (unsigned int) (unsigned char) ch; 1557 u = (unsigned int) (unsigned char) ch;
1558 u += (unsigned int) ((unsigned char) ch1) << 8;
1550 if (concurrency[c] > u) concurrency[c] = u; 1559 if (concurrency[c] > u) concurrency[c] = u;
1551 numjobs += concurrency[c]; 1560 numjobs += concurrency[c];
1552 } 1561 }