src.overquota
changeset 22 aab32b922fa2
parent 21 385a89e503c7
child 26 1a5f0c5987d0
equal deleted inserted replaced
21:385a89e503c7 22:aab32b922fa2
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent 70d48c9a5cfe16fac997537f3e902328212548a5
     2 # Parent e5aaf8e99b1e7f5ff16649a4b8a69716b82b9cc2
     3 
     3 
     4 diff -r 70d48c9a5cfe src/transports/appendfile.c
     4 diff -r e5aaf8e99b1e doc/spec.txt
     5 --- a/src/transports/appendfile.c	Fri Apr 01 16:36:30 2011 +0200
     5 --- a/doc/spec.txt	Thu Apr 07 15:38:24 2011 +0200
     6 +++ b/src/transports/appendfile.c	Thu Apr 07 15:29:50 2011 +0200
     6 +++ b/doc/spec.txt	Thu Apr 07 16:05:46 2011 +0200
       
     7 @@ -18143,6 +18143,16 @@
       
     8  or not it ends with "/". This option is available only if SUPPORT_MAILDIR is
       
     9  present in Local/Makefile. See section 26.5 below for further details.
       
    10  
       
    11 ++-------------------------------------------------------------------+
       
    12 +|maildir_overquota_file|Use: appendfile|Type: string*|Default: unset|
       
    13 ++-------------------------------------------------------------------+
       
    14 +
       
    15 +If this option is set, Exim will create a timestamp file with this name (after
       
    16 +expansion) as soon as the the MTA imposed quota limit is hit. If Exim finds
       
    17 +this file, but the quota is not reached, the file gets removed.
       
    18 +
       
    19 +The filename is taken relative to the mailir directory.
       
    20 +
       
    21  +-----------------------------------------------------------------------------+
       
    22  |maildir_quota_directory_regex|Use: appendfile|Type: string|Default: See below|
       
    23  +-----------------------------------------------------------------------------+
       
    24 diff -r e5aaf8e99b1e src/transports/appendfile.c
       
    25 --- a/src/transports/appendfile.c	Thu Apr 07 15:38:24 2011 +0200
       
    26 +++ b/src/transports/appendfile.c	Thu Apr 07 16:05:46 2011 +0200
     7 @@ -104,6 +104,8 @@
    27 @@ -104,6 +104,8 @@
     8  #ifdef SUPPORT_MAILDIR
    28  #ifdef SUPPORT_MAILDIR
     9    { "maildir_format",    opt_bool,
    29    { "maildir_format",    opt_bool,
    10        (void *)offsetof(appendfile_transport_options_block, maildir_format ) } ,
    30        (void *)offsetof(appendfile_transport_options_block, maildir_format ) } ,
    11 +  { "maildir_overquota_file",    opt_stringptr,
    31 +  { "maildir_overquota_file",    opt_stringptr,
    96 +
   116 +
    97 +  /* now we'll take care about the overquota file, using it as a timestamp
   117 +  /* now we'll take care about the overquota file, using it as a timestamp
    98 +   * to record this overquota event */
   118 +   * to record this overquota event */
    99 +  if (ob->maildir_overquota_file)
   119 +  if (ob->maildir_overquota_file)
   100 +    {
   120 +    {
   101 +    uschar *overquota_file = string_sprintf("%s/%s", path, ob->maildir_overquota_file);
   121 +    uschar *overquota_file = string_sprintf("%s/%s", path, expand_string(ob->maildir_overquota_file));
   102 +    if (overquota) 
   122 +    if (overquota) 
   103 +      {
   123 +      {
   104 +        int _errno = errno;
   124 +        int _errno = errno;
   105 +        errno = 0;
   125 +        errno = 0;
   106 +        (void) open(overquota_file, O_CREAT|O_EXCL|O_RDWR, 0444);
   126 +        (void) open(overquota_file, O_CREAT|O_EXCL|O_RDWR, 0444);
   118 +        errno = _errno;
   138 +        errno = _errno;
   119 +      }
   139 +      }
   120      }
   140      }
   121    }
   141    }
   122  
   142  
   123 diff -r 70d48c9a5cfe src/transports/appendfile.h
   143 diff -r e5aaf8e99b1e src/transports/appendfile.h
   124 --- a/src/transports/appendfile.h	Fri Apr 01 16:36:30 2011 +0200
   144 --- a/src/transports/appendfile.h	Thu Apr 07 15:38:24 2011 +0200
   125 +++ b/src/transports/appendfile.h	Thu Apr 07 15:29:50 2011 +0200
   145 +++ b/src/transports/appendfile.h	Thu Apr 07 16:05:46 2011 +0200
   126 @@ -24,6 +24,7 @@
   146 @@ -24,6 +24,7 @@
   127    uschar *mailbox_size_string;
   147    uschar *mailbox_size_string;
   128    uschar *mailbox_filecount_string;
   148    uschar *mailbox_filecount_string;
   129    uschar *expand_maildir_use_size_file;
   149    uschar *expand_maildir_use_size_file;
   130 +  uschar *maildir_overquota_file;
   150 +  uschar *maildir_overquota_file;