← back to Dw Pitch Followup
scripts/scan-unsubscribes.sh
9 lines
#!/bin/sh
# Auto-honor client UNSUBSCRIBE replies to info@ (CAN-SPAM compliance) on a schedule.
# Hits the pitch-viewer's tightened scanner with ?apply=1 so genuine opt-outs are suppressed.
# The scanner is conservative (replies TO info@, opt-out phrase at the START) so false
# positives are unlikely; every run is logged so a mistake is auditable + reversible.
LOG="$HOME/Library/Logs/dw-pitch-unsub-scan.log"
RESP=$(curl -s --max-time 25 "http://127.0.0.1:9768/api/scan-unsubscribes?apply=1")
echo "$(date '+%Y-%m-%dT%H:%M:%S') $RESP" >> "$LOG"