mox/store
Mechiel Lukkien 8804d6b60e
implement tls client certificate authentication
the imap & smtp servers now allow logging in with tls client authentication and
the "external" sasl authentication mechanism. email clients like thunderbird,
fairemail, k9, macos mail implement it. this seems to be the most secure among
the authentication mechanism commonly implemented by clients. a useful property
is that an account can have a separate tls public key for each device/email
client.  with tls client cert auth, authentication is also bound to the tls
connection. a mitm cannot pass the credentials on to another tls connection,
similar to scram-*-plus. though part of scram-*-plus is that clients verify
that the server knows the client credentials.

for tls client auth with imap, we send a "preauth" untagged message by default.
that puts the connection in authenticated state. given the imap connection
state machine, further authentication commands are not allowed. some clients
don't recognize the preauth message, and try to authenticate anyway, which
fails. a tls public key has a config option to disable preauth, keeping new
connections in unauthenticated state, to work with such email clients.

for smtp (submission), we don't require an explicit auth command.

both for imap and smtp, we allow a client to authenticate with another
mechanism than "external". in that case, credentials are verified, and have to
be for the same account as the tls client auth, but the adress can be another
one than the login address configured with the tls public key.

only the public key is used to identify the account that is authenticating. we
ignore the rest of the certificate. expiration dates, names, constraints, etc
are not verified. no certificate authorities are involved.

users can upload their own (minimal) certificate. the account web interface
shows openssl commands you can run to generate a private key, minimal cert, and
a p12 file (the format that email clients seem to like...) containing both
private key and certificate.

the imapclient & smtpclient packages can now also use tls client auth. and so
does "mox sendmail", either with a pem file with private key and certificate,
or with just an ed25519 private key.

there are new subcommands "mox config tlspubkey ..." for
adding/removing/listing tls public keys from the cli, by the admin.
2024-12-06 10:08:17 +01:00
..
account.go webmail: add setting to show html version of a message by default, instead of text version 2024-08-23 14:02:55 +02:00
account_test.go in more tests, after closing accounts, check the last reference is indeed gone 2024-04-16 17:33:54 +02:00
cleanuptemp.go replace packages slog and slices from golang.org/x/exp with stdlib 2024-02-08 14:49:01 +01:00
export.go webmail: add export functionality 2024-04-22 13:41:40 +02:00
export_test.go remove spurious empty line to fix build, and update roadmap 2024-04-22 14:32:50 +02:00
import.go improve previous about using mtime from imported maildir message files 2024-04-02 20:04:09 +02:00
import_test.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00
lastknown.go move config-changing code from package mox-/ to admin/ 2024-12-02 22:03:18 +01:00
msgreader.go mox! 2023-01-30 14:27:06 +01:00
msgreader_test.go make mox compile on windows, without "mox serve" but with working "mox localserve" 2023-10-14 10:54:07 +02:00
search.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00
session.go when login sessions to admin/account/webmail interfaces expiry or are no longer valid, explain the behaviour in the message 2024-08-23 14:48:45 +02:00
state.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
threads.go better thread matching for dsns 2024-03-04 16:40:27 +01:00
threads_test.go add debug logging about bstore db schema upgrades 2024-05-10 14:44:37 +02:00
tlspubkey.go implement tls client certificate authentication 2024-12-06 10:08:17 +01:00
tmp.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00
train.go replace packages slog and slices from golang.org/x/exp with stdlib 2024-02-08 14:49:01 +01:00
validation.go mox! 2023-01-30 14:27:06 +01:00