imapsync-go

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 2 Imported by: 0

README

imapsync-go

imapsync-go is a lightweight Go CLI that mirrors folders between two IMAP accounts. It builds a sync plan from message IDs, streams mail bodies directly between servers.

Note: This project was created in collaboration with the GPT 5.1 Codex agent model.

Motivation

This tool was built to provide a simple, fast, and dependency-free solution for IMAP synchronization. Key goals:

  • Zero dependencies - Single static binary with no external requirements
  • Cross-platform - Works on Linux and macOS (amd64/arm64)
  • Efficient - Parallel workers for fast synchronization
  • Simple - Easy configuration via JSON or YAML

Unlike heavyweight alternatives, imapsync-go focuses on doing one thing well: efficiently copying IMAP folders between servers.

Installation

Homebrew (macOS)
brew tap greeddj/tap
brew install imapsync-go
Docker

Pull the image from GitHub Container Registry:

# Latest version
podman pull ghcr.io/greeddj/imapsync-go:latest
# or
podman pull ghcr.io/greeddj/imapsync-go:1.0.0
Binary Release

Download pre-built binaries from GitHub Releases:

# Example for Linux amd64
curl -LO https://github.com/greeddj/imapsync-go/releases/latest/download/imapsync-go_<version>_Linux_x86_64.tar.gz
tar xzf imapsync-go_<version>_Linux_x86_64.tar.gz
chmod +x imapsync-go
sudo mv imapsync-go /usr/local/bin/
sudo xattr -rd com.apple.quarantine /usr/local/bin/imapsync-go

Usage

Configuration

Create a configuration file (config.json or config.yaml):

JSON example:

{
  "src": {
    "label": "Source",
    "server": "imap.source.com:993",
    "user": "user@source.com",
    "pass": "password"
  },
  "dst": {
    "label": "Destination",
    "server": "imap.dest.com:993",
    "user": "user@dest.com",
    "pass": "password"
  },
  "map": [
    {"src": "INBOX", "dst": "INBOX"},
    {"src": "Sent", "dst": "Sent Items"}
  ]
}

YAML example:

src:
  label: Source
  server: imap.source.com:993
  user: user@source.com
  pass: password

dst:
  label: Destination
  server: imap.dest.com:993
  user: user@dest.com
  pass: password

map:
  - src: INBOX
    dst: INBOX
  - src: Sent
    dst: Sent Items
Running with Homebrew
export IMAPSYNC_CONFIG="/Users/$(whoami)/.imapsync/prod_config.json"

# Show available folders
imapsync-go show

# Sync all configured folders
imapsync-go sync -w 4

# Sync specific folder
imapsync-go sync -s INBOX -d INBOX
imapsync-go sync -s 'Test.[some_group].box' -d 'Test/some_group/box'

# Auto-confirm without prompt
imapsync-go sync -y
Running with Docker

# show folders
podman run --rm \
-v /Users/$(whoami)/.imapsync/prod_config.json:/config.json ghcr.io/greeddj/imapsync-go:latest \
-c /config.json \
show

# sync folders
podman run --rm -it \
-v /Users/$(whoami)/.imapsync/prod_config.json:/config.json ghcr.io/greeddj/imapsync-go:latest \
-c /config.json \
sync -w 4
Command-line Options

Global flags:

  • -c, --config - Path to configuration file (default: config.json)

Sync command:

  • -s, --src-folder - Source folder (overrides config)
  • -d, --dest-folder - Destination folder (overrides config)
  • -w, --workers - Number of parallel workers (default: 4, max: 10)
  • -y, --confirm - Auto-confirm without prompt
  • -V, --verbose - Enable verbose output
  • -q, --quiet - Suppress non-error output

Show command:

  • -V, --verbose - Enable verbose output

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package cmd wires CLI configuration and subcommands.
Package cmd wires CLI configuration and subcommands.
commands
Package commands implements CLI subcommands for imapsync-go.
Package commands implements CLI subcommands for imapsync-go.
internal
client
Package client wraps go-imap with reconnect logic and higher-level helpers.
Package client wraps go-imap with reconnect logic and higher-level helpers.
config
Package config provides configuration management for imapsync.
Package config provides configuration management for imapsync.
progress
Package progress provides pre-configured progress bar utilities.
Package progress provides pre-configured progress bar utilities.
utils
Package utils hosts small helper routines shared across commands.
Package utils hosts small helper routines shared across commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL