[Dovecot] Copy from INBOX to INBOX corrupts file

Timo Sirainen tss at iki.fi
Thu Oct 16 19:15:53 EEST 2003


On Thu, 2003-10-16 at 19:06, Andreas Jaekel wrote:
> Concerning the problem of copying within one folder...
> 
> I'm still not sure it's not a problem I created myself,

No, it's with mbox too.

> but I think it's caused by the use of the buffered IO
> routines in ostream-file.c ... you use io_add() to schedule
> write operations for later while simultanously reading
> new chunks from the very same file.  This seems to
> confuse dovecot and make it write the copy to the
> strangest locations.  I think when working within one
> folder I should use either blocking IO or a lot
> of calls to o_stream_flush()...  what do you think?

I think it is using blocking I/O? I'm not actually sure if Dovecot ever
really uses the io_add() there anymore..

mbox-save.c:
	ctx->output = o_stream_create_file(ibox->index->mbox_fd,
					   default_pool, 4096, FALSE);
	o_stream_set_blocking(ctx->output, 60000, NULL, NULL);




More information about the dovecot mailing list