Manage emails across multiple Gmail accounts with unified tooling. Use when user asks to check email, read inbox, label emails, archive messages, or manage Gmail across accounts.
Check and manage emails across multiple Gmail accounts using unified tooling.
./scripts/gmail_unified.py - Check and manage inboxes./scripts/gmail_multi_auth.py - Authenticate accounts./scripts/gmail_bulk_label.py - Bulk labeling./scripts/gmail_create_filters.py - Create filters./scripts/gmail_auth.py - Auth helper# Check unread across all accounts
python3 ./scripts/gmail_unified.py --query "is:unread" --limit 50
# Check specific account only
python3 ./scripts/gmail_unified.py --query "is:unread" --account yourcompany
# List registered accounts
python3 ./scripts/gmail_unified.py --accounts
# Label and archive emails
python3 ./scripts/gmail_unified.py --query "from:notifications@" --label "Notifications" --archive
# Mark as read
python3 ./scripts/gmail_unified.py --query "from:noreply@" --mark-read
# Dry run (preview)
python3 ./scripts/gmail_unified.py --query "subject:invoice" --label "Invoices" --dry-run
| Account | Credentials | Token | |
|---|---|---|---|
| youruser | [email protected] | credentials.json | token_youruser.json |
| yourcompany | [email protected] | credentials_yourcompany.json | token_yourcompany.json |
"Token file not found"
python3 ./scripts/gmail_multi_auth.py --account yourcompany --email [email protected]
"invalid_scope: Bad Request"
rm token_youruser.json
python3 ./scripts/gmail_multi_auth.py --account youruser --email [email protected]
"Failed to authenticate" Check that credentials.json exists in root directory.
gmail.modify - Read/write emailsgmail.labels - Create/manage labelsgmail.settings.basic - Manage settingsspreadsheets - Google Sheets accessdrive - Google Drive accessAll credential files should be in the workspace root:
credentials.json / credentials_yourcompany.json - OAuth client configstoken_*.json - Auth tokens (auto-generated)gmail_accounts.json - Account registry