Commit Graph
110 Commits
Author SHA1 Message Date
Malte Meiboom f9df6a5daa Add lookup for email addresses in the updater
- Only considering the fingerprint of a certificate for online querying
  of updates leaves out WKD and DANE as sources. Add the email addresses
  of a certificate to the update process.
2026-08-12 11:35:58 +02:00
Malte Meiboom 04322f9cd9 Tor support
- Add support for using Tor via a socks5 proxy.
- Tor usage of the milter and the updater process are configured
  separately.
- Restructure the config file and add some documentation.
2026-08-10 15:12:50 +02:00
Malte Meiboom 1ed3e1e988 Updater
- The updater looks for updates to certificates from the certificate
  store.
- The updates are spaced by random time intervals so that the
  reconstruction of the content of the cert store is made more
  difficult.
- The updater can be send into the background - start, stop and status
  are implemented.
- The state of the updater is persisted to disk so that the update
  procedure survives a restart.
2026-08-07 11:11:55 +02:00
Malte Meiboom 118b930c1d Refactor HuskContext
- Provide a way to initialize a `HuskContext` without determine the
  signing key. This saves startup time for commands which do not need
  the signing key.
2026-08-06 11:47:32 +02:00
Malte Meiboom cd8935b3f3 cleanup dependencies 2026-08-05 11:07:42 +02:00
Malte Meiboom 173c32ff5a Refactor online certificate lookup
- Allow searching for fingerprints - needed for the updater mechanism.
2026-08-05 11:05:53 +02:00
Malte Meiboom 5cf7357230 Milestone 5 reached
Previously when Husk encountered an email which it could not encrypt, because it couldn’t get an authenticated certificate for the recipient, it let the email pass without modifications. This was especially true for emails with several recipients – if just one of them was without a certificate, the email was not encrypted.

With milestone 5, Husk now deals with the above situation. In that case, the email processing is split into two flows, producing a encrypted mail for all recipients with an authenticated certificate and sending the mail unencrypted for those recipients who don’t. The email headers are modified accordingly to avoid email loops and a footer is added so that a recipient still knows who else got this email.

This milestone also includes fixing of minor bugs and code improvements, to mention a few:

- Introducers where listed for each authentication path, now this list is deduplicated.
- Detect ANSI control characters in User ID as they can be used for malicious proposes.
milestone_5
2026-08-03 11:45:34 +02:00
Malte Meiboom 876eebd73d Merge branch 'malte/polish' into 'main'
Polish the code

See merge request husk-project/husk-milter!10
2026-07-24 11:54:48 +00:00
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