[Dovecot] Converting mbox files with dots in names to Maildir
I tried to run convert-tool from dovecot-1.2-0.rc2 on a tree of mbox files with some containing dots in the filenames and got this failure:
# /usr/libexec/dovecot/convert-tool ken /home/ken mbox:/home/ken/mail maildir:/home/ken/Maildir Error: Mailbox conversion: Couldn't create mailbox Lists.WINE.patches: Mailbox already exists Error: Internal failure *** glibc detected *** /usr/libexec/dovecot/convert-tool: double free or corruption (fasttop): 0x08ce6cc8 ***
The directory in question contains these files:
# ls Lists/WINE/ announce bugs cvs devel patches patches.20050130
Will I need to go through the (large) file tree and rename all files with dots in the names? If so, anyone have a script that will do that? (Changing the dot to dash would be fine with me.)
Looks like I need to use the optional convert-tool argument "alt_hierarchy_char=-" to get the desired effect. Looking at the source, this is used when the folder name is converted from source format to destination format and the name contains the hierarchy separator from the destination format.
Alas, if you don't provide this argument, convert-tool (and presumably the convert plugin, which shares this code) will just crash with a double-free when it encounters such a name.
The option parsing in convert-tool.c won't work, as the strcmp compares are wrong. The result should be compared equal to zero, not not-equal. Here's corrected code:
for (i = 5; i < argc; i++) {
if (strcmp(argv[i], "skip_broken_mailboxes") == 0)
set.skip_broken_mailboxes = TRUE;
else if (strcmp(argv[i], "skip_dotdirs") == 0)
set.skip_dotdirs = TRUE;
else if (strncmp(argv[i], "alt_hierarchy_char=", 19) == 0)
set.alt_hierarchy_char = argv[i][19];
}
Even with this fix, and report of a successful conversion, glibc is reporting a double-free:
Info: Successfully converted *** glibc detected *** /tmp/convert-tool: double free or corruption (fasttop): 0x08ae9cc8 ***
On Sun, 2009-05-24 at 19:05 -0700, Kenneth Porter wrote:
# /usr/libexec/dovecot/convert-tool ken /home/ken mbox:/home/ken/mail maildir:/home/ken/Maildir Error: Mailbox conversion: Couldn't create mailbox Lists.WINE.patches: Mailbox already exists Error: Internal failure *** glibc detected *** /usr/libexec/dovecot/convert-tool: double free or corruption (fasttop): 0x08ce6cc8 ***
Can you run this via valgrind and show me its output? It's done simply by:
valgrind convert-tool ...
On Mon, 2009-05-25 at 21:24 -0700, Kenneth Porter wrote:
Attached is valgrind run.
participants (2)
-
Kenneth Porter
-
Timo Sirainen