EmailOS Setup Command Documentation
The mailos setup command provides a guided wizard for initial EmailOS configuration, setting up your email account for the first time.
Basic Usage
mailos setupLaunches the interactive setup wizard.
Setup Process
Step 1: Welcome
- Introduction to EmailOS
- Overview of setup process
- Requirements checklist
Step 2: Email Provider Selection
Choose from supported providers:
- Gmail
- Outlook/Hotmail
- Yahoo Mail
- iCloud Mail
- ProtonMail
- Fastmail
- Custom (manual configuration)
Step 3: Email Credentials
Enter your:
- Email address
- App-specific password (not regular password)
Step 4: Test Connection
Automatic testing of:
- SMTP connection (sending)
- IMAP connection (receiving)
- Credential validation
Step 5: Optional Configuration
- Display name
- Custom sender address
- AI provider selection (claude-code, openai, gemini, etc.)
- Profile image (used in email templates with )
- Interactive mode preference
Step 6: Confirmation
- Review settings
- Save configuration
- Create README file
App Password Setup
Most email providers require app-specific passwords when using third-party applications like MailOS. These are special passwords that allow secure access without exposing your main account password.
When you need app passwords:
- When MailOS asks for your email password during setup
- If you see authentication errors when trying to send/receive emails
- When your email provider has two-factor authentication enabled
Important: Use the generated app password (not your regular email password) when configuring MailOS.
Gmail App Passwords
Requirements: Two-factor authentication must be enabled on your Google account.
Setup:
- Visit: https://myaccount.google.com/apppasswords
- Select "Mail" from the app dropdown
- Select your device type
- Click "Generate" to create a 16-character app password
- Use this password (not your regular Google password) when setting up MailOS
- Enable IMAP:
- Gmail Settings → Forwarding and POP/IMAP
- Enable IMAP
Guide: https://support.google.com/mail/answer/185833
Fastmail App Passwords
Setup:
- Visit: https://app.fastmail.com/settings/security/apps
- Click "New App Password"
- Enter a name for the application (e.g., "MailOS")
- Click "Generate password"
- Copy the generated password for use with MailOS
Guide: https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords
Outlook/Hotmail App Passwords
Requirements: Two-factor authentication must be enabled on your Microsoft account.
Setup:
- Visit: https://account.live.com/proofs/AppPassword
- Click "Create a new app password"
- Copy the generated 16-character password
- Use this password when configuring MailOS
Yahoo Mail App Passwords
Requirements: Two-factor authentication must be enabled on your Yahoo account.
Setup:
- Visit the Yahoo app password generation page: https://login.yahoo.com/myaccount/security/app-password-generate
- Enter a name for the app (e.g., "MailOS")
- Click "Generate password"
- Copy the 16-character code (you'll only see this once)
- Use this password when configuring MailOS
Direct link: https://login.yahoo.com/myaccount/security/app-password-generate
Guide: https://help.yahoo.com/kb/SLN15241.html
Zoho Mail App Passwords
Requirements: Two-factor authentication must be enabled on your Zoho account.
Setup:
- Sign in to https://accounts.zoho.com
- Go to My Account → Security → App Passwords
- Click "Generate New Password"
- Enter a name for the application
- Click "Generate"
- Copy the 16-character password (displayed only once)
Additional: Ensure IMAP is enabled in your Zoho Mail settings under Mail Accounts → IMAP.
iCloud Mail App Passwords
Requirements: Two-factor authentication must be enabled on your Apple ID account.
Setup:
- Visit: https://appleid.apple.com/account/manage
- Sign in with your Apple ID
- Go to "Security" section
- Under "App-Specific Passwords", click "Generate Password..."
- Enter a label for the password (e.g., "EmailOS")
- Click "Create"
- Copy the generated 16-character password (shown only once)
- Use this password when configuring MailOS
Guide: https://support.apple.com/HT204397
Note: iCloud Mail supports @icloud.com, @me.com, and @mac.com email addresses.
ProtonMail Setup
ProtonMail integration requires special setup due to its security architecture. EmailOS currently supports SMTP-only sending for ProtonMail.
Option 1: SMTP Token (Custom Domains Only)
For custom domain emails hosted on ProtonMail:
Generate SMTP Token:
- Log into your ProtonMail account
- Go to Settings > Security
- Generate an SMTP submission token for your custom domain
- Note: This only works with custom domains, not @proton.me addresses
Configure EmailOS:
bashmailos setup --provider=protonmail --email=[YOUR_CUSTOM_DOMAIN]- Use your custom domain email address
- Enter the SMTP token as the password when prompted
Option 2: ProtonMail Bridge (Full Integration)
For complete IMAP/SMTP access including @proton.me addresses:
Requirements:
- ProtonMail Plus, Professional, or Visionary subscription
- ProtonMail Bridge desktop application
Install Bridge:
- Download from: https://proton.me/mail/bridge
- Install and set up with your ProtonMail credentials
- Bridge creates local IMAP/SMTP servers
Configure EmailOS:
bash# Auto-detects ProtonMail provider from @proton.me domain mailos setup --email=[YOUR_PROTON_ADDRESS] # Or explicitly specify provider mailos setup --provider=protonmail --email=[YOUR_PROTON_ADDRESS]- EmailOS automatically detects ProtonMail from @proton.me, @protonmail.com, and @protonmail.ch domains
- Use the Bridge-generated password (not your ProtonMail password)
- Bridge must be running for email operations
Limitations
- SMTP Only: Current implementation supports sending emails only
- No IMAP: Email reading/syncing not supported yet
- Bridge Dependency: Full features require ProtonMail Bridge for @proton.me addresses
Automatic Provider Detection
EmailOS can automatically detect your email provider based on your email domain, simplifying the setup process.
Supported Auto-Detection
When you provide only an email address, EmailOS will automatically detect:
- Gmail:
@gmail.com,@googlemail.com - Fastmail:
@fastmail.com,@fm.fastmail.com - Outlook/Hotmail:
@outlook.com,@hotmail.com,@live.com - Yahoo Mail:
@yahoo.com,@yahoo.co.uk, etc. - Zoho Mail:
@zoho.com,@zohomail.com - iCloud Mail:
@icloud.com,@me.com,@mac.com - ProtonMail:
@proton.me,@protonmail.com,@protonmail.ch
Usage Examples
# Auto-detects Gmail
mailos setup --email=[GMAIL_ADDRESS]
# Auto-detects ProtonMail
mailos setup --email=[PROTON_ADDRESS]
# Auto-detects Fastmail
mailos setup --email=[FASTMAIL_ADDRESS]
# Auto-detects iCloud Mail
mailos setup --email=[ICLOUD_ADDRESS]
# Manual override (if auto-detection is incorrect)
mailos setup --email=[CUSTOM_DOMAIN_ADDRESS] --provider=fastmailCustom Domain Detection
For custom domains, EmailOS attempts to detect the provider using:
- MX Record Analysis: Checks DNS MX records for provider signatures
- Domain Patterns: Looks for known hosting patterns
- Fallback: Defaults to Fastmail for unknown custom domains
Interactive Confirmation
When auto-detection occurs, you'll see:
✓ Auto-detected provider: ProtonMail (SMTP Only) (via domain)
Use this provider? (Y/n):You can accept the detection or choose to select manually.
Custom Provider Setup
For unlisted providers, you'll need:
Required Information
- SMTP server hostname
- SMTP port (usually 587, 465, or 25)
- SMTP security (TLS/SSL/None)
- IMAP server hostname
- IMAP port (usually 993 or 143)
- IMAP security (TLS/SSL/None)
Common Settings
| Provider | SMTP Server | SMTP Port | IMAP Server | IMAP Port |
|---|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | imap.gmail.com | 993 |
| Outlook | smtp-mail.outlook.com | 587 | outlook.office365.com | 993 |
| Yahoo | smtp.mail.yahoo.com | 587 | imap.mail.yahoo.com | 993 |
| iCloud | smtp.mail.me.com | 587 | imap.mail.me.com | 993 |
First-Time Setup
Prerequisites
- Email account with IMAP enabled
- 2FA enabled (recommended)
- App-specific password generated
- Internet connection
Quick Start
# Install EmailOS (if not already installed)
npm install -g @emailos/mailos
# Run setup
mailos setup
# Follow the promptsVerification
After setup, verify with:
# Check configuration
mailos info
# Test email reading
mailos read -n 1
# Test email sending
mailos send --to [TEST_RECIPIENT] --subject "Test" --body "Test message"Configuration Files
Setup creates:
Global Configuration
~/.email/config.json
- Main configuration file
- Encrypted credentials
- Provider settings
README File
~/.email/README.md
- Configuration documentation
- Troubleshooting guide
- Security notes
Directory Structure
~/.email/
├── config.json # Main configuration
├── README.md # Documentation
├── template.html # Email template (optional)
├── .slash_config.json # Slash command preferences
└── cache/ # Email cache (created on use)Security Considerations
Password Security
- Never use your main account password
- Always use app-specific passwords
- Passwords are stored locally only
- File permissions set to 600 (owner only)
Best Practices
- Enable 2FA on email account
- Use unique app passwords
- Regularly rotate passwords
- Don't share configuration files
- Add
.email/to.gitignore
Troubleshooting Setup
Common Issues
"Authentication Failed"
- Verify app password is correct
- Check 2FA is enabled
- Ensure IMAP/SMTP is enabled
- Try regenerating app password
"Connection Timeout"
- Check internet connection
- Verify firewall settings
- Try different ports
- Check VPN/proxy settings
"Invalid Provider"
- Use exact provider name
- Check spelling
- Use "custom" for unlisted providers
"Permission Denied"
- Check file permissions
- Ensure write access to home directory
- Run without sudo
Reset Configuration
# Remove existing configuration
rm -rf ~/.email
# Run setup again
mailos setupManual Configuration
If setup fails, create manually:
mkdir -p ~/.email
cat > ~/.email/config.json << 'EOF'
{
"provider": "gmail",
"email": "[YOUR_GMAIL_ADDRESS]",
"password": "your-app-password"
}
EOF
chmod 600 ~/.email/config.jsonMultiple Accounts
Primary Account
mailos setup
# Sets up global default accountSecondary Accounts
# Create project-specific configuration
cd my-project
mailos configure --localAccount Switching
# Use global account
mailos read
# Use local account (in project directory)
cd my-project
mailos readAdvanced Setup Options
Environment Variables
Override setup with environment:
export MAILOS_PROVIDER=gmail
export MAILOS_EMAIL=[email protected]
export MAILOS_PASSWORD=app-password
mailos setupAutomated Setup
For scripted installation:
mailos setup --non-interactive \
--provider gmail \
--email [email protected] \
--password "app-password"Import Configuration
# Copy from another machine
scp other-machine:~/.email/config.json ~/.email/
chmod 600 ~/.email/config.jsonPost-Setup
Recommended Next Steps
- Test email reading:
mailos read -n 5 - Configure template:
mailos template - Create local config:
mailos local
Useful Commands
# View configuration
mailos info
# Configure AI provider
mailos provider
# Test email system
mailos test
# Read recent emails
mailos read
mailos read --json # JSON output
# Send test email
mailos send --to [email protected] --subject "Test" --body "Hello"
mailos send --plain --file message.txt # Send plain text from file
# Interactive mode
mailos interactive # Classic UI
mailos chat # AI chat interface
# View email statistics
mailos stats --days 30 # With visual chartsMigration from Other Clients
From Gmail Web
- Export is not needed
- EmailOS connects directly via IMAP
- All emails remain on server
From Outlook
- No migration needed
- Uses existing email account
- Maintains folder structure
From Thunderbird
- Copy SMTP/IMAP settings
- Use same app password
- Folders sync automatically
Getting Help
Resources
- Documentation:
mailos help - GitHub Issues: https://github.com/anduimagui/emailos
- Community Forum: https://email-os.com/forum
Support Commands
# Check system
mailos test
# View logs
mailos --debug
# Get version
mailos --version