Files
youlu-openclaw-workspace/scripts/email_processor/email-processor.sh
Yanxin Lu 3c54098b1d Remove scan_index, use envelope_id (IMAP UID) as single identifier
scan_index created confusion for the OpenClaw agent which would
sometimes reference emails by scan_index and sometimes by envelope_id.
Since himalaya's envelope ID is an IMAP UID (stable, never recycled),
it works as the sole identifier for review commands.
2026-03-07 22:01:02 -08:00

22 lines
978 B
Bash
Executable File

#!/usr/bin/env bash
# email-processor — wrapper script for the email processor.
#
# Usage:
# ./email-processor.sh scan # classify unseen emails
# ./email-processor.sh scan --recent 30 # last 30 days
# ./email-processor.sh scan --dry-run # classify only, no changes
# ./email-processor.sh scan --recent 7 --dry-run # combine both
# ./email-processor.sh review list # show pending queue
# ./email-processor.sh review 93 delete # act on envelope 93
# ./email-processor.sh review all delete # act on all pending
# ./email-processor.sh review accept # accept all suggestions
# ./email-processor.sh stats # show history stats
#
# Requires: uv, himalaya, Ollama running with model.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
exec uv run --project "$SCRIPT_DIR" python "$SCRIPT_DIR/main.py" "$@"