diff options
Diffstat (limited to 'qmail-local.c')
| -rw-r--r-- | qmail-local.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/qmail-local.c b/qmail-local.c index 6fec288..1bafb34 100644 --- a/qmail-local.c +++ b/qmail-local.c | |||
| @@ -66,6 +66,7 @@ stralloc foo = {0}; | |||
| 66 | 66 | ||
| 67 | char buf[1024]; | 67 | char buf[1024]; |
| 68 | char outbuf[1024]; | 68 | char outbuf[1024]; |
| 69 | #define QUOTABUFSIZE 256 | ||
| 69 | 70 | ||
| 70 | /* child process */ | 71 | /* child process */ |
| 71 | 72 | ||
| @@ -86,9 +87,15 @@ char *dir; | |||
| 86 | int fd; | 87 | int fd; |
| 87 | substdio ss; | 88 | substdio ss; |
| 88 | substdio ssout; | 89 | substdio ssout; |
| 90 | char quotabuf[QUOTABUFSIZE]; | ||
| 89 | 91 | ||
| 90 | sig_alarmcatch(sigalrm); | 92 | sig_alarmcatch(sigalrm); |
| 91 | if (chdir(dir) == -1) { if (error_temp(errno)) _exit(1); _exit(2); } | 93 | if (chdir(dir) == -1) { if (error_temp(errno)) _exit(1); _exit(2); } |
| 94 | if (maildir_getquota(dir, quotabuf) == 0) { | ||
| 95 | if (user_over_maildirquota(dir,quotabuf)==1) { | ||
| 96 | _exit(1); | ||
| 97 | } | ||
| 98 | } | ||
| 92 | pid = getpid(); | 99 | pid = getpid(); |
| 93 | host[0] = 0; | 100 | host[0] = 0; |
| 94 | gethostname(host,sizeof(host)); | 101 | gethostname(host,sizeof(host)); |
| @@ -99,7 +106,10 @@ char *dir; | |||
| 99 | s += fmt_str(s,"tmp/"); | 106 | s += fmt_str(s,"tmp/"); |
| 100 | s += fmt_ulong(s,time); *s++ = '.'; | 107 | s += fmt_ulong(s,time); *s++ = '.'; |
| 101 | s += fmt_ulong(s,pid); *s++ = '.'; | 108 | s += fmt_ulong(s,pid); *s++ = '.'; |
| 102 | s += fmt_strn(s,host,sizeof(host)); *s++ = 0; | 109 | s += fmt_strn(s,host,sizeof(host)); |
| 110 | s += fmt_strn(s,",S=",sizeof(",S=")); | ||
| 111 | if (fstat(0,&st) == -1) if (errno == error_noent) break; | ||
| 112 | s += fmt_ulong(s,st.st_size); *s++ = 0; | ||
| 103 | if (stat(fntmptph,&st) == -1) if (errno == error_noent) break; | 113 | if (stat(fntmptph,&st) == -1) if (errno == error_noent) break; |
| 104 | /* really should never get to this point */ | 114 | /* really should never get to this point */ |
| 105 | if (loop == 2) _exit(1); | 115 | if (loop == 2) _exit(1); |
| @@ -159,6 +169,7 @@ char *fn; | |||
| 159 | switch(wait_exitcode(wstat)) | 169 | switch(wait_exitcode(wstat)) |
| 160 | { | 170 | { |
| 161 | case 0: break; | 171 | case 0: break; |
| 172 | case 1: strerr_die1x(1, "User over quota. (#5.1.1)"); | ||
| 162 | case 2: strerr_die1x(111,"Unable to chdir to maildir. (#4.2.1)"); | 173 | case 2: strerr_die1x(111,"Unable to chdir to maildir. (#4.2.1)"); |
| 163 | case 3: strerr_die1x(111,"Timeout on maildir delivery. (#4.3.0)"); | 174 | case 3: strerr_die1x(111,"Timeout on maildir delivery. (#4.3.0)"); |
| 164 | case 4: strerr_die1x(111,"Unable to read message. (#4.3.0)"); | 175 | case 4: strerr_die1x(111,"Unable to read message. (#4.3.0)"); |
