Automated email management system using n8n, Claude AI, Gmail API, and Google Sheets for categorization, tracking, and CAN-SPAM compliance.
This started as a test project but solved a real problem I kept hearing about - inboxes full of clutter where important emails get buried. Manually sorting, categorizing and unsubscribing from emails is one of those repetitive tasks that eats up time for no good reason. Automating it felt like the obvious solution.
The system handles everything automatically - categorizing incoming emails with AI, trashing spam, sending formal opt-out requests to violators, and logging everything for potential CAN-SPAM legal action. It's not going to make anyone rich, but it puts the law to good use and takes a genuinely tedious problem off your plate completely.
Built this to learn automation and AI integration. Ended up being more capable than expected.
- AI-Powered Categorization - Uses Claude AI to classify emails into SPAM, PROMOTIONAL, NEWSLETTER, RECEIPT, and IMPORTANT
- Automatic Sorting - Labels and archives emails based on category
- Spam Management - Automatically trashes spam and sends legally compliant opt-out emails
- CAN-SPAM Compliance - Sends formal opt-out requests and tracks 10-business-day response window
- Legal Documentation - Logs all sender activity with timestamps for potential legal action
- Sender Tracking - Monitors repeat offenders and tracks emails received after opt-out
- Bounce Detection - Automatically handles invalid address bounce-backs
- Daily Summary - Sends a daily email digest of all activity
- Bulk Cleaner - Separate workflow to process existing inbox backlog
- n8n - Workflow automation platform
- Anthropic Claude API - AI email categorization and unsubscribe extraction
- Gmail API - Email reading, sorting, and sending
- Google Sheets API - Data logging and tracking
- Google Cloud Console - OAuth2 authentication
Runs every hour, processes incoming emails in real time.
Manual trigger, processes existing inbox in batches of 50.
Runs at 12PM daily, sends email digest of all activity.
Tracks every email processed with date, sender, subject, category and action taken.
Monitors all senders with:
- Total emails received
- First and last contact dates
- Opt-out request date
- Emails received after opt-out
- Legal action status
This system is designed to enforce CAN-SPAM Act rights. Opt-out emails sent by this system constitute formal legal opt-out requests under 15 U.S.C. § 7704.
Jakoby Tuckta