Python-based toolbox for managing Outlook data, duplicate detection, and statistics.
- Windows 10/11
- Python 3.8+
- Microsoft Outlook installed
- pywin32 (installed automatically)
cd outlook-toolbox
pip install -r requirements.txtpython main.py accountspython main.py folders
python main.py folders -a "Account Name"python main.py stats
python main.py stats -a "Account1" "Account2"python main.py scan-dups
python main.py scan-dups -a "Account1" "Account2"
python main.py scan-dups -t emails calendar
python main.py scan-dups -a "Account1" -f "Account1/Folder/Path" -t calendarpython main.py remove-dups -a "Account1" -t calendar --dry-run
python main.py remove-dups -a "Account1" -f "Account1/Folder/Path" -t calendar -r --dry-run
python main.py remove-dups -a "Account1" -t calendar --no-dry-run
python main.py remove-dups -a "Account1" -t calendar --keep-oldestpython main.py merge --source-account "Account1" --source-folder "Kalender/Eva" --target-account "Account1" --target-folder "Kalender/Merged" -t calendar --dry-run
python main.py merge --source-account "Account1" --source-folder "Inbox" --target-account "Account2" --target-folder "Inbox" -t emails -r --dry-run
python main.py merge --source-account "Account1" --source-folder "Kontakte" --target-account "Account1" --target-folder "Kontakte/Merged" -t contacts --no-dry-run# Verify emails from multiple source accounts
python main.py verify-migration --source "Account1:Inbox" --source "Account2:Inbox" --target-account "Account3" --target-root "Inbox" -t emails
# Verify calendar with recursive subfolders
python main.py verify-migration --source "Account1:Kalender" --source "Account2:Kalender" --target-account "Account3" --target-root "Kalender" -t calendar -r
# Verify contacts from single source
python main.py verify-migration --source "Account1:Kontakte" --target-account "Account2" --target-root "Kontakte" -t contactsFolder Structure Examples:
For emails:
- Root folder:
Inbox,Sent Items,Drafts - With subfolders:
Inbox/Project1,Inbox/Project1/Subfolder
For calendar:
- Root folder:
Kalender,Calendar - With subfolders:
Kalender/Eva,Kalender/Work,Kalender/Work/Meetings
For contacts:
- Root folder:
Kontakte,Contacts - With subfolders:
Kontakte/Personal,Kontakte/Business
Example scenario:
Source Accounts:
Account1 (Live): Inbox/
├── Project1/
└── Project2/
Account2 (Migration): Inbox/
├── Archive/
└── Old/
Target Account:
Account3 (Merged): Inbox/
├── Project1/ (from Account1)
├── Project2/ (from Account1)
├── Archive/ (from Account2)
└── Old/ (from Account2)
Command:
python main.py verify-migration \
--source "Account1:Inbox" \
--source "Account2:Inbox" \
--target-account "Account3" \
--target-root "Inbox" \
-t emails -r
# Dry-run: show what would be migrated
python main.py migrate --source "Account1:Inbox" --source "Account2:Inbox" --target-account "Account3" --target-root "Inbox" -t emails --dry-run
# Migrate emails from multiple source accounts
python main.py migrate --source "Account1:Inbox" --source "Account2:Inbox" --target-account "Account3" --target-root "Inbox" -t emails --no-dry-run
# Migrate calendar with recursive subfolders
python main.py migrate --source "Account1:Kalender" --source "Account2:Kalender" --target-account "Account3" --target-root "Kalender" -t calendar -r --no-dry-run
# Migrate contacts from single source
python main.py migrate --source "Account1:Kontakte" --target-account "Account2" --target-root "Kontakte" -t contacts --no-dry-runMigration features:
- Copies items from multiple source accounts to target account
- Maintains folder structure in target account
- Automatically creates missing folders in target
- Skips duplicate items (uses duplicate detection)
- Supports recursive migration of subfolders
# Scan entire account for empty folders
python main.py scan-empty-folders -a "Account1"
# Scan specific root folder
python main.py scan-empty-folders -a "Account1" --root-folder "Inbox"
# Scan specific folder types only
python main.py scan-empty-folders -a "Account1" -t emails calendar
# Non-recursive scan (only root folder, no subfolders)
python main.py scan-empty-folders -a "Account1" --root-folder "Inbox" --no-recursive# Dry-run: show what would be removed
python main.py remove-empty-folders -a "Account1" --dry-run
# Remove empty folders (with confirmation)
python main.py remove-empty-folders -a "Account1" --no-dry-run
# Remove from specific root folder
python main.py remove-empty-folders -a "Account1" --root-folder "Inbox" --no-dry-run
# Remove only specific folder types
python main.py remove-empty-folders -a "Account1" -t emails calendar --no-dry-run# Sync entire account folder structure
python main.py fetch -a "Account1"
# Sync specific root folder
python main.py fetch -a "Account1" --root-folder "Inbox"
# Sync specific folder types only
python main.py fetch -a "Account1" -t emails calendar
# Non-recursive (only root folder)
python main.py fetch -a "Account1" --root-folder "Inbox" --no-recursiveWhat it does:
- Scans all folders recursively in the specified account
- Reports folder structure and item counts
- Does NOT download or export items
- Useful for verifying folder structure and getting statistics