Date: 2026-05-25. Type: Workflow. Project: Operations. Status: Complete. Priority: High.
Sam Outlook 365 mailbox hit storage cap. New mail blocked. Goal: free space fast. Two firm priorities up front: empty Junk Email, empty Deleted Items. Then find other big storage hogs and report; no deletion without approval.
Goal evolved mid-session. After report delivered, Sam approved deleting everything dated before 2025-11-01 across the recommended hog folders. Did that too. End goal now broader: keep mailbox leaner + more organized.
Connected to mailbox via MS Graph API, client-credentials OAuth flow. App = "Sam Outlook Knowledge Review". Browser (outlook.office.com via Chrome MCP) used for folder Empty actions; Graph API used for everything else.
Step 1 - Junk Email: emptied via browser right-click Empty. 10 items gone.
Step 2 - Deleted Items: emptied via browser. 5,011 items, ~1,062 MB gone.
Step 3 - storage audit via Graph: pulled all folder sizes + item counts. Found big hogs. Reported to Sam, no deletion.
Step 4 - after Sam approval, purged all items dated before 2025-11-01 from: Sent Items, CallRail Calls, Alert Call Center, SpeedAI, Dashboards from Nate, KJA Listserve, NSL - Derby City Squash. Clutter already auto-cleared by Outlook 30-day rule. ~31,400 messages deleted total. ~6 GB freed.
Method: Python script. Graph $batch endpoint, DELETE 20 messages per request. Filter receivedDateTime lt 2025-11-01 (or sentDateTime for Sent Items). Paginate IDs 100 per page, then batch-delete.
$count with ConsistencyLevel: eventual header.$select failed 400 when $ mishandled in shell. Workaround: drop $select, run query in Python heredoc.$orderby=size plus $filter=hasAttachments on messages: 400 InefficientFilter. Workaround: used $search KQL (size>10000000) to find big mail.