src.overquota
changeset 26 1a5f0c5987d0
parent 22 aab32b922fa2
child 27 45696d13651f
equal deleted inserted replaced
25:9b0dcedaddc2 26:1a5f0c5987d0
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent e5aaf8e99b1e7f5ff16649a4b8a69716b82b9cc2
     2 # Parent f28044d5dcaf4418eb3c92fd325ce439c57cbab4
     3 
     3 
     4 diff -r e5aaf8e99b1e doc/spec.txt
     4 diff -r f28044d5dcaf doc/spec.txt
     5 --- a/doc/spec.txt	Thu Apr 07 15:38:24 2011 +0200
     5 --- a/doc/spec.txt	Tue May 17 16:17:21 2011 +0200
     6 +++ b/doc/spec.txt	Thu Apr 07 16:05:46 2011 +0200
     6 +++ b/doc/spec.txt	Tue May 17 16:17:42 2011 +0200
     7 @@ -18143,6 +18143,16 @@
     7 @@ -4,6 +4,16 @@
     8  or not it ends with "/". This option is available only if SUPPORT_MAILDIR is
     8  
     9  present in Local/Makefile. See section 26.5 below for further details.
     9  Copyright (c) 2011 University of Cambridge
    10  
    10  
    11 ++-------------------------------------------------------------------+
    11 ++-------------------------------------------------------------------+
    12 +|maildir_overquota_file|Use: appendfile|Type: string*|Default: unset|
    12 +|maildir_overquota_file|Use: appendfile|Type: string*|Default: unset|
    13 ++-------------------------------------------------------------------+
    13 ++-------------------------------------------------------------------+
    14 +
    14 +
    17 +this file, but the quota is not reached, the file gets removed.
    17 +this file, but the quota is not reached, the file gets removed.
    18 +
    18 +
    19 +The filename is taken relative to the mailir directory.
    19 +The filename is taken relative to the mailir directory.
    20 +
    20 +
    21  +-----------------------------------------------------------------------------+
    21  +-----------------------------------------------------------------------------+
    22  |maildir_quota_directory_regex|Use: appendfile|Type: string|Default: See below|
    22  +-------------------------------------+--------------------------------+------+
    23  +-----------------------------------------------------------------------------+
    23  |Revision 4.76                        |06 May 2011                     |EM    |
    24 diff -r e5aaf8e99b1e src/transports/appendfile.c
    24 diff -r f28044d5dcaf src/transports/appendfile.c
    25 --- a/src/transports/appendfile.c	Thu Apr 07 15:38:24 2011 +0200
    25 --- a/src/transports/appendfile.c	Tue May 17 16:17:21 2011 +0200
    26 +++ b/src/transports/appendfile.c	Thu Apr 07 16:05:46 2011 +0200
    26 +++ b/src/transports/appendfile.c	Tue May 17 16:17:42 2011 +0200
    27 @@ -104,6 +104,8 @@
    27 @@ -104,6 +104,8 @@
    28  #ifdef SUPPORT_MAILDIR
    28  #ifdef SUPPORT_MAILDIR
    29    { "maildir_format",    opt_bool,
    29    { "maildir_format",    opt_bool,
    30        (void *)offsetof(appendfile_transport_options_block, maildir_format ) } ,
    30        (void *)offsetof(appendfile_transport_options_block, maildir_format ) } ,
    31 +  { "maildir_overquota_file",    opt_stringptr,
    31 +  { "maildir_overquota_file",    opt_stringptr,
    47  
    47  
    48 +//debug_printf("***>>>>>>>>>>>>> %s\n", ob->maildir_use_size_file);
    48 +//debug_printf("***>>>>>>>>>>>>> %s\n", ob->maildir_use_size_file);
    49  /* Loop for quota, quota_filecount, quota_warn_threshold, mailbox_size,
    49  /* Loop for quota, quota_filecount, quota_warn_threshold, mailbox_size,
    50  mailbox_filecount */
    50  mailbox_filecount */
    51  
    51  
    52 @@ -2776,9 +2780,10 @@
    52 @@ -2778,9 +2782,10 @@
    53  is for the mailbox already being over quota (i.e. the current message is not
    53  is for the mailbox already being over quota (i.e. the current message is not
    54  included in the check). */
    54  included in the check). */
    55  
    55  
    56 -if (!disable_quota && ob->quota_value > 0)
    56 -if (!disable_quota && ob->quota_value > 0)
    57 +if (!disable_quota && (ob->quota_value > 0 || ob->quota_filecount_value > 0))
    57 +if (!disable_quota && (ob->quota_value > 0 || ob->quota_filecount_value > 0))
    60 +    int overquota = 0;
    60 +    int overquota = 0;
    61 +    DEBUG(D_transport)
    61 +    DEBUG(D_transport)
    62      {
    62      {
    63      debug_printf("Exim quota = " OFF_T_FMT " old size = " OFF_T_FMT
    63      debug_printf("Exim quota = " OFF_T_FMT " old size = " OFF_T_FMT
    64        " this message = %d (%sincluded)\n",
    64        " this message = %d (%sincluded)\n",
    65 @@ -2789,31 +2794,62 @@
    65 @@ -2791,31 +2796,62 @@
    66      }
    66      }
    67    if (mailbox_size + (ob->quota_is_inclusive? message_size:0) > ob->quota_value)
    67    if (mailbox_size + (ob->quota_is_inclusive? message_size:0) > ob->quota_value)
    68      {
    68      {
    69 -      DEBUG(D_transport) if (ob->quota_no_check) 
    69 -      DEBUG(D_transport) if (ob->quota_no_check) 
    70 -            debug_printf("mailbox quota exceeded but ignored\n");
    70 -            debug_printf("mailbox quota exceeded but ignored\n");
   138 +        errno = _errno;
   138 +        errno = _errno;
   139 +      }
   139 +      }
   140      }
   140      }
   141    }
   141    }
   142  
   142  
   143 diff -r e5aaf8e99b1e src/transports/appendfile.h
   143 diff -r f28044d5dcaf src/transports/appendfile.h
   144 --- a/src/transports/appendfile.h	Thu Apr 07 15:38:24 2011 +0200
   144 --- a/src/transports/appendfile.h	Tue May 17 16:17:21 2011 +0200
   145 +++ b/src/transports/appendfile.h	Thu Apr 07 16:05:46 2011 +0200
   145 +++ b/src/transports/appendfile.h	Tue May 17 16:17:42 2011 +0200
   146 @@ -24,6 +24,7 @@
   146 @@ -24,6 +24,7 @@
   147    uschar *mailbox_size_string;
   147    uschar *mailbox_size_string;
   148    uschar *mailbox_filecount_string;
   148    uschar *mailbox_filecount_string;
   149    uschar *expand_maildir_use_size_file;
   149    uschar *expand_maildir_use_size_file;
   150 +  uschar *maildir_overquota_file;
   150 +  uschar *maildir_overquota_file;