EmailOS Unsubscribe Command Documentation
The mailos unsubscribe command finds and manages unsubscribe links in your email messages, helping you efficiently unsubscribe from unwanted mailing lists.
Basic Usage
bash
mailos unsubscribe [flags]Searches through your emails to find unsubscribe links and provides options to manage them.
Command-Line Flags
Basic Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--account | string | Email account to use | mailos unsubscribe --account value | ||
--from | string | Find unsubscribe links from sender(s) - comma-separated for batch processing | mailos unsubscribe --from value | ||
--number | -n | int | 10 | Number of emails to check per sender | mailos unsubscribe --number value |
--subject | string | Find unsubscribe links by subject | mailos unsubscribe --subject value |
Advanced Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--auto-open | bool | false | Automatically open unsubscribe link without prompting | mailos unsubscribe --auto-open | |
--delete | bool | false | Delete emails after finding unsubscribe links | mailos unsubscribe --delete | |
--move-to-folder | bool | false | Move emails with unsubscribe links to dedicated IMAP folder | mailos unsubscribe --move-to-folder | |
--open | bool | false | Open the first unsubscribe link in browser | mailos unsubscribe --open | |
--quiet | -q | bool | false | Minimal output - only show count of emails found | mailos unsubscribe --quiet |
Output Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--dry-run | bool | false | Show what would be deleted without actually deleting | mailos unsubscribe --dry-run | |
--json | bool | false | Output results as JSON for programmatic use | mailos unsubscribe --json |
Features
Intelligent Link Detection
The command uses multiple detection methods to find unsubscribe links:
- Header-based: Checks RFC 2369/8058
List-Unsubscribeheaders - URL patterns: Searches for common unsubscribe URL patterns
- Link text analysis: Finds links with unsubscribe-related text
- Service-specific: Recognizes patterns from popular email services (MailChimp, SendGrid, etc.)
Supported Email Services
Optimized detection for major email marketing platforms:
- Beehiiv
- MailChimp
- SendGrid
- ConvertKit
- Constant Contact
- Campaign Monitor
- AWeber
- GetResponse
- ActiveCampaign
- HubSpot
- Pardot
- Marketo
Usage Examples
Basic Search
bash
# Find unsubscribe links in last 10 emails
mailos unsubscribe
# Check more emails
mailos unsubscribe --number 50Targeted Search
bash
# Find links from specific sender
mailos unsubscribe --from "[email protected]"
# Search by subject pattern
mailos unsubscribe --subject "Weekly Update"Email Management
bash
# Move emails with unsubscribe links to dedicated folder
mailos unsubscribe --move-to-folder
# Automatically open first unsubscribe link found
mailos unsubscribe --auto-openCombined Operations
bash
# Find, organize, and open unsubscribe links
mailos unsubscribe --from "[MARKETING_SENDER]" --move-to-folder --openOutput Format
The command provides a detailed report showing:
- Email sender and subject
- All unsubscribe links found
- Count of emails processed
Example output:
Searching for unsubscribe links...
Found unsubscribe links in 3 emails:
1. From: [email protected]
Subject: Weekly Newsletter - October 2024
Unsubscribe links:
- https://example.com/unsubscribe?id=12345
- https://example.com/[email protected]
2. From: [MARKETING_SENDER]
Subject: Special Offer Inside!
Unsubscribe links:
- https://store.com/opt-out?token=abcdefFolder Management
When using --move-to-folder, the command:
- Creates an "Unsubscribe" folder if it doesn't exist
- Moves all emails containing unsubscribe links to this folder
- Provides feedback on the number of emails moved
Safety and Privacy
- Read-only scanning: The command only reads email content for analysis
- No automatic actions: Requires explicit flags for actions like opening links or moving emails
- User confirmation: Interactive prompts for potentially destructive actions
- Clean URL extraction: Removes tracking parameters and validates URLs
Integration with Other Commands
The unsubscribe command works well with other EmailOS features:
bash
# First search and organize
mailos unsubscribe --move-to-folder
# Then read the organized emails
mailos read --folder "Unsubscribe"
# Generate statistics on unsubscribe patterns
mailos stats --folder "Unsubscribe"Tips and Best Practices
- Regular cleanup: Run
mailos unsubscribe --move-to-folderregularly to keep your inbox organized - Bulk processing: Use higher
--numbervalues for thorough cleanup sessions - Targeted cleanup: Use
--fromfilters when dealing with specific senders - Safe browsing: Review unsubscribe links before opening them, especially from unknown senders
Troubleshooting
No Links Found
- Try increasing
--numberto check more emails - Use
--fromor--subjectfilters to target specific emails - Some emails may use non-standard unsubscribe methods
Browser Opening Issues
- Ensure your system has a default web browser configured
- Use
--openfor interactive confirmation instead of--auto-open - Copy and paste links manually if automatic opening fails
IMAP Folder Issues
- Verify your email provider supports IMAP folder creation
- Check that you have write permissions for your email account
- Some providers may have folder name restrictions
