IMAP copy and utilities
Copy mailboxes between IMAP servers, import from MBOX, or download mail locally. Simple, fast CLI built with Go.
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
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/--excludeaccept regex.--skip-specialfilters Trash/Junk/Drafts/Sent (see flags for fine control).--state-fileenables 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?
- Zero-config: only flags you actually need.
- Streams messages; good performance even with large accounts.
- Small static binary — easy to ship in CI and cron jobs.