IMAP copy and utilities

Copy mailboxes between IMAP servers, import from MBOX, or download mail locally. Simple, fast CLI built with Go.

Latest release ↗ Linux • macOS • Windows
gomap mascot

IMAP ➜ IMAP

Copy messages across servers with filtering, concurrency and resume state.

MBOX import

Import from local mbox files into any destination mailbox.

Backup locally

Download mailboxes to files or an mbox per folder, ideal for backups.

Developer‑friendly

Predictable flags, quiet by default, verbose when needed. Easy to script.

Safe by default

StartTLS/implicit TLS, password prompts, and an explicit --dry-run.

Cross‑platform

Single static binary for amd64/arm64 on Linux, macOS and Windows.

Install

Prebuilt binaries

Download from GitHub Releases.

Releases page ↗

Ubuntu packages

Install from the official PPA:

sudo add-apt-repository ppa:pepperpark/gomap
sudo apt update
sudo apt install gomap

Go install

Install the latest version directly with Go:

go install github.com/pepperpark/gomap/cmd/gomap@latest

Replace @latest with a tagged version (e.g. @v0.3.0) to pin releases.

Build from source

Clone and build a static binary:

git clone https://github.com/pepperpark/gomap
cd gomap
make build   # or: go build -o gomap ./cmd/gomap

Note: go install requires Go 1.21+ and places the binary in $(go env GOPATH)/bin, so ensure that directory is on your PATH.

Usage

Copy IMAP ➜ IMAP

gomap copy \ 
  --src-host imap.source.example --src-user alice --src-pass-prompt 
  --dst-host imap.dest.example   --dst-user alice --dst-pass-prompt 
  --include 'INBOX|Work' --since 2024-01-01 
  --concurrency 4 --skip-special
  • --include/--exclude accept regex.
  • --skip-special filters Trash/Junk/Drafts/Sent (see flags for fine control).
  • --state-file enables resumable runs.

Import from MBOX

gomap copy \ 
  --mbox /path/to/mail.mbox --dst-mailbox INBOX \ 
  --dst-host imap.dest.example --dst-user alice --dst-pass-prompt

Backup to local folder

gomap backup \ 
  --src-host imap.example --src-user alice --src-pass-prompt \ 
  --output-dir ./gomap-download --format mbox --since 2024-01-01

Version info

gomap --version

For all options, run gomap help or gomap <command> --help.

Why gomap?