Home Forums OS X Server and Client Discussion Mail Getting old mail into IMAP

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #364079
    Anonymous
    Guest

    I have a lot of old mail, in files with headers – one mail per file (exactly as in the /spool/imap/user folders). How do I get this into the new IMAP database?

    I’ve rad some info that indicates that you use /usr/bin/cyrus/bin/deliver but there doesn’t seem to be much info on the syntax to use.

    TIA

    — Clive

    #364496
    samv
    Participant

    I had some success using a tip in another post here

    I moved the mailbox to the /var/spool/imap/users directory using the mv command. Make sure the privileges (ownership and permissions) are correct on the folder. It is rather difficult changing folder and file permissions in the Finder (No read/write access to the /var/spool/imap/user folder in Finder).

    I used chown to change the owner of the folder and files to ‘cyrusimap’:
    sudo chown -R cyrusimap /var/spool/imap/user/mailboxname

    I found the folder already belonged to the ‘mail’ group but you should check this:
    sudo ls -la /var/spool/imap/user

    Delete every file like “cyrus.*” in the mailbox.
    sudo rm /var/spool/imap/user/mailboxname/cyrus.cache
    sudo rm /var/spool/imap/user/mailboxname/cyrus.header
    sudo rm /var/spool/imap/user/mailboxname/cyrus.index

    Reconstruct a single mailbox with the following command:
    sudo -u cyrusimap /usr/bin/cyrus/bin/reconstruct -r user/mailboxname

    Or reconscrut all mailbox with the data:
    sudo -u cyrusimap /usr/bin/cyrus/bin/reconscruct -r user/*

    This restored the In Box (and the messages in the In Box). Woohooo! Unfortunately, this DID NOT restore IMAP folders and mail contained within. I wonder why? Does anyone have ideas?

    The reconstruct command should probably be run with incoming and outgoing mail suspended first.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Comments are closed