# Dovecot/Postfix/Sieve



## xy16644 (Feb 19, 2014)

I'm getting the following error in my maillog:


```
mail dovecot: imap(user@domain.com): Error: stat(/var/mail/vhosts/domain.com/user/.dovecot.sieve/tmp) failed: Not a directory
```

I understand *why* this error is occurring but is there anything I can do about it?

The contents of the users directory:


> lrwx------  1 vmail  vmail     23 Feb 13 18:11 .dovecot.sieve -> sieve/managesieve.sieve
> -rw-------  1 vmail  vmail    780 Feb 16 12:27 .dovecot.svbin
> drwx------  3 vmail  vmail      4 Feb 16 12:26 sieve



It only seems to happen when K9 email checks for emails. I have set it in the K9 client to not check the dovecot.sieve folder for updates but the error still occurs.


----------



## gessel (May 31, 2017)

This is a really late answer (3 years) but as nobody has yet and as I have the same problem.  The below is supposed to work, but it did not for me.  I'll update if I find a working solution.  I've divided my sieve scripts into multiple files in the /sieve directory, which may complicate the problem.  Perhaps this solution will work for you.

I too am using virtual users, sieve, and maildir - which means that the sieve script directories are in the same directory structure as the IMAP mail directories, which confuses IMAP somewhat, fortunately not in a fatal way, but in a way that generates an annoyance of error messages.  Fortunately, Dovecot can validate the directory structure before passing it on, filtering out non-mailbox directories with the directive 
	
	



```
maildir_stat_dirs=yes
```
 as described in the documentation for virtual users.

Edit /usr/local/etc/dovecot/conf.d/10-mail.conf (your location may vary by version) and change the default 
	
	



```
# maildir_stat_dirs = no
```
 to the below and the errors should go away.


```
##
## Maildir-specific settings
##                                                               

# 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
```


----------



## AngelD (Nov 24, 2017)

Your "late answer" solve my actual problem. Thanks.


----------



## gessel (Nov 25, 2017)




----------

