Skip to content

feat (core): add queue persistence, retention policies, and SMTP AUTH#20

Merged
Its-donkey merged 1 commit intomainfrom
feature/core/queue-auth-retention
Jan 4, 2026
Merged

feat (core): add queue persistence, retention policies, and SMTP AUTH#20
Its-donkey merged 1 commit intomainfrom
feature/core/queue-auth-retention

Conversation

@Its-donkey
Copy link
Owner

Type: feature
Section: core

Summary

Changes

Queue Persistence

  • New queue/persist.go: SaveQueue/LoadQueue functions
  • Queue state saved to queue.json in spool directory
  • Payloads rehydrated from stored .eml files on startup
  • FilePath field added to QueuedMessage

Spool Retention

  • New storage/retention.go: cleanup, stats, and listing functions
  • SMTP_RETENTION_DAYS env var (default 7)
  • Hourly background cleanup of expired directories
  • GetSpoolStats() and ListMessages() for inspection

SMTP AUTH

  • New internal/auth/ package with PLAIN/LOGIN support
  • SMTP_AUTH_USERS: comma-separated user:password pairs
  • SMTP_AUTH_INSECURE: allow AUTH without TLS (default false)
  • Authenticated users bypass domain restrictions
  • AUTH advertised in EHLO only when available

Test plan

  • All existing tests pass
  • New tests for queue persistence (save/load/missing files)
  • New tests for retention (cleanup, stats, listing)
  • New tests for auth (credential validation, PLAIN/LOGIN decoding)

Queue Persistence (Issue #9):
- Persist delivery queue state to disk (queue.json) so pending
  deliveries survive restarts
- Restore queue on startup with FilePath-based payload rehydration
- Add tests for persistence and missing file handling

Spool Retention (Issue #8):
- Add configurable retention via SMTP_RETENTION_DAYS (default 7)
- Automatic hourly cleanup of expired date directories
- Add GetSpoolStats() and ListMessages() for inspection
- Background cleanup goroutine with proper shutdown

SMTP AUTH (Issue #7):
- Implement AUTH PLAIN and LOGIN mechanisms
- Configure via SMTP_AUTH_USERS (user:pass,user2:pass2 format)
- Only advertise AUTH over TLS unless SMTP_AUTH_INSECURE=true
- Authenticated users bypass domain restrictions
- Constant-time password comparison

Documentation updates for all new environment variables.
@chatgpt-codex-connector
Copy link

The account who enabled Codex for this repo no longer has access to Codex. Please contact the admins of this repo to enable Codex again.

@Its-donkey Its-donkey merged commit e49eddf into main Jan 4, 2026
1 check passed
@Its-donkey Its-donkey deleted the feature/core/queue-auth-retention branch January 4, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant