Hello, Last days we had to restore some mailboxes from backup. Our mailboxes are in maildir format and during restore, some duplicated files appeared. The situation is: * A user has messages in his new directory when the backup is made * In some moment after the backup is done, the user accesses to his mailbox, so the message is move to the cur directory. * We restore his mailbox directly to his maildir path, so the message is now at new directory too. When this happens, dovecot detect it and it renames one of the files. This is the reported log: Feb 13 23:08:05 myotis31 dovecot: imap(<user>): Warning: Fixed a duplicate: /home/alumnos/59/122559/Maildir/cur/1360169810.M670208P13643.myotis31,S=6282,W=6409:2, -> 1360793285.M721935P29136.myotis31 The problem with this is that we are using zlib plugin so messages are compressed. When the rename is done, the rename is to a name without the S=XXXX field (neither the W=XXX, although this field is less sensible), so the result is that user's can't access to any message after this one. I think than in this situation, rename one of the files is a good solution (although it provokes duplicate mails, but this an expected/acceptable situation after the restore), but the rename should maintain the S= and W= fields (and even other maildir flags). -- Angel L. Mateo Mart?nez Secci?n de Telem?tica ?rea de Tecnolog?as de la Informaci?n y las Comunicaciones Aplicadas (ATICA) um.es/atica Tfo: 868889150 Fax: 868888337
Am 25.02.2013 11:41, schrieb Angel L. Mateo:> Hello, > > Last days we had to restore some mailboxes from backup. Our > mailboxes are in maildir format and during restore, some duplicated > files appeared. The situation is: > > * A user has messages in his new directory when the backup is made > * In some moment after the backup is done, the user accesses to his > mailbox, so the message is move to the cur directory. > * We restore his mailbox directly to his maildir path, so the message is > now at new directory too. > > When this happens, dovecot detect it and it renames one of the > files. This is the reported log: > > Feb 13 23:08:05 myotis31 dovecot: imap(<user>): Warning: Fixed a > duplicate: > /home/alumnos/59/122559/Maildir/cur/1360169810.M670208P13643.myotis31,S=6282,W=6409:2, > -> 1360793285.M721935P29136.myotis31 > > The problem with this is that we are using zlib plugin so messages > are compressed. When the rename is done, the rename is to a name without > the S=XXXX field (neither the W=XXX, although this field is less > sensible), so the result is that user's can't access to any message > after this one. > > I think than in this situation, rename one of the files is a good > solution (although it provokes duplicate mails, but this an > expected/acceptable situation after the restore), but the rename should > maintain the S= and W= fields (and even other maildir flags). >how you do the backup, dsync , rsync ??? perhaps you can avoid problems restore mail to another new named mailbox like restore.orig.name at somedomain.example, then the user himself or supporter, may copy restored mails himself to the orig mailbox or might be better in some subfolder i.e restore of the orig mailbox Best Regards MfG Robert Schetterer -- [*] sys4 AG sys4.de, +49 (89) 30 90 46 64 Franziskanerstra?e 15, 81669 M?nchen Sitz der Gesellschaft: M?nchen, Amtsgericht M?nchen: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Joerg Heidrich
El 25/02/13 11:53, Robert Schetterer escribi?:> how you do the backup, dsync , rsync ???With tivoli> perhaps you can avoid problems restore mail to another new named mailbox > like restore.orig.name at somedomain.example, then the user himself or > supporter, may copy restored mails himself to the orig mailbox or might > be better in some subfolder i.e restore of the orig mailbox >Yes, I know I can restore to another path and then import messages. The problem is that in a situation with no problem but duplicate mails, the user ends with a corrupted mailbox because dovecot rename a file to a wrong filename. -- Angel L. Mateo Mart?nez Secci?n de Telem?tica ?rea de Tecnolog?as de la Informaci?n y las Comunicaciones Aplicadas (ATICA) um.es/atica Tfo: 868889150 Fax: 868888337
On 25.2.2013, at 12.41, Angel L. Mateo <amateo at um.es> wrote:> Feb 13 23:08:05 myotis31 dovecot: imap(<user>): Warning: Fixed a duplicate: /home/alumnos/59/122559/Maildir/cur/1360169810.M670208P13643.myotis31,S=6282,W=6409:2, -> 1360793285.M721935P29136.myotis31 > > The problem with this is that we are using zlib plugin so messages are compressed. When the rename is done, the rename is to a name without the S=XXXX field (neither the W=XXX, although this field is less sensible), so the result is that user's can't access to any message after this one. > > I think than in this situation, rename one of the files is a good solution (although it provokes duplicate mails, but this an expected/acceptable situation after the restore), but the rename should maintain the S= and W= fields (and even other maildir flags).OK: hg.dovecot.org/dovecot-2.1/rev/cfd3f39102bd