On 12/13/18 11:46 AM, Ian Zimmerman wrote:

On 2018-12-13 23:15, Victor Sudakov wrote:

I have over 400 mboxes in my ~/Mail directory, some of them being
mailing list archives, others being Usenet groups archives, or mboxes
inherited from my decommissioned CommuniGate server.

My dovecot configuration is simple: "mail_location = 
mbox:~/Mail:INBOX=/var/mail/%u"

If I knew how to convert all this stuff to Maildir storage... Do I
have to convert all of them at once?

No, mutt can handle maildirs and mboxes alongside each other.  It just
looks at what kind of file/directory it is dealing with at runtime.

For conversion, you can use formail -s together with some script that
will deliver to maildirs.  I can provide you with mine if you ask.
Also, something like

DEFAULT=/path/to/maildir/ procmail /dev/null

will work (but I try to avoid procmail for data-critical tasks).

Lastly, are you sure you need IMAP and dovecot at all?  Do you have
shell access to the server?

You may want to preserve message attributes -- things like, this message has been read, this message has been replied to, this message has been flagged, this message has been assigned the keyword "blorgh". Mail delivery agents, including procmail, are likely to drop that information.

You can convert mbox to maildir through Mutt, since it can read and write both. Read an mbox folder, copy all its message to a new maildir folder. Or read an IMAP folder, copy to a maildir folder. I don't know whether Mutt can copy a local folder (eg mbox) to an IMAP folder.

Since an IMAP server is involved, the ideal would be to do everything through that server -- read an mbox through IMAP, write a maildir through IMAP. Offhand, I don't know whether Dovecot can handle both at the same time, or whether Mutt can handle two IMAP folders at the same time. But I think, in practice, Mutt and Dovecot get along all right -- that is, Mutt could do the conversion directly, not through IMAP, and Dovecot will understand the result. You'd have to test it, of course.

Whether to use IMAP at all -- well, one reason to use IMAP, even if you have direct access to the mail files, is so you can use any mail reader, not just one. When various mail readers read and write files directly, even file formats that are supposedly the same, the mail readers may not do it compatibly with each other. That's especially true of mbox, which is actually many related file formats, not just one.

Also, IMAP allows concurrent access. Direct access to files by a mail reader many or may not implement concurrent access.

Reply via email to