- Clean up PGP/MIME flow by using API instead of explicit/manual generation of
headers.
- Fix E2E test configuration for PGP/MIME case.
- Add first lacre.core unit tests.
- Add another Contract Test.
When GnuPG refuses to encrypt a message (e.g. when key has expired), record
information about the failure and send to logs, then deliver cleartext. This
way we won't bounce email that could be delivered without encryption.
Also: add more E2E tests.
Add a new test message to verify Lacre's behaviour when processing
UTF-8 messages with text in two different scripts (latin-based and cyrillic).
Also: log Content-Transfer-Encoding when logging headers is enabled.
smtplib.SMTP expects ASCII-only message bodies when message body is provided
as a 'str'. If we pass a 'bytes', we need to choose encoding earlier and we
do this by calling 'as_bytes' on messages with SMTP policy, which takes care
of formatting the body properly.
As a result, ISO-8859-x messages are converted to Quoted Printable and UTF-8
messages are Base64-encoded.
Testing this behaviour is tricky, because we use the same SMTP client to send
test data. For this reason, test code has become a bit ugly, but it does
exactly what we need.
- Cover basic GnuPG functionality with tests (confirm_key, public_keys).
- Add a test public key file.
- Fix resource leak by closing streams opened by Popen.
It's possible to trick Lacre by sending PGP markers in message body, causing
it to classify that message being already encrypted. This test case is used
to reproduce this scenario.
Extract key-loading code to a dedicated class KeyRing in lacre.keyring module.
KeyCache only keeps a static map of identities, making it safe to use in
asynchronous context (and race condition resistant).
- Add a dedicated configuration file for lacre.daemon.
- Implement test/daemon_test.py like test/e2e_test.py, to automate the
following procedure:
1. Start up lacre.daemon.
2. For each test case, send test message to the daemon and verify that the
output received by test/utils/relay.py contains expected pattern.
- Simplify Makefile.
- Fix indentation here and there.
In particular, move:
- test utilities to test/utils;
- unit tests to test/modules.
Also: start implementing the Lacre daemon test (just a stub for now).
If a user registers their key for address alice@example.com but receives a
message sent to alice+something@example.com, this message should be encrypted
as well.
- Implement delimiter support for GnuPG encryption.
- Add E2E test case for a clear text message delivered to an address with
delimiter.
- Fix minor bug: wrong configuration parameter was retrieved when logging
information about enc_domain_keymap being active.
Also: extend failover logging configuration with file-based handler to make
sure that the user gets _some_ logs even if they do not configure Lacre at
all.
- Add a new test input message for a new test identity, test scenario
configuration and a test key.
- While retrieving message payload, determine charset based on the
Content-Type header. When missing, default to UTF-8.
- Use more comprehensible variables names.
- Adjust logging levels.
- Replace custom logging code with calls to logging module.
- Use logging.config to provide configuration parameters.
To make Lacre's logging more flexible, use fileConfig from logging.config to
set up all parameters. If the configuration file is missing, use dictConfig
with hardcoded reasonable defaults.
- Move configuration-processing code to a separate module (lacre.config) and
provide a simple API to access configuration parameters.
- Prepare to use builtin logging module to log diagnostic data.
- Rework the configuration-processing file to make it cleaner.
- Log additional information while processing configuration.
- Reorder functions.
- Let the user overwrite Python binary name while calling make.
- Use environment variable set by make to instruct e2e_test.py which binary it
should call to execute Python code.
- Move things to configuration file where appropriate (logging format, etc.).
- Rework execute_e2e_test signature to simplify it and get rid of keyword
arguments.
- Simplify output.
- Include a header comment in configuration file.