sieve folders in maildir with imap: not a directory not fixed with maildir_stat_dirs = yes

David Gessel gessel at blackrosetech.com
Thu Jun 1 01:51:30 EEST 2017


Yes, understood.  I was hoping for an easier fix than migration.   In particular:

Home vs. mail directory

Home directory shouldn't be the same as mail directory with mbox or Maildir formats (but with dbox/obox it's fine). It's possible to do that, but you might run into trouble with it sooner or later. Some problems with this are:

    Non-mailbox files may show up as mailboxes.

        If you see this with Maildir, maildir_stat_dirs=yes hides them. 

-> this is the problem I'm having and this directive doesn't seem to be resolving it.

    Or user just might not be able to create mailbox with wanted name, because there already exists a conflicting file

        e.g. with Maildir if you have .dovecot.sieve file, user can't create a mailbox called "dovecot.sieve" (i.e. "dovecot" mailbox that has a "sieve" child) 

-> This makes sense, but the collision probability is relatively small in my case and were it this alone, i wouldn't migrate.

    And vice versa: If user creates "dovecot.sieve" mailbox, Dovecot will probably start logging all kinds of errors because the mailbox directory isn't a valid Sieve script.

-> Again a valid warning, but no collisions yet and they're unlikely, so I wouldn't migrate for this either.

    If you ever intend to migrate to another mailbox format, it's much easier to do if you can have both old and new mail directories under the user's home directory. 

-> Quite sensible also, but no rush to fix the problem as I have intention of migrating.

It'd be very cool if  maildir_stat_dirs=yes worked as I expected, but as it doesn't I'll pick a slow mail time to reconfigure the directory structure.  

-------- Original Message --------
Subject: Re: sieve folders in maildir with imap: not a directory not fixed with maildir_stat_dirs = yes
From: Christian Kivalo <ml+dovecot at valo.at>
To: dovecot at dovecot.org
Date: Wed May 31 2017 23:11:00 GMT+0300 (AST)

> 
> 
> On 2017-05-31 15:09, David Gessel wrote:
>> As my logs fill up with "imap(user at domain.com): Error:
>> stat(/mail/doman.com/user//.dovecot.sieve/tmp) failed: Not a
>> directory" errors, I followed the advice at
>> https://wiki2.dovecot.org/VirtualUsers/Home and
>> https://dovecot.org/list/dovecot/2016-June/104403.html and set in
>> /usr/local/etc/dovecot/conf.d/10-mail.conf
>>
>> # By default LIST command returns all entries in maildir beginning with a dot.
>> # Enabling this option makes Dovecot return only entries which are directories.
>> # This is done by stat()ing each entry, so it causes more disk I/O.
>> # (For systems setting struct dirent->d_type, this check is free and it's
>> # done always regardless of this setting)
>> maildir_stat_dirs = yes
>>
>> My mailbox format reads "mail_location =
>> maildir:~:CONTROL=/var/no-quota/%u:INDEX=MEMORY"
>>
>> The error is factually correct, but there is not .dovecot.sieve/tmp
>> directory or file as .dovecot.sieve is a file (the head sieve script
>> that calls the subordinate scripts out of the /sieve directory.
>>
>> There is a tmp directory at /sieve/tmp/
>>
>> drwxr-----    2 vmail  vmail     2B May 31 04:14 tmp
>>
>>
>> Any hints as to why this isn't working?  It does seem like the right answer.
> The answer is in the wiki page you referred to:
> "Home directory shouldn't be the same as mail directory with mbox or Maildir formats (but with dbox/obox it's fine)."
> 
> You should set mail_home (where for example the sieve script is saved to) to a different path than mail_location.
> 


More information about the dovecot mailing list