Commit Graph
102 Commits
Author SHA1 Message Date
Malte Meiboom 8de999411d Polish the code
- Reject user ids containing ANSI control characters when creating a new
  signing key.
- Prevent adding certificates twice when querying online sources if they
  contain multiple encryption keys.
- Dedup introducers if there are multiple authenticating paths.
- When listing locals, skip the signing key.
- Check if a mail can be encrypted at all due to available certificates.
  If not tell the MTA that the processing is done.
- Make `Introducer` comparable (`PartialEq`, `Eq` and `Hash`).
- minor polishing
2026-07-24 13:41:07 +02:00
Malte Meiboom 0b1969e75b Merge branch 'malte/mail_splitting' into 'main'
Mail splitting

See merge request husk-project/husk-milter!9
2026-07-22 09:12:32 +00:00
Malte Meiboom ba0d4c9768 Dependency fixes
- Remove dependency on rusqlite 1.40.x from Cargo.lock.
- Actually bump `sequoia-openpgp` to 2.4.1.
2026-07-22 11:07:23 +02:00
Malte Meiboom c37f2ef956 Optimize mail reinjection
- Mark reinjected mails so that Husk can shortcut the processing.
- Fix Cargo.toml to correctly include the patched version of
  sequoia-cert-store and sequoia-keystore.
2026-07-21 12:12:42 +02:00
Malte Meiboom d54cc480b4 Add footer
- Add a footer to each mail resulting from a split into an encrypted and
  an unencrypted version. The footer contains the recipients of the mail
  which are excluded in the corresponding stream.
- Move the construction of the `HuskContext` to the `mail`
  milter-command, as `helo` is used by scrapers to detect mailservers.
- Use `CertD::trust_root()` to get the trust root - it creates one if no
  root can be found.
- Add `chrono` dependency.
2026-07-14 11:28:34 +02:00
Malte Meiboom 8b2f284916 Improve e2e tests
- Add a test for mail splitting.
- Cleanup the code, move common functionality into `common.sh`.
- Reduce noise in the test output.
2026-07-09 12:55:10 +02:00
Malte Meiboom ca58d73050 Add mail splitting
- If a mail has more then one recipient and not for all recipients an
  authenticated certificate can be obtained, the mail processing is
  split into 2 streams - one that encrypts and an other which sends the
  mail in plaintext.
- For both streams the header and the list of recipients is adjusted
  accordingly.
- As the milter interface only allows one stream, the second stream is
  reinjected into the MTA (via SMTP). The MTA is hardcoded to be
  localhost:25.
2026-07-09 12:49:47 +02:00
Malte Meiboom fc2808037a Fix the urls in README.md. 2026-07-05 21:01:41 +02:00
Malte Meiboom 94c94d1fce Upgrade dependencies
- Upgrade Sequoia PGP to 2.4.0
- Remove deprecated `sequoia_wot::CertSynopsis::userids()` and replace
  with `self_signed_userids()`.
- Add `lettre` as dependency for its SMTP functionality.
2026-07-03 21:52:26 +02:00
Malte Meiboom 68f195a159 Merge branch 'malte/milestone_4' into 'main'
Milestone 4

See merge request husk-project/husk-milter!8
2026-07-01 10:14:47 +00:00
Malte Meiboom 834a2da5ea Milestone 4
- Husk will wrap an email it encrypts into a fitting mime structure
  so that MTUs (Mail user agent, like Thunderbird) can display the
  message properly.
- Husk now can deal which attachments.
- Header protection will be used with encrypted emails.
- Husk can sign messages if you provide it with an appropriate key.
- Hush can now send itself into the background. It now understands start, stop
  and status.
- When building Husk from source, files for shell completion are generated.
- When listing introducers their associated domains are also displayed.
milestone_4
2026-07-01 11:58:21 +02:00
Malte Meiboom 10171cc1a5 Merge branch 'malte/daemon' into 'main'
Add daemon CLI commands

See merge request husk-project/husk-milter!7
2026-07-01 09:25:22 +00:00
Malte Meiboom ee6b467139 Add daemon CLI commands
- Introduce option `--background` for `daemon start` to send the new
  process into the background.
- Implement a `ProcessDescr` which identifies a Husk process. This pays
  attention to the possibility of a rollover of the process ids.
- Implement `daemon status`.
- Implement `daemon stop` which sends `SIG_INT` to a running Husk
  process.
2026-06-30 12:17:07 +02:00
Malte Meiboom bd0b48398d Fix signature tests
- If the signing key is replaced too fast (within the same second) the
  resolution of OpenPGP timestamps is not good enough to identify the
  sequence of certifications - which might to the selection of the wrong
  signing key.
2026-06-27 13:11:13 +02:00
Malte Meiboom 847bdb1294 Merge branch 'malte/signing' into 'main'
Signing outgoing mails

See merge request husk-project/husk-milter!6
2026-06-24 09:29:16 +00:00
Malte Meiboom dabd3b26f9 Use error types, cleanup
- Create and use `CommandError` in signkey commands instead of
  `eprintln!()`.
- Minor cleanup in `crypto.rs`.
2026-06-24 11:19:07 +02:00
Malte Meiboom 7688e6c5a2 Add signkey create
- Add a CLI command for creating a new signing key.
2026-06-19 12:27:43 +02:00
Malte Meiboom e47b1b837c Sign encrypted mails.
- Husk now not only encrypts outgoing emails (if possible) but also adds
  a signature.
