Re: [exim] Maildir Quota excluding Trash folder.

Pàgina inicial
Delete this message
Reply to this message
Autor: listrcv
Data:  
A: exim-users
CC: Michael Haardt
Assumpte: Re: [exim] Maildir Quota excluding Trash folder.
Philip Hazel wrote:

> Unless prevented by the create_directory option, Exim will always create
> all the directories it needs.
>
> Delivery will be deferred if anything Exim is trying to
> create cannot be created.


Exim would create lots of directories when in some errorneous setup a
string expansion (or whatever) unexpectedly yields a subdirectory that
is maybe a thousand or a twentythousand levels deep. It could end up in
running into some file system limit (like no more free inodes though
space left on the device) after creating 199999 directories, fail the
delivery and leave a mess of a useless directory tree around. That might
also block deliveries to other users.

The sieve filtering of Cyrus just falls back to delivering into the
inbox for deliveries into non-existing subfolders. Maybe there's
something to giving admins control of what Exim will do, with options like:


directory_fallback_create = YES or NO
directory_fallback = "some maildir"
create_directory_maxdepth = maximum depth to create directories


The following logic could apply:


if(create_directory) {
   if(create_directory_maxdepth > would_create) {
     if(directory_fallback) {
       if( !exists(directory_fallback) ) {
         if(directory_fallback_create) {
           if( !create_directory_fallback) {
             log_errormessage;
             defer_delivery;
           }
           if( !deliver_to(directory_fallback) ) {
             defer_delivery;
           }
         }
       }
       else {
         if( !deliver_to(directory_fallback) ) {
           defer_delivery;
         }
       }
     }
     else {
       log_errormessage;
       defer_delivery;
     }
   }
   else {
     if( !create_directories) {
       log_errormessage;
       defer_delivery;
     }
     else {
       if( !deliver_to(directory_fallback) ) {
         defer_delivery;
       }
     }
   }
}
else {
   if( !deliver_to(directory_fallback) ) {
     log_errormessage;
     defer_delivery;
   }
}



The content of directory_fallback should preferably not be subjected to
too much string expansion and must never be created by Exim unless
explicitly allowed. It would require the admin to pre-create only one
(preferably the top level one!) maildir which could be done by using
/etc/skel.


GH