1. 17
  1. 13

    The best tool to move IMAP accounts is https://imapsync.lamiral.info/ .

    Actual working example, with the host names changed:

    imapsync \
      --host1 outlook.office365.com \
      --ssl1 \
      --user1 user1@example.com \
      --passfile1 "${CONFDIR}/user1-examplecom-passfile" \
      --host2 mail.example.net \
      --ssl2 \
      --user2 user1@example.net \
      --passfile2 "${CONFDIR}/user1-examplenet-passfile" \
      --delete2 \
      --addheader \
      --exclude "(?)Calendar" \
      --exclude "(?)Sync Issues" \
      --exclude "(?)Deleted Items" \
      --exclude "(?)Conversation History" \
      --exclude "(?)RSS Feeds" \
      --exclude "(?)RSS Subscriptions" \
      --noemailreport1 --noemailreport2 \
      --logdir "${LOGDIR}" \
      --logfile "o365-sync.log"
    
    1. 3

      imapsync has never failed me. Used it to transfer my backlog of 20 years worth of emails and it did not miss a single one.

      It seems the author was confused over its price, which I understand looking at the website. For me it always was available in my distro’s package manager, so is the price listed really only for support and perhaps people on Windows then?

      1. 1

        Officially, a license for the software costs €60. However, you don’t have to look too far on the website to find that there’s a copy sitting in /dist/. And like you say, some package managers (including brew) include it.

        The software is released under the No Limit Public License, and there’s this note in the source code:

        Gilles LAMIRAL earns his living by writing, installing, configuring and sometimes teaching free, open, and often gratis software. Imapsync used to be “always gratis” but now it is only “often gratis” because imapsync is sold by its author, your servitor, a good way to maintain and support free open public software tools over decades.

    2. 4

      I have my mails synced on my computer with mbsync or offlineimap. I keep those in the maildir format.

      In case I need to move them, it’s a matter of configuring mbsync/offlineimap with the new account then mv ~/maildir/old_account ~/maildir/new_account

      1. 1

        Hm, should be possible to prototype in a day imap->imap copy with TLS using my email client library. If anyone needs this you can reply here and I’ll ping you when I push the tool to git.