- Replace GotifyNotifier with NtfyNotifier for push notifications - Add support for sending email image attachments to ntfy - Add NTFY_URL, NTFY_TOKEN, NTFY_TOPIC environment variables - Add get_mailpit_image() and get_mailpit_image_thumb() helpers - Sanitize message content for HTTP headers (remove newlines) - Remove all gotify references 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.0 KiB
2.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Sneaky Mon is an email-to-notification bridge that receives webhooks from Mailpit (local email service) and forwards emails as push notifications to Gotify or Ntfy. Designed for monitoring system-generated emails (e.g., IoT camera motion alerts) on secure internal networks.
Commands
Development
# Setup virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run Flask server (listens on 0.0.0.0:8088)
python app/main.py
# Test with hardcoded message ID
python app/dev_main.py
Docker
# Start services (Mailpit + webhook handler)
docker-compose up -d
# View logs
docker-compose logs -f sneaky_mon_webhook
# Build and push image
./build_push_image.sh
Architecture
Email Sources → Mailpit (SMTP:1025, API:8025) → Sneaky Mon (POST /hook) → Ntfy/Gotify
Data Flow:
- Email arrives at Mailpit SMTP
- Mailpit triggers webhook to
/hookendpoint - Flask app fetches full message from Mailpit API
- Extracts subject/content, creates notification
- Sends to Ntfy or Gotify
Key Files
app/main.py- Flask app with/hookwebhook endpoint and core logicapp/utils/gotify_api.py- GotifyNotifier class for Gotify integrationapp/utils/ntfy_api.py- NtfyNotifier class for Ntfy integrationdocker-compose.yaml- Orchestrates Mailpit and webhook services
Configuration
All configuration via environment variables (see .env.example):
MAILPIT_API/MAILPIT_TOKEN- Mailpit REST API accessNTFY_URL/NTFY_TOKEN/NTFY_TOPIC- Ntfy notification service (primary)GOTIFY_URL/GOTIFY_TOKEN- Gotify notification service (legacy, optional)LOG_LEVEL- Logging verbosity
Current State Notes
- Project uses Ntfy for push notifications with image attachment support
- Application intentionally lacks TLS/auth - designed for isolated internal VLANs