1 # HG changeset patch |
1 # HG changeset patch |
2 # Parent 4b02e3191467ca0f3dbad9fd5ed1a8e5e61d3f0a |
2 # Parent 124a35dbf1399ba64efa3391306e18d9971d3d8b |
3 |
3 |
4 diff -r 4b02e3191467 doc/spec.txt |
4 diff -r 124a35dbf139 doc/spec.txt |
5 --- a/doc/spec.txt Fri Apr 01 16:36:30 2011 +0200 |
5 --- a/doc/spec.txt Wed Apr 13 12:08:14 2011 +0200 |
6 +++ b/doc/spec.txt Thu Apr 07 15:38:24 2011 +0200 |
6 +++ b/doc/spec.txt Wed Apr 13 12:08:31 2011 +0200 |
7 @@ -18340,6 +18340,9 @@ |
7 @@ -18340,6 +18340,9 @@ |
8 large file support (Linux and FreeBSD have this), mailboxes larger than 2G can |
8 large file support (Linux and FreeBSD have this), mailboxes larger than 2G can |
9 be handled. |
9 be handled. |
10 |
10 |
11 +If there is "/no_check" appended, then quota updating is done as usual, but the |
11 +If there is "/no_check" appended, then quota updating is done as usual, but the |
22 +over quota condition does not prevent the delivery. |
22 +over quota condition does not prevent the delivery. |
23 + |
23 + |
24 +--------------------------------------------------------------+ |
24 +--------------------------------------------------------------+ |
25 |quota_is_inclusive|Use: appendfile|Type: boolean|Default: true| |
25 |quota_is_inclusive|Use: appendfile|Type: boolean|Default: true| |
26 +--------------------------------------------------------------+ |
26 +--------------------------------------------------------------+ |
27 diff -r 4b02e3191467 src/transports/appendfile.c |
27 diff -r 124a35dbf139 src/transports/appendfile.c |
28 --- a/src/transports/appendfile.c Fri Apr 01 16:36:30 2011 +0200 |
28 --- a/src/transports/appendfile.c Wed Apr 13 12:08:14 2011 +0200 |
29 +++ b/src/transports/appendfile.c Thu Apr 07 15:38:24 2011 +0200 |
29 +++ b/src/transports/appendfile.c Wed Apr 13 12:08:31 2011 +0200 |
30 @@ -237,7 +237,9 @@ |
30 @@ -236,7 +236,9 @@ |
31 FALSE, /* mailstore_format */ |
31 FALSE, /* mailstore_format */ |
32 FALSE, /* mbx_format */ |
32 FALSE, /* mbx_format */ |
33 FALSE, /* quota_warn_threshold_is_percent */ |
33 FALSE, /* quota_warn_threshold_is_percent */ |
34 - TRUE /* quota_is_inclusive */ |
34 - TRUE /* quota_is_inclusive */ |
35 + TRUE, /* quota_is_inclusive */ |
35 + TRUE, /* quota_is_inclusive */ |
36 + FALSE, /* quota_no_check */ |
36 + FALSE, /* quota_no_check */ |
37 + FALSE /* quota_filecount_no_check */ |
37 + FALSE /* quota_filecount_no_check */ |
38 }; |
38 }; |
39 |
39 |
40 void hs12_lock(int fd, int type, const char* msg) |
40 |
41 @@ -312,6 +314,7 @@ |
41 @@ -287,6 +289,7 @@ |
42 for (i = 0; i < 5; i++) |
42 for (i = 0; i < 5; i++) |
43 { |
43 { |
44 double d; |
44 double d; |
45 + int no_check = 0; |
45 + int no_check = 0; |
46 uschar *which = NULL; |
46 uschar *which = NULL; |
47 |
47 |
48 if (q == NULL) d = default_value; else |
48 if (q == NULL) d = default_value; else |
49 @@ -348,12 +351,21 @@ |
49 @@ -323,12 +326,21 @@ |
50 rest++; |
50 rest++; |
51 } |
51 } |
52 |
52 |
53 + |
53 + |
54 + /* For quota and quota_filecount there may be options |
54 + /* For quota and quota_filecount there may be options |
67 - "in %s transport", s, q, tblock->name); |
67 - "in %s transport", s, q, tblock->name); |
68 + "in %s transport [%s]", s, q, tblock->name); |
68 + "in %s transport [%s]", s, q, tblock->name); |
69 return FAIL; |
69 return FAIL; |
70 } |
70 } |
71 } |
71 } |
72 @@ -365,12 +377,14 @@ |
72 @@ -340,12 +352,14 @@ |
73 case 0: |
73 case 0: |
74 if (d >= 2.0*1024.0*1024.0*1024.0 && sizeof(off_t) <= 4) which = US"quota"; |
74 if (d >= 2.0*1024.0*1024.0*1024.0 && sizeof(off_t) <= 4) which = US"quota"; |
75 ob->quota_value = (off_t)d; |
75 ob->quota_value = (off_t)d; |
76 + ob->quota_no_check = no_check; |
76 + ob->quota_no_check = no_check; |
77 q = ob->quota_filecount; |
77 q = ob->quota_filecount; |
82 ob->quota_filecount_value = (int)d; |
82 ob->quota_filecount_value = (int)d; |
83 + ob->quota_filecount_no_check = no_check; |
83 + ob->quota_filecount_no_check = no_check; |
84 q = ob->quota_warn_threshold; |
84 q = ob->quota_warn_threshold; |
85 break; |
85 break; |
86 |
86 |
87 @@ -1406,10 +1420,12 @@ |
87 @@ -1382,10 +1396,12 @@ |
88 DEBUG(D_transport) |
88 DEBUG(D_transport) |
89 { |
89 { |
90 debug_printf("appendfile: mode=%o notify_comsat=%d quota=" OFF_T_FMT |
90 debug_printf("appendfile: mode=%o notify_comsat=%d quota=" OFF_T_FMT |
91 + "%s" |
91 + "%s" |
92 " warning=" OFF_T_FMT "%s\n" |
92 " warning=" OFF_T_FMT "%s\n" |
95 mode, ob->notify_comsat, ob->quota_value, |
95 mode, ob->notify_comsat, ob->quota_value, |
96 + ob->quota_no_check? " (no_check)" : "", |
96 + ob->quota_no_check? " (no_check)" : "", |
97 ob->quota_warn_threshold_value, |
97 ob->quota_warn_threshold_value, |
98 ob->quota_warn_threshold_is_percent? "%" : "", |
98 ob->quota_warn_threshold_is_percent? "%" : "", |
99 isdirectory? "directory" : "file", |
99 isdirectory? "directory" : "file", |
100 @@ -2773,18 +2789,31 @@ |
100 @@ -2748,18 +2764,31 @@ |
101 } |
101 } |
102 if (mailbox_size + (ob->quota_is_inclusive? message_size:0) > ob->quota_value) |
102 if (mailbox_size + (ob->quota_is_inclusive? message_size:0) > ob->quota_value) |
103 { |
103 { |
104 - DEBUG(D_transport) debug_printf("mailbox quota exceeded\n"); |
104 - DEBUG(D_transport) debug_printf("mailbox quota exceeded\n"); |
105 - yield = DEFER; |
105 - yield = DEFER; |
137 + filecount_msg = US" filecount"; |
137 + filecount_msg = US" filecount"; |
138 + } |
138 + } |
139 } |
139 } |
140 } |
140 } |
141 |
141 |
142 diff -r 4b02e3191467 src/transports/appendfile.h |
142 diff -r 124a35dbf139 src/transports/appendfile.h |
143 --- a/src/transports/appendfile.h Fri Apr 01 16:36:30 2011 +0200 |
143 --- a/src/transports/appendfile.h Wed Apr 13 12:08:14 2011 +0200 |
144 +++ b/src/transports/appendfile.h Thu Apr 07 15:38:24 2011 +0200 |
144 +++ b/src/transports/appendfile.h Wed Apr 13 12:08:31 2011 +0200 |
145 @@ -72,6 +72,8 @@ |
145 @@ -72,6 +72,8 @@ |
146 BOOL mbx_format; |
146 BOOL mbx_format; |
147 BOOL quota_warn_threshold_is_percent; |
147 BOOL quota_warn_threshold_is_percent; |
148 BOOL quota_is_inclusive; |
148 BOOL quota_is_inclusive; |
149 + BOOL quota_no_check; |
149 + BOOL quota_no_check; |