On Tue, 2010-10-19 at 13:42 +0200, Edgar Fuß wrote:
> > Yes. Sieve uses the same functions for saving mails as the rest of
> > Dovecot.
> It happened again, so I have more input:
>
> I have several of these:
> Oct 9 00:41:22 xxx dovecot: deliver(xxxxxx):
> fdatasync(/import/mail/xxxxxx/dovecot-uidlist) failed: Disc quota exceeded
These are about errors writing to uidlist. It's not very good to keep
these files in quota tracked filesystem, but they're not causing the
zero byte files either.
> Hope that helps tracking down the bug.
I'm still thinking this has more to do with your system than anything in
Dovecot. But you could try if the attached patch catches those zero byte
files by logging about them.
diff -r 1ecf1c3f7ecf src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c Thu Oct 14 18:20:26 2010 +0100
+++ b/src/lib-storage/index/maildir/maildir-save.c Tue Oct 19 13:57:26 2010 +0100
@@ -70,6 +70,7 @@
{
struct mail_storage *storage = &ctx->mbox->storage->storage;
const char *tmp_path, *new_path;
+ struct stat st;
int ret;
/* if we have flags, we'll move it to cur/ directly, because files in
@@ -81,6 +82,11 @@
t_strconcat(ctx->newdir, "/", destname, NULL) :
t_strconcat(ctx->curdir, "/", destname, NULL);
+ if (stat(tmp_path, &st) < 0)
+ i_error("stat(%s) failed: %m", tmp_path);
+ else if (st.st_size == 0)
+ i_error("Going to rename 0 byte file: %s -> %s", tmp_path, new_path);
+
/* maildir spec says we should use link() + unlink() here. however
since our filename is guaranteed to be unique, rename() works just
as well, except faster. even if the filename wasn't unique, the