1. Preserve underlying transport filter timeout message if a pipe
[exim.git] / src / src / transports / appendfile.c
index f7cb912ae11d267068fbaef46a5f17797a6e4b21..43575d15ba7a74323099e5f94947f060a8c45d21 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.1 2004/10/07 13:10:02 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.6 2005/04/27 10:06:00 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -286,12 +286,13 @@ for (i = 0; i < 5; i++)
 
     d = Ustrtod(s, &rest);
 
-    /* Handle following characters K, M, %, the latter being permitted
+    /* Handle following characters K, M, G, %, the latter being permitted
     for quota_warn_threshold only. A threshold with no quota setting is
     just ignored. */
 
     if (tolower(*rest) == 'k') { d *= 1024.0; rest++; }
     else if (tolower(*rest) == 'm') { d *= 1024.0*1024.0; rest++; }
+    else if (tolower(*rest) == 'g') { d *= 1024.0*1024.0*1024.0; rest++; }
     else if (*rest == '%' && i == 2)
       {
       if (ob->quota_value <= 0 && !ob->maildir_use_size_file) d = 0;
@@ -2294,7 +2295,8 @@ else
   if ((mailbox_size < 0 || mailbox_filecount < 0) &&
       (ob->quota_value > 0 || THRESHOLD_CHECK))
     {
-    int size, filecount;
+    int size;
+    int filecount = 0;
     DEBUG(D_transport)
       debug_printf("quota checks on directory %s\n", check_path);
     size = check_dir_size(check_path, &filecount, regex);
@@ -2857,8 +2859,12 @@ if (yield != OK)
   from child_close() is in more_errno. */
 
   else if (errno == ERRNO_FILTER_FAIL)
-    addr->message = string_sprintf("filter process failure %d while writing "
-      "to %s", addr->more_errno, dataname);
+    {
+    yield = PANIC;
+    addr->message = string_sprintf("transport filter process failed (%d) "
+      "while writing to %s%s", addr->more_errno, dataname,
+      (addr->more_errno == EX_EXECFAILED)? ": unable to execute command" : "");
+    }
 
   /* Handle failure to expand header changes */