Site Overlay

How To Move Email Using The IMAP Sync CLI Utility

Imapsync

Notice

We Are Not Pair!!! Unofficial Guide!!!

Tags

Account Type: Any
Difficult Level:Medium

Pre-Requisites

You’ll want to have some familiarity with using SSH / shell commands.
Unfortunately, its not possible to follow this guide only using FTP or the
ACC.

Pair’s Help Guide On Using SSH

Overview

Its possible to move mail from one mailbox to another using the command line
utility, imapsync which is installed on Pair’s servers by default. You can
use this utility to move mail into a Pair mailbox from an external host, or to
move mail to an external host from a pair mailbox. You could even use it to
move mail between two Pair hosted mailboxes or two externally hosted mailboxes.

Any mail server that you can connect to using IMAP you can use imapsync with
to move mail from one mailbox to another.

How To Use Imapsync

First you’ll want to connect to your Pair account’s hosting server, where the
imapsync utility is installed. (Replace username with your pair hosting
account username).

ssh [email protected]

Once SSH’ed into the server, you’ll want to run the command below. In the
example below we’re demonstrating moving mail from a gmail account to a pair
account mailbox.

Protip: Paste the command into Notepad or your favorite text editor first to
update the placeholder values to the real values for your mailboxes.

imapsync --ssl1 --ssl2 --host1 imap.gmail.com \
  --user1="[email protected]" \
  --host2 username.mail.pairserver.com \
  --user2="[email protected]" --subscribe

That command will then start up and ask you for the passwords for the two
mailboxes involved.

What's the password for [email protected] at username.mail.pairserver.com? (not visible while you type, then enter RETURN) 

As long as the settings and passwords are correct, imapsync should begin
syncing mail between the two accounts!

A Note About Gmail

Imapsync acts as an IMAP client. Gmail has a list of authorized IMAP clients
and imapsync isn’t on it. Because of this, if you’re going to sync to or from
a gmail account you’ll need to make sure that you give access to “less secure
apps” (their phrasing).

https://support.google.com/a/answer/6260879?sjid=3472196453827172882-NA

Sources

Official Imapsync Site
Imapsync Man Page

For more info on the command usage run, imapsync --help|less