CLI tool for IMAP email migration and cPanel email bulk operations
# Clone repository
git clone <repository-url>
cd emoo
# Install dependencies
pnpm install
# Install globally for easier access
pnpm install -g emoo# View all available commands
emoo --help
# or using pnpm
pnpm start --helpThis feature allows bulk email operations in cPanel including password reset and email creation.
# Interactive mode - will ask for server, username, and API key
emoo cpanel reset# With all parameters
emoo cpanel reset \
--server "server.example.com:2083" \
--username "cpanel_user" \
--api-key "your_api_key" \
--password "new_password_for_all" \
--output "./results/custom_output.csv"
# Or with random passwords
emoo cpanel reset \
--server "server.example.com" \
--username "cpanel_user" \
--api-key "your_api_key" \
--output "./results/passwords.csv"# Create emails from CSV file
emoo cpanel create \
--server "server.example.com" \
--username "cpanel_user" \
--api-key "your_api_key" \
--csv "./input/new-emails.csv"
# Or create manually with interactive prompts
emoo cpanel create \
--server "server.example.com" \
--username "cpanel_user" \
--api-key "your_api_key"-s, --server <server>: cPanel server domain/IP (with optional port)-u, --username <username>: cPanel username-k, --api-key <key>: cPanel API key-p, --password <password>: New password for all accounts (empty = random)-o, --output <file>: CSV output file path--regex <pattern>: Filter emails using regex pattern--debug: Enable debug mode
This feature is for email synchronization between IMAP servers using imapsync.
# Sync using default CSV (input/example.csv)
emoo sync
# Sync with custom CSV file
emoo sync --csv input/my-migration.csv
# Dry run - see what would be synced without execution
emoo sync --dry-run --csv input/example.csv
# Use Docker for imapsync
emoo sync --docker --csv input/example.csv
# Parallel processing with 4 jobs
emoo sync --parallel 4 --csv input/example.csv-c, --csv <file>: CSV file containing sync configuration (default: "input/example.csv")-j, --parallel <number>: Number of parallel jobs (default: "1")--docker: Use Docker for imapsync--log-dir <dir>: Directory for log files (default: "./results")--dry-run: Preview commands without execution
The CSV file must contain the following columns:
src_host,src_user,src_pass,dst_host,dst_user,dst_pass,src_port,dst_port,src_ssl,dst_ssl,src_auth,dst_auth
mail.old.com,user1@old.com,pass1,mail.new.com,user1@new.com,pass1,993,993,1,1,,
mail.old.com,user2@old.com,pass2,mail.new.com,user2@new.com,pass2,143,143,0,0,PLAIN,PLAINRequired columns:
src_host: Source IMAP serversrc_user: Source usernamesrc_pass: Source passworddst_host: Destination IMAP serverdst_user: Destination usernamedst_pass: Destination password
Optional columns:
src_port,dst_port: Port numberssrc_ssl,dst_ssl: SSL enabled (1/true = enabled, 0/false = disabled)src_auth,dst_auth: Authentication mechanisms
- Auto-detect authentication method (cpanel/basic/uapi-token)
- Bulk email accounts password reset (including random password generation)
- Bulk email creation
- All result in CSV format
- CSV-based configuration
- Docker support for imapsync
- Node.js: >= 18.0.0
- imapsync: Optional (if not using Docker)
- Docker: Optional (for imapsync Docker mode)
# Reset passwords for all emails in selected domain
emoo cpanel reset \
--server "cpanel.example.com" \
--username "admin" \
--api-key "your-api-key"# Create emails from CSV file
emoo cpanel create \
--server "cpanel.example.com" \
--username "admin" \
--api-key "your-api-key" \
--csv input/new-emails.csv# Migrate 10 accounts in parallel using Docker
emoo sync \
--csv input/migration-batch1.csv \
--parallel 10 \
--docker \
--log-dir ./logs/batch1# Test configuration without execution
emoo sync --dry-run --csv input/test-config.csv# Install imapsync locally or use Docker mode
emoo sync --dockerThe tool will automatically try 2 authentication methods:
- cPanel auth (
Authorization: cpanel username:apikey) - Basic auth (
Authorization: Basic)
Make sure the CSV file:
- Uses comma (
,) as separator - Has header row
- Required columns are available
- No empty rows in the middle of data
This project is licensed under the ISC License - see the LICENSE file for details.
