* updated knights (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / mail / qmail / hotfixes.patch
blob7c58045b3de97f8261381fe31dd0c24c71a8173b
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../qmail/hotfixes.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
16 --- qmail-1.03/Makefile Mon Jun 15 06:53:16 1998
17 +++ netqmail-1.05/Makefile Wed Jan 21 12:58:12 2004
18 @@ -263,7 +263,7 @@
19 cdbmake_add.o
21 cdbmake_add.o: \
22 -compile cdbmake_add.c cdbmake.h uint32.h
23 +compile cdbmake_add.c cdbmake.h alloc.h uint32.h
24 ./compile cdbmake_add.c
26 cdbmake_hash.o: \
27 @@ -1892,7 +1892,7 @@
29 spawn.o: \
30 compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \
31 -stralloc.h gen_alloc.h select.h exit.h coe.h open.h error.h \
32 +stralloc.h gen_alloc.h select.h exit.h alloc.h coe.h open.h error.h \
33 auto_qmail.h auto_uids.h auto_spawn.h
34 ./chkspawn
35 ./compile spawn.c
36 --- qmail-1.03/cdbmake_add.c Mon Jun 15 06:53:16 1998
37 +++ netqmail-1.05/cdbmake_add.c Wed Jan 21 12:58:12 2004
38 @@ -1,3 +1,4 @@
39 +#include "alloc.h"
40 #include "cdbmake.h"
42 void cdbmake_init(cdbm)
43 --- qmail-1.03/qmail-local.c Mon Jun 15 06:53:16 1998
44 +++ netqmail-1.05/qmail-local.c Wed Jan 21 12:58:12 2004
45 @@ -645,7 +645,7 @@
47 cmds.s[j] = 0;
48 k = j;
49 - while ((k > i) && (cmds.s[k - 1] == ' ') || (cmds.s[k - 1] == '\t'))
50 + while ((k > i) && ((cmds.s[k - 1] == ' ') || (cmds.s[k - 1] == '\t')))
51 cmds.s[--k] = 0;
52 switch(cmds.s[i])
54 --- qmail-1.03/qmail-pop3d.c Mon Jun 15 06:53:16 1998
55 +++ netqmail-1.05/qmail-pop3d.c Wed Jan 21 12:58:12 2004
56 @@ -66,14 +66,14 @@
57 void die_scan() { err("unable to scan $HOME/Maildir"); die(); }
59 void err_syntax() { err("syntax error"); }
60 -void err_unimpl() { err("unimplemented"); }
61 +void err_unimpl(arg) char *arg; { err("unimplemented"); }
62 void err_deleted() { err("already deleted"); }
63 void err_nozero() { err("messages are counted from 1"); }
64 void err_toobig() { err("not that many messages"); }
65 void err_nosuch() { err("unable to open that message"); }
66 void err_nounlink() { err("unable to unlink all deleted messages"); }
68 -void okay() { puts("+OK \r\n"); flush(); }
69 +void okay(arg) char *arg; { puts("+OK \r\n"); flush(); }
71 void printfn(fn) char *fn;
73 @@ -146,7 +146,7 @@
77 -void pop3_stat()
78 +void pop3_stat(arg) char *arg;
80 int i;
81 unsigned long total;
82 @@ -161,15 +161,15 @@
83 flush();
86 -void pop3_rset()
87 +void pop3_rset(arg) char *arg;
89 int i;
90 for (i = 0;i < numm;++i) m[i].flagdeleted = 0;
91 last = 0;
92 - okay();
93 + okay(0);
96 -void pop3_last()
97 +void pop3_last(arg) char *arg;
99 puts("+OK ");
100 put(strnum,fmt_uint(strnum,last));
101 @@ -177,7 +177,7 @@
102 flush();
105 -void pop3_quit()
106 +void pop3_quit(arg) char *arg;
108 int i;
109 for (i = 0;i < numm;++i)
110 @@ -192,7 +192,7 @@
111 if (!stralloc_0(&line)) die_nomem();
112 rename(m[i].fn,line.s); /* if it fails, bummer */
114 - okay();
115 + okay(0);
116 die();
119 @@ -214,7 +214,7 @@
120 if (i == -1) return;
121 m[i].flagdeleted = 1;
122 if (i + 1 > last) last = i + 1;
123 - okay();
124 + okay(0);
127 void list(i,flaguidl)
128 @@ -238,7 +238,7 @@
129 list(i,flaguidl);
131 else {
132 - okay();
133 + okay(0);
134 for (i = 0;i < numm;++i)
135 if (!m[i].flagdeleted)
136 list(i,flaguidl);
137 @@ -267,7 +267,7 @@
139 fd = open_read(m[i].fn);
140 if (fd == -1) { err_nosuch(); return; }
141 - okay();
142 + okay(0);
143 substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf));
144 blast(&ssmsg,limit);
145 close(fd);
146 @@ -299,7 +299,7 @@
148 getlist();
150 - okay();
151 + okay(0);
152 commands(&ssin,pop3commands);
153 die();
155 --- qmail-1.03/qmail-popup.c Mon Jun 15 06:53:16 1998
156 +++ netqmail-1.05/qmail-popup.c Wed Jan 21 12:58:12 2004
157 @@ -64,10 +64,10 @@
159 void err_syntax() { err("syntax error"); }
160 void err_wantuser() { err("USER first"); }
161 -void err_authoriz() { err("authorization first"); }
162 +void err_authoriz(arg) char *arg; { err("authorization first"); }
164 -void okay() { puts("+OK \r\n"); flush(); }
165 -void pop3_quit() { okay(); die(); }
166 +void okay(arg) char *arg; { puts("+OK \r\n"); flush(); }
167 +void pop3_quit(arg) char *arg; { okay(0); die(); }
170 char unique[FMT_ULONG + FMT_ULONG + 3];
171 @@ -136,7 +136,7 @@
172 void pop3_user(arg) char *arg;
174 if (!*arg) { err_syntax(); return; }
175 - okay();
176 + okay(0);
177 seenuser = 1;
178 if (!stralloc_copys(&username,arg)) die_nomem();
179 if (!stralloc_0(&username)) die_nomem();
180 --- qmail-1.03/qmail-smtpd.c Mon Jun 15 06:53:16 1998
181 +++ netqmail-1.05/qmail-smtpd.c Wed Jan 21 12:58:12 2004
182 @@ -51,12 +51,12 @@
184 void err_bmf() { out("553 sorry, your envelope sender is in my badmailfrom list (#5.7.1)\r\n"); }
185 void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
186 -void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
187 +void err_unimpl(arg) char *arg; { out("502 unimplemented (#5.5.1)\r\n"); }
188 void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
189 void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
190 void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
191 -void err_noop() { out("250 ok\r\n"); }
192 -void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); }
193 +void err_noop(arg) char *arg; { out("250 ok\r\n"); }
194 +void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); }
195 void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); }
198 @@ -67,11 +67,11 @@
199 substdio_puts(&ssout,code);
200 substdio_put(&ssout,greeting.s,greeting.len);
202 -void smtp_help()
203 +void smtp_help(arg) char *arg;
205 out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n");
207 -void smtp_quit()
208 +void smtp_quit(arg) char *arg;
210 smtp_greet("221 "); out("\r\n"); flush(); _exit(0);
212 @@ -232,7 +232,7 @@
213 smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
214 seenmail = 0; dohelo(arg);
216 -void smtp_rset()
217 +void smtp_rset(arg) char *arg;
219 seenmail = 0;
220 out("250 flushed\r\n");
221 @@ -316,8 +316,8 @@
222 if (flagmaybex) if (pos == 7) ++*hops;
223 if (pos < 2) if (ch != "\r\n"[pos]) flagmaybey = 0;
224 if (flagmaybey) if (pos == 1) flaginheader = 0;
225 + ++pos;
227 - ++pos;
228 if (ch == '\n') { pos = 0; flagmaybex = flagmaybey = flagmaybez = 1; }
230 switch(state) {
231 @@ -365,7 +365,7 @@
232 out("\r\n");
235 -void smtp_data() {
236 +void smtp_data(arg) char *arg; {
237 int hops;
238 unsigned long qp;
239 char *qqx;
240 --- qmail-1.03/spawn.c Mon Jun 15 06:53:16 1998
241 +++ netqmail-1.05/spawn.c Wed Jan 21 12:58:12 2004
242 @@ -5,6 +5,7 @@
243 #include "substdio.h"
244 #include "byte.h"
245 #include "str.h"
246 +#include "alloc.h"
247 #include "stralloc.h"
248 #include "select.h"
249 #include "exit.h"