File size: 2,278 Bytes
305fec8
 
 
 
 
7da71bc
 
 
305fec8
 
 
 
 
 
 
 
 
 
7da71bc
305fec8
7da71bc
305fec8
b96346f
 
 
 
 
305fec8
 
 
0a367ef
7da71bc
 
 
 
 
 
 
 
 
 
 
 
 
0a367ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Azure AD app registration credentials
AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_SECRET=your-client-secret-here

# UPN or object ID of the mailbox to monitor (required for app-only auth)
MAILBOX_USER=user@yourdomain.com

# Mail folder to monitor (top-level display name only; all others are ignored)
MAIL_FOLDER_NAME=Inbox

# Public HTTPS URL Graph API will POST webhook notifications to
# Must be reachable from the internet (use ngrok or a reverse proxy for local dev)
NOTIFICATION_URL=https://your-hostname.example.com/webhook/notify

# Graph subscription max lifetime in minutes (hard cap: 4230)
SUBSCRIPTION_EXPIRY_MINUTES=4230

# Server (TLS is terminated by the hosting provider, not uvicorn)
HOST=0.0.0.0
PORT=8000

# Number of uvicorn worker processes. Safe to scale ≥1 — the scheduler
# (cron jobs) and processor (poll loop) run in their own dedicated
# processes, so cron jobs won't fire N times per worker.
UVICORN_WORKERS=2

# Storage paths (volume-mounted)
DATABASE_PATH=/data/rcmemail.db
EMAIL_STORAGE_PATH=/emails
LOG_PATH=/logs

# Dropbox — confirm folder paths with ops/Hunter before going live
# App key + secret come from the Dropbox App Console (appinfo tab)
# Refresh token is generated once via scripts/dropbox_auth.py and stored here
DROPBOX_APP_KEY=your-app-key
DROPBOX_APP_SECRET=your-app-secret
DROPBOX_REFRESH_TOKEN=your-refresh-token
DROPBOX_PO_PATH=/RCM Supply/Inside Sales/POs
DROPBOX_INVOICE_PATH=/RCM Supply/Inside Sales/Invoices
DROPBOX_MTR_PATH=/RCM Supply/MTRs

# Processor poll interval in seconds
PROCESSOR_POLL_INTERVAL=10

# Document classification scoring weights (must sum to 1.0)
SCORE_WEIGHT_FILENAME=0.35
SCORE_WEIGHT_OCR=0.65

# Each additional keyword match beyond the first adds this fraction of the base weight
SCORE_FREQ_MULTIPLIER=0.10

# Minimum confidence score (0.0–1.0) required to route a document; below this it is skipped
SCORE_MIN_THRESHOLD=0.30

# Daily brief report — comma-separated recipient email addresses, sent at 6 PM Central
BRIEF_RECIPIENTS=email1@yourdomain.com,email2@yourdomain.com

# Developer alert — immediate email on infrastructure/system errors (no Mail ID context)
DEV_ALERT_RECIPIENTS=devteam@yourdomain.com