Skip to main content

Spam-Digest configuration

Environment variables​

Mailbox (single-mailbox mode)​

VariableDefaultDescription
IMAP_SERVERnoneIMAP hostname. Required unless MAILBOX_CONFIGS is set.
IMAP_PORT993IMAP port.
IMAP_USE_SSLtruefalse to connect without SSL/TLS.
EMAIL_USERnoneIMAP username. Required.
EMAIL_PASSnoneIMAP password. Required.
EMAIL_ADDRESSEMAIL_USERMailbox identifier in the digest, dashboard and links.
SPAM_FOLDERJunkSpam folder name. Common aliases are tried if it doesn't exist.
MAX_EMAILS100Newest emails read per run.
DIGEST_TOEMAIL_ADDRESSDigest recipient.
MAILBOX_CONFIGSnoneJSON array for multi-mailbox mode (see Deployment).

Email delivery​

VariableDefaultDescription
EMAIL_PROVIDERsmtpsmtp or resend.
SMTP_HOSTnoneSMTP hostname. Required with smtp.
SMTP_PORT587465 uses implicit SSL, any other port uses STARTTLS.
SMTP_USER / SMTP_PASSnoneSMTP credentials (login is skipped if either is empty).
RESEND_API_KEYnoneResend API key (re_...). Required with resend.
DIGEST_FROMSMTP_USERSender: a bare address or Name <address>. Required with Resend, on a verified domain (or onboarding@resend.dev for tests).
SEND_IF_EMPTYfalseSend a digest even when the spam folder is empty.

AI​

VariableDefaultDescription
AI_PROVIDERnoneanthropic to enable AI triage.
AI_API_KEYnoneAnthropic API key. Required with anthropic.
AI_MODELclaude-haiku-5-5Claude model used for classification.
AI_MAX_EMAILS50Maximum emails sent to the AI per run, across all mailboxes. The rest appear as Not classified.

Schedule and web​

VariableDefaultDescription
SCHEDULE_MIN0Cron minute.
SCHEDULE_HOUR8Cron hour.
SCHEDULE_DAY*Cron weekday: * every day, 0 Sunday … 6 Saturday. Ranges and lists (1-5, 1,3) work too.
RUN_ON_STARTfalseAlso run a digest when the container starts.
TZUTCContainer timezone, used by the schedule and timestamps.
WEB_PORT8080Port of the dashboard inside the container. Must be 1024 or higher (the web server doesn't run as root); change the host port with the ports mapping instead.
WEB_BASE_URLnonePublic address of the dashboard, e.g. https://spamdigest.example.com. Without it the digest has no review, filters or delete links.
DASHBOARD_PASSnoneTurns on an HTTP Basic login for the dashboard and its buttons. The review, filters and delete pages keep working from the digest links without it.
DASHBOARD_USERadminUsername for the dashboard login (used only with DASHBOARD_PASS).

Email delivery​

SMTP (default)​

EMAIL_PROVIDER=smtp
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=you@example.com
SMTP_PASS=your-smtp-password
DIGEST_FROM=Spam Digest <spam-digest@example.com>

Resend​

Resend sends over HTTPS with just an API key, no SMTP server needed. Resend sees the envelope and content of the digest.

EMAIL_PROVIDER=resend
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxx
DIGEST_FROM=Spam Digest <digest@yourdomain.com>

DIGEST_FROM must be on a domain verified in Resend (SPF and DKIM records). The free tier is plenty for a personal digest.