updated on Tue Jan 17 00:10:10 UTC 2012
[aur-mirror.git] / qmail / qmail-1.03-quotas-1.1.patch
blob951baea9fd3615e36ed4f0d1b6f48aaf60aa707e
1 diff -u --new-file qmail-1.03.orig/error.c qmail-1.03/error.c
2 --- qmail-1.03.orig/error.c 2005-07-05 15:32:08.513797925 -0300
3 +++ qmail-1.03/error.c 2005-07-05 15:32:24.219929372 -0300
4 @@ -93,3 +93,10 @@
5 #else
6 -13;
7 #endif
9 +int error_dquot =
10 +#ifdef EDQUOT
11 +EDQUOT;
12 +#else
13 +-14;
14 +#endif
15 diff -u --new-file qmail-1.03.orig/error.h qmail-1.03/error.h
16 --- qmail-1.03.orig/error.h 2005-07-05 15:32:08.622771084 -0300
17 +++ qmail-1.03/error.h 2005-07-05 15:32:24.220929126 -0300
18 @@ -18,6 +18,7 @@
19 extern int error_pipe;
20 extern int error_perm;
21 extern int error_acces;
22 +extern int error_dquot;
24 extern char *error_str();
25 extern int error_temp();
26 diff -u --new-file qmail-1.03.orig/qmail-local.c qmail-1.03/qmail-local.c
27 --- qmail-1.03.orig/qmail-local.c 2005-07-05 15:32:08.594777979 -0300
28 +++ qmail-1.03/qmail-local.c 2005-07-05 15:32:27.520116508 -0300
29 @@ -41,6 +41,9 @@
30 void temp_qmail(fn) char *fn;
31 { strerr_die5x(111,"Unable to open ",fn,": ",error_str(errno),". (#4.3.0)"); }
33 +char *overquota =
34 + "Recipient's mailbox is full, message returned to sender. (#5.2.2)";
36 int flagdoit;
37 int flag99;
39 @@ -110,7 +113,12 @@
41 alarm(86400);
42 fd = open_excl(fntmptph);
43 - if (fd == -1) _exit(1);
44 + if (fd == -1) {
45 + if (errno == error_dquot)
46 + _exit(5);
47 + else
48 + _exit(1);
49 + }
51 substdio_fdbuf(&ss,read,0,buf,sizeof(buf));
52 substdio_fdbuf(&ssout,write,fd,outbuf,sizeof(outbuf));
53 @@ -131,7 +139,12 @@
54 /* if it was error_exist, almost certainly successful; i hate NFS */
55 tryunlinktmp(); _exit(0);
57 - fail: tryunlinktmp(); _exit(1);
58 + fail:
59 + if (errno == error_dquot) {
60 + tryunlinktmp(); _exit(5);
61 + } else {
62 + tryunlinktmp(); _exit(1);
63 + }
66 /* end child process */
67 @@ -162,6 +175,7 @@
68 case 2: strerr_die1x(111,"Unable to chdir to maildir. (#4.2.1)");
69 case 3: strerr_die1x(111,"Timeout on maildir delivery. (#4.3.0)");
70 case 4: strerr_die1x(111,"Unable to read message. (#4.3.0)");
71 + case 5: strerr_die1x(100,overquota);
72 default: strerr_die1x(111,"Temporary error on maildir delivery. (#4.3.0)");
75 @@ -221,7 +235,12 @@
76 return;
78 writeerrs:
79 - strerr_warn5("Unable to write ",fn,": ",error_str(errno),". (#4.3.0)",0);
80 + if (errno == error_dquot) {
81 + if (flaglocked) seek_trunc(fd,pos);
82 + close(fd);
83 + strerr_die1x(100,overquota);
84 + } else
85 + strerr_warn5("Unable to write ",fn,": ",error_str(errno),". (#4.3.0)",0);
86 if (flaglocked) seek_trunc(fd,pos);
87 close(fd);
88 _exit(111);
89 Common subdirectories: qmail-1.03.orig/qmail-rhinit and qmail-1.03/qmail-rhinit