[Dovecot] copy and empty userA folder1, append to /var/mail/userB
Dovecot 2.0.13 on a 64 bit linux.
We have an archiver account on one machine. Most mailing lists that handles go directly to it and everything is fine. However, there is one campus list that will only send to real people. So for that one I subscribed. When one of these messages comes in, which is 1-2x per week, I copy it to an export folder and then manually run a script which does:
cat ~me/mail/export >>/var/mail/archiver echo "" > ~me/mail/export
That worked fine on our last system, but dovecot doesn't like it. It leaves the imap indices for the export mailbox in an inconsistent state, so that roundcube (through dovecot) refuses to drop messages into it. The error message roundcube emits is:
ServerError: Mailbox isn't a valid mbox file.
Presumably the second half is from dovecot.
I need a supported way to go about this, so that the next time one comes in I can copy to that folder again. The export mailbox is always completely emptied. It would suffice if there was some way to force dovecot to create "empty""
.imap/export: dovecot.index.cache dovecot.index.log
files.
Note this isn't a problem for the archiver itself, since it doesn't have any imap indexed files.
Suggestions?
Thank you,
David Mathog mathog@caltech.edu Manager, Sequence Analysis Facility, Biology Division, Caltech
On Wed, 2011-09-07 at 16:39 -0700, mathog wrote:
Dovecot 2.0.13 on a 64 bit linux.
echo "" > ~me/mail/export
That worked fine on our last system, but dovecot doesn't like it. It leaves the imap indices for the export mailbox in an inconsistent state, so that roundcube (through dovecot) refuses to drop messages into it. The error message roundcube emits is:
ServerError: Mailbox isn't a valid mbox file.
You change the "export" mbox to be one byte size containing LF. It should instead be completely zero size. For example
echo -n > ~me/mail/export
Alternative could be to simply rm it?
On Thu, 08 Sep 2011 10:24:27 +0300, Timo Sirainen wrote:
On Wed, 2011-09-07 at 16:39 -0700, mathog wrote:
Dovecot 2.0.13 on a 64 bit linux.
echo "" > ~me/mail/export
That worked fine on our last system, but dovecot doesn't like it.
It leaves the imap indices for the export mailbox in an inconsistent state, so that roundcube (through dovecot) refuses to drop messages into it. The error message roundcube emits is:ServerError: Mailbox isn't a valid mbox file.
You change the "export" mbox to be one byte size containing LF. It should instead be completely zero size
that was it. Changed the script that does the move to use
cat >~me/mail/export <<EOD EOD
and then the mailbox is usable.
Thanks!
David Mathog mathog@caltech.edu Manager, Sequence Analysis Facility, Biology Division, Caltech
participants (2)
-
mathog
-
Timo Sirainen