[Exim] Re: [Exim-Announce] Exim 3.14 is available

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: michael
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Re: [Exim-Announce] Exim 3.14 is available
> I have *not* updated the main manual (that's why it's 3.14 and not
> 3.20). All the new features are temporarily documented in doc/NewStuff,
> a copy of which can be separately downloaded from


Those who used my maildir patch that speeds up quota calculation for Exim 3.13
should note that 3.14 includes a generic solution. Simply don't bother to
port the patch and use this in your transport:

  maildir_tag           = ,S=$message_size
  quota_size_regex      = S=(\d+)$


Note that message_size is now exact, so quota suddenly becomes a little
tighter (I can already hear users complaining:). Thanks, Philip! I did
not find any support for maildir++ folders, so a new patch is needed.
I appended it below.

Michael
----------------------------------------------------------------------
--- src/transports/appendfile.c.orig    Wed Apr 12 09:44:59 2000
+++ src/transports/appendfile.c    Thu Apr 13 11:16:27 2000
@@ -637,7 +637,7 @@
 */


 static int
-check_dir_size(char *dirname, int *countptr, pcre *regex)
+check_folder_size(char *dirname, int *countptr, pcre *regex)
 {
 DIR *dir;
 int sum = 0;
@@ -693,7 +693,7 @@
   if ((statbuf.st_mode & S_IFREG) != 0)
     sum += statbuf.st_size;
   else if ((statbuf.st_mode & S_IFDIR) != 0)
-    sum += check_dir_size(buffer, &count, regex);
+    sum += check_folder_size(buffer, &count, regex);
   }


closedir(dir);
@@ -703,6 +703,34 @@
return sum;
}

+static int
+check_dir_size(char *dirname, int *countptr, pcre *regex)
+{
+char buf[1024];
+struct stat statbuf;
+
+if (!string_format(buf, sizeof(buf), "%s/maildirfolder", dirname))
+  {
+  log_write(0, LOG_PANIC|LOG_MAIN, "name too long in check_dir_size: "
+    "dir=%s", dirname);
+  return 0;
+  }
+
+if (stat(buf, &statbuf) < 0)
+  return check_folder_size(dirname, countptr, regex);
+else
+  {
+  char *slash;
+  if (!string_format(buf, sizeof(buf), "%s", dirname))
+    {
+    log_write(0, LOG_PANIC|LOG_MAIN, "name too long in check_dir_size: "
+      "dir=%s", dirname);
+    return 0;
+    }
+  if ((slash=strrchr(buf,'/'))!=(char*)0) *slash='\0';
+  return check_folder_size(buf, countptr, regex);
+  }
+}