Skip to content

3.0.0-pre#12

Merged
toomore merged 19 commits into
mainfrom
pre-3.0.0
Mar 27, 2026
Merged

3.0.0-pre#12
toomore merged 19 commits into
mainfrom
pre-3.0.0

Conversation

@toomore

@toomore toomore commented Feb 16, 2025

Copy link
Copy Markdown
Owner

New features:

  • Format email.
  • Send with plain content.
  • Unsubscribe processing.

Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
Signed-off-by: Toomore Chiang <toomore0929@gmail.com>
@toomore toomore self-assigned this Feb 16, 2025
toomore and others added 10 commits February 8, 2026 02:30
Phase 1 - DB connection management:
- Make GetConn() singleton with sync.Once
- Lower MaxOpenConns from 1024 to 50, add MaxIdleConns(10)
- Remove conn.Close() from mails.filteratags (was closing shared pool)

Phase 2 - SQL security and concurrency:
- Parameterize send uid query, validate with strconv.Atoi
- Use Exec with placeholders in campaign.Create
- Add serverlinksCacheMu RWMutex for serverlinksCache

Phase 3 - Error handling:
- FormatEmail: guard against invalid email (no @) to prevent panic
- GetSeed: check rows != nil before defer rows.Close()

Also: remove unused fmt import from cmd/send.go,
add TestFormatEmailInvalid for edge case coverage

Co-authored-by: Cursor <cursoragent@cursor.com>
… lock

- Add rows.Close() after links query in door() to prevent connection leak
- Add defer userrows.Close() in washi() for user query
- Apply double-check locking for serverlinksCache to reduce DB thundering herd
  when multiple goroutines request same missing cache key

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add defer rows.Close() in updateUser to fix connection leak per iteration
- Add rows.Close() in filteratags fallback SELECT to fix goroutine leak
- Add rows != nil check before defer in send for defensive safety
- Add getDSN() to support MAILBOX_DB_DSN env for configurable DSN

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add bilingual sections (中文/English) for overview, quick start, install
- Include full env vars table with MAILBOX_DB_DSN
- Document complete CLI commands (campaign, user, send, server)
- Add template tags and Nginx config tables
- Remove deprecated Travis/Coveralls badges

Co-authored-by: Cursor <cursoragent@cursor.com>
- Change gendoc output from ./ to ./cmd/docs for predictable output
- Regenerate all cobra docs (mailbox doc) with current command tree
- Fix cmd/README.md: mailbox sender -> mailbox send

Co-authored-by: Cursor <cursoragent@cursor.com>
- security: add match nil check in server.go door() to prevent panic
- ci: upgrade actions/checkout to v4, add go vet, use coverage in workflow
- goclean: simplify to vet + test + cover report (no merge logic)
- reader: add error handling in Save(), use Exec instead of Query
- reader: add reader_test.go smoke test
- build: ignore cmd/docs/mailbox_completion*.md, remove from tracking

Co-authored-by: Cursor <cursoragent@cursor.com>
- go.mod: go 1.25, toolchain go1.25.7
- CI: go-version '1.25' in go.yml
- Docker: golang:1.25-alpine3.22 (Dockerfile, build-base, dev-run-docker)
- deps: aws-sdk-go v1.55.8, mysql v1.9.3, cobra v1.10.2, viper v1.21.0

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Phase 1 of unsubscribe mechanism: enable mail clients to show
built-in unsubscribe button via List-Unsubscribe mailto header,
and provide CLI tools for manual recipient opt-out.

- Switch SES from SendEmail to SendRawEmail to support custom headers
- Add List-Unsubscribe / List-Unsubscribe-Post headers (env-driven)
- Add `user unsubscribe` command for single/batch marking (alive=0)
- Add `user unsubscribed` command to list opted-out recipients
- Update README with new env vars and Phase 1 workflow docs

Made-with: Cursor
- filippo.io/edwards25519 v1.1.0 → v1.2.0
- pelletier/go-toml/v2 v2.2.4 → v2.3.0
- golang.org/x/sys v0.40.0 → v0.42.0
- golang.org/x/text v0.33.0 → v0.35.0

Made-with: Cursor
@toomore
toomore merged commit 9e932ec into main Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant