[exim-cvs] Make maildir_use_size_file expandable.

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] Make maildir_use_size_file expandable.
Gitweb: http://git.exim.org/exim.git/commitdiff/555ae6af39312f43b1d38d8da05cf4368b933015
Commit:     555ae6af39312f43b1d38d8da05cf4368b933015
Parent:     7f2a2a43f103bf22970a2b87ad8106f1a57b3d57
Author:     Phil Pennock <pdp@???>
AuthorDate: Sat Aug 27 16:19:48 2011 -0700
Committer:  Phil Pennock <pdp@???>
CommitDate: Sat Aug 27 16:19:48 2011 -0700


    Make maildir_use_size_file expandable.


    Patch from Heiko Schlittermann.
    Fixes bug 1089
---
 doc/doc-docbook/spec.xfpt       |    7 +++++--
 doc/doc-txt/ChangeLog           |    3 +++
 src/src/transports/appendfile.c |   11 ++++++++++-
 src/src/transports/appendfile.h |    1 +
 4 files changed, 19 insertions(+), 3 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index aa4be53..7a3cc8d 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -19955,13 +19955,16 @@ This option applies only to deliveries in maildir format, and is described in
section &<<SECTmaildirdelivery>>& below.


-.option maildir_use_size_file appendfile boolean false
+.new
+.option maildir_use_size_file appendfile&!! boolean false
.cindex "maildir format" "&_maildirsize_& file"
-Setting this option true enables support for &_maildirsize_& files. Exim
+The result of string expansion for this option must be a valid boolean value.
+If it is true, it enables support for &_maildirsize_& files. Exim
creates a &_maildirsize_& file in a maildir if one does not exist, taking the
quota from the &%quota%& option of the transport. If &%quota%& is unset, the
value is zero. See &%maildir_quota_directory_regex%& above and section
&<<SECTmaildirdelivery>>& below for further details.
+.wen

 .option maildirfolder_create_regex appendfile string unset
 .cindex "maildir format" "&_maildirfolder_& file"
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index d689179..a8e8868 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -103,6 +103,9 @@ PP/05 Variable $av_failed, true if the AV scanner deferred.
 PP/06 Stop make process more reliably on build failure.
       Bugzilla 1087.  Patch from Heiko Schlittermann.


+PP/07 Make maildir_use_size_file an _expandable_ boolean.
+      Bugzilla 1089.  Patch Heiko Schlittermann.
+


Exim version 4.76
-----------------
diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c
index a9283f6..11c59bb 100644
--- a/src/src/transports/appendfile.c
+++ b/src/src/transports/appendfile.c
@@ -36,6 +36,10 @@ stored in the publicly visible instance block - these are flagged with the
opt_public flag. */

 optionlist appendfile_transport_options[] = {
+#ifdef SUPPORT_MAILDIR
+  { "*expand_maildir_use_size_file", opt_stringptr,
+      (void *)offsetof(appendfile_transport_options_block, expand_maildir_use_size_file) },
+#endif
   { "*set_use_fcntl_lock",opt_bool | opt_hidden,
       (void *)offsetof(appendfile_transport_options_block, set_use_fcntl) },
   { "*set_use_flock_lock",opt_bool | opt_hidden,
@@ -103,7 +107,7 @@ optionlist appendfile_transport_options[] = {
       (void *)offsetof(appendfile_transport_options_block, maildir_retries) },
   { "maildir_tag",       opt_stringptr,
       (void *)offsetof(appendfile_transport_options_block, maildir_tag) },
-  { "maildir_use_size_file", opt_bool,
+  { "maildir_use_size_file", opt_expand_bool,
       (void *)offsetof(appendfile_transport_options_block, maildir_use_size_file ) } ,
   { "maildirfolder_create_regex", opt_stringptr,
       (void *)offsetof(appendfile_transport_options_block, maildirfolder_create_regex ) },
@@ -182,6 +186,7 @@ appendfile_transport_options_block appendfile_transport_option_defaults = {
   NULL,           /* quota_warn_threshold */
   NULL,           /* mailbox_size_string */
   NULL,           /* mailbox_filecount_string */
+  NULL,           /* expand_maildir_use_size_file */ 
   US"^(?:cur|new|\\..*)$",  /* maildir_dir_regex */
   NULL,           /* maildir_tag */
   NULL,           /* maildirfolder_create_regex */
@@ -270,6 +275,10 @@ dummy = dummy;
 uid = uid;
 gid = gid;


+if (ob->expand_maildir_use_size_file)
+    ob->maildir_use_size_file = expand_check_condition(ob->expand_maildir_use_size_file, 
+        US"`maildir_use_size_file` in transport", tblock->name);
+
 /* Loop for quota, quota_filecount, quota_warn_threshold, mailbox_size,
 mailbox_filecount */


diff --git a/src/src/transports/appendfile.h b/src/src/transports/appendfile.h
index d0c0e72..52dc3ba 100644
--- a/src/src/transports/appendfile.h
+++ b/src/src/transports/appendfile.h
@@ -21,6 +21,7 @@ typedef struct {
uschar *quota_warn_threshold;
uschar *mailbox_size_string;
uschar *mailbox_filecount_string;
+ uschar *expand_maildir_use_size_file;
uschar *maildir_dir_regex;
uschar *maildir_tag;
uschar *maildirfolder_create_regex;