[Exim] Wrong behaviour using maildir_use_size_file and creat…

Top Page
Delete this message
Reply to this message
Author: javier ruiz
Date:  
To: exim-users
Subject: [Exim] Wrong behaviour using maildir_use_size_file and create_directory??
Hi!

I've been testing the new maildir_use_size_file option in exim 4.30 but
it is not working as I hoped when mixed with create_directory.

If I configure a transport like this:

maildir:
driver = appendfile
create_directory
maildir_format
maildir_use_size_file
quota = 4194304
quota_warn_threshold = 90%
directory=/path
...

If the directory doesn't exist, the debug shows that it first tries to
recalculate and write the maildirsize file before creating the directory:

    appendfile transport entered
    appendfile: mode=660 notify_comsat=0 quota=4194304 warning=90
      directory=/path format=maildir
      message_prefix=null
      message_suffix=null
      maildir_use_size_file=yes


... MAILDIRSIZE QUOTA CHECK

    QUOTA maildirsize checks on directory /path
    QUOTA unable to open maildirsize or file not is valid: /path
    QUOTA maildirquota file set (I think) checkpath=/path quota_string=4194304S
    QUOTA recalculation needed: checkpath=/path quota=0 size=0 message_size=250
rc=0
    QUOTA from maildirsize: checkpath=/path quota=0 size=0 message_size=250
    QUOTA maildirsize checked on checkpath=/path quota=0 saved_size=0
message_size=250


... DIRECTORY CREATION

    delivering in maildir format in /path
    created directory /path
    created directory /path/tmp
    created directory /path/new
    created directory /path/cur


so it fails, the quota is 0, a warning is triggered and the user
receive an extra message telling it has exceed the quota.

    quota = 0 threshold = 0 old size = 0 message size = 314
    ...
    Warning message requested by transport


As a temp solution I've changed in src/transports/appendfile.c the
line 2161 from "else" to "else if (Ustat(check_path, &statbuf) == 0)" so
it uses the standard exim quota method if the directory doesn't exist, and
following mails will recreate the file in the right way:

    appendfile transport entered
    appendfile: mode=660 notify_comsat=0 quota=4194304 warning=90
      directory=/path format=maildir
      message_prefix=null
      message_suffix=null
      maildir_use_size_file=yes
    delivering in maildir format in /path
    created directory /path
    created directory /path/tmp
    created directory /path/new
    created directory /path/cur
    writing to file tmp/1072195627.H912225P13161.host
    Exim quota = 4194304 old size = 0 this message = 250 (included)
      file quota = 0 count = 0
    writing data block fd=6 size=314 timeout=0
    quota = 4194304 threshold = 3774873 old size = 0 message size = 314
    renaming temporary file
    renamed tmp/1072195627.H912225P13161.host as
new/1072195627.H912225P13161.host
    appendfile yields 0 with errno=0 more_errno=0
    search_tidyup called
    journalling email@???
    maildir transport returned OK for email@???


I know there is an hidden option like maildir_use_size_file_but
_create_directory_before but I haven't been able to find it :)

Is this supposed to be the right behaviour?
Any suggestion to get around this without changing sources?

Thx in advance.