[Dovecot] copymail deleted

Timo Sirainen tss at iki.fi
Tue Oct 30 12:19:31 EET 2012


On 30.10.2012, at 12.11, Christian Rößner wrote:

> Oct 30 10:56:05 mx0 dovecot: imap(hidden): Error: file_istream.stat(/var/mail/virtual/copymail/attachments/6a/50/6a506530265ef7c9feb396410eaf6946036e9a79-b034401e794009503a0400002cb72ff6) failed: No such file or directory
> 
> I have Bacula and have restored most of the stuff, but obviously not all files. That is not too important. But I do not know, how to tell dovecot that it may "forget" about files that produce a "No such file or directory" error.
> 
> Can I do some "rescan/rebuild" in dovecot?

Currently you can't in any easy way. The easiest fix for now I think would be to write a script that reads through dbox files, parses the attachment metadata lines and recreates the missing files with the original size (e.g. sparse-0-filled). The dbox parsing can be done easily with:

doveadm dump m.1 | grep ^msg.ext-ref

The format is:

1*(<start offset> <byte count> <options> <ref>)

If the options="-" then the byte count is the final size. If options="B" then byte count is the base64-encoded size while the original file has to be base64-decoded size.




More information about the dovecot mailing list