# 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, certificate validation, OpenPGP encryption, PGP/MIME (no Spring) | | `mailsender-pgp-spring-boot-autoconfigure` | `mail.pgp.*` properties and 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 and validates the recipient's key via WKD, then sends `DEMO_COUNT` test mails (default: 1 to `test@thinhha.pro`). With a valid key the mail is PGP/MIME-encrypted (RFC 3156); otherwise it is sent in plaintext and a warning is logged. The policy layer (REQUIRE / OPPORTUNISTIC / PLAINTEXT, split delivery) comes in milestone 5. ``` 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 |