mirror of
https://github.com/sneakybugmaster/mailsender.git
synced 2026-11-10 19:48:49 +00:00
Scaffold PGP mail modules with WKD key discovery and demo app
- Maven multi-module build on JDK 27 and Spring Boot 4.1.1 (BOM import) - core: WKD discovery (advanced -> direct fallback), HTTP fetcher with timeouts, no redirects and a size limit, Caffeine cache with per-outcome TTLs capped at key expiry, pinned keys, composite chain - autoconfigure: mail.pgp.* properties and discovery beans - demo: sends test mails (plaintext for now) and reports the WKD result - docs/PLAN.md: design, decisions and milestones Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G71TQ5jDETVwdUJxGAwaiT
This commit is contained in:
35 files changed
+1885
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# mailsender
|
||||
|
||||
OpenPGP encryption for Spring Boot mail: discovers recipients' keys via Web Key Directory (WKD) and sends
|
||||
PGP/MIME (RFC 3156), or hands mail to an encrypting relay. See [docs/PLAN.md](docs/PLAN.md) for the design
|
||||
and milestone status.
|
||||
|
||||
Requires JDK 27 and Maven 3.9+. Built on Spring Boot 4.1.1 and PGPainless 2.0.
|
||||
|
||||
```
|
||||
mvn verify
|
||||
```
|
||||
|
||||
## Modules
|
||||
|
||||
| Module | Contents |
|
||||
|---|---|
|
||||
| `mailsender-pgp-core` | WKD key discovery, caching, pinned keys (no Spring) |
|
||||
| `mailsender-pgp-spring-boot-autoconfigure` | `mail.pgp.*` properties and discovery beans |
|
||||
| `mailsender-pgp-spring-boot-starter` | dependency bundle for applications |
|
||||
| `mailsender-demo` | sample app that sends test mails |
|
||||
|
||||
## Demo app
|
||||
|
||||
The demo app looks up the recipient's key via WKD, logs the result, and sends `DEMO_COUNT` test mails
|
||||
(default: 1 to `test@thinhha.pro`). Encryption is not wired in yet, so the mails are sent **in plaintext**,
|
||||
and the body says whether a key was found.
|
||||
|
||||
```
|
||||
mvn -q install -DskipTests
|
||||
SMTP_HOST=smtp.example.com SMTP_PORT=587 \
|
||||
SMTP_USERNAME=me@example.com SMTP_PASSWORD='app-password' \
|
||||
DEMO_TO=test@thinhha.pro DEMO_COUNT=1 \
|
||||
java -jar mailsender-demo/target/mailsender-demo-0.1.0-SNAPSHOT.jar
|
||||
```
|
||||
|
||||
| Variable | Default | Meaning |
|
||||
|---|---|---|
|
||||
| `SMTP_HOST` / `SMTP_PORT` | `localhost` / `587` | SMTP server |
|
||||
| `SMTP_USERNAME` / `SMTP_PASSWORD` | empty | SMTP credentials |
|
||||
| `SMTP_AUTH` / `SMTP_STARTTLS` | `true` / `true` | set to `false` for a local test server |
|
||||
| `DEMO_TO` | `test@thinhha.pro` | recipient |
|
||||
| `DEMO_FROM` | `SMTP_USERNAME` | sender address |
|
||||
| `DEMO_COUNT` | `1` | number of mails |
|
||||
Reference in new issue
Block a user