- Rework the internal handling of the signing key.
- Integrate the signing into the workflow of the daemon.
- Add a configuration option for a subject replacement.
2026-06-18 13:24:24 +02:00
Malte Meiboom 06c0583f5e Add CLI interface for the signing key
- 'signkey set' sets a new signing key (disables an old one if
  existing).
- 'signkey show' prints the fingerprint.
- 'signkey dump' prints the certificate of the signing key.
2026-06-13 14:37:37 +02:00
Malte Meiboom 7547776efe Assert that an added introducer has certification capabilities 2026-06-12 12:45:14 +02:00
Malte Meiboom 18552d883d use mta:latest as build image 2026-06-10 15:25:59 +02:00
Malte Meiboom 00f93e366e Add build dependencies to the docker image
- Add capnproto
- Add libsqlite3-dev
2026-06-10 15:14:36 +02:00
Malte Meiboom 1f89d40cd3 Start with signing outgoing mails
- Add a scheme on how to discover Husk signing keys. Siging keys mut be
  certified by the `local trust root` with a signature having a notation
  with a name equal to `signing_keys@husk-projet.org`.
- Fetch the key from the keystore.
- Expand `authenticate()` so that notation can be added to the
  signature.
- Add a test to create a signing key and fetch it from the keystore.
2026-06-10 15:00:33 +02:00
Malte Meiboom 44d00b262e Merge branch 'malte/mime' into 'main'
Add MIME support

See merge request husk-project/husk-milter!5
2026-06-08 09:10:09 +00:00
Malte Meiboom 5e9e720e02 Add shell completions
- Add a `build.rs` (plus dependencies) to generate the shell completions
  clap knows.
2026-06-08 11:08:04 +02:00
Malte Meiboom 9a0fbbe44c docker: Add more binaries
- add inotify-tools to avoid `sleep` and check expected files directly.
- add mailutils to generate mime structured emails
2026-06-08 11:05:34 +02:00
Malte Meiboom d24aaf83e4 Add MIME support
- Wrap encrypted mails into a mime structure
- Add 'protected headers'
2026-06-08 10:58:25 +02:00
Malte Meiboom 4c7aeed288 Merge branch 'malte/shell-completions' into 'main'
Add shell completions

See merge request husk-project/husk-milter!4
2026-06-03 13:03:05 +00:00
Malte Meiboom ccfb8d6f36 Add shell completions
- Add a `build.rs` (plus dependencies) to generate the shell completions
  clap knows.
2026-06-03 14:38:35 +02:00
Malte Meiboom e43f627e1b Merge branch 'malte/fix-introducer-list' into 'main'
Fix introducer list subcommand

See merge request husk-project/husk-milter!3
2026-06-03 09:16:29 +00:00
Malte Meiboom a4e3bc6b8c Fix introducer list subcommand
- Add a list of introduced domains to the output.
- Fix `regex_domain_unescape()` to return an error if the regular
  expression differs from a regex for a domain.
2026-06-02 21:36:15 +02:00
Malte Meiboom 0ff4d340cb Merge branch 'malte/start_cli' into 'main'
Second part of milestone 3

See merge request husk-project/husk-milter!2
milestone_3
2026-05-27 09:46:09 +00:00
Malte Meiboom 86f4f2933e Merge branch 'main' into 'malte/start_cli'
# Conflicts:
#   .gitlab-ci.yml
2026-05-27 09:44:18 +00:00
Malte Meiboom afd4729698 Fix CI/CD 2026-05-27 11:42:07 +02:00
Malte Meiboom 7864fa82d3 Remove the e2e job from ci/cd until it is fixed 2026-05-27 11:40:46 +02:00
Malte Meiboom 86f337ce73 Update .gitlab-ci.yml file 2026-05-27 11:40:40 +02:00
Malte Meiboom d38cca258c Update .gitlab-ci.yml file 2026-05-27 11:40:07 +02:00
Malte Meiboom 957c8b8979 Adjust README
- Update the README to include the changes for milestone 3.
2026-05-27 11:28:53 +02:00
Malte Meiboom a007a296ff Upgrade Cargo.toml
- Upgrade Cargo.toml and Cargo.lock
2026-05-27 10:54:12 +02:00
Malte Meiboom 516d745f00 Code polish
- Fix some typos.
- Added more comments (and documentation) to the code.
2026-05-27 10:53:02 +02:00
Malte Meiboom 3e60bfbde4 Flush logs after each message
- Remove or optimize this.
2026-05-21 12:45:30 +02:00
Malte Meiboom 3d5c98be82 Wait for logfile to be written 2026-05-21 11:56:53 +02:00
Malte Meiboom 74ded863f2 Fix mail test
- Create an empty mailbox file in `/var/mail` so that `inotifywait` can
  wait on the right file and not just observe the directory.
2026-05-20 16:22:07 +02:00
Malte Meiboom e1a75288a6 pass the right branch 2026-05-20 15:32:03 +02:00
Malte Meiboom 3b95409a40 add more debugging 2026-05-20 15:07:41 +02:00
Malte Meiboom 118c12cdb0 Update .gitlab-ci.yml file 2026-05-20 12:58:39 +00:00
Malte Meiboom dece3ae325 Update .gitlab-ci.yml file 2026-05-20 12:48:30 +00:00
Malte Meiboom 85468e8d3b fix path 2026-05-20 14:36:22 +02:00
Malte Meiboom 1f8d7e9a3f Add test framework to test
- Mail encryption (when expected)
- Introducer listing, adding and removing
- Locals listing, adding and removing
2026-05-20 14:27:28 +02:00
Malte Meiboom aed368e90d Remove some debugging messages 2026-05-20 13:49:40 +02:00