- Don't pass table definitions to repository constructors.
- Keep an internal reference to Engine in lacre.repository.
- Implement KeyConfirmationQueue.count_keys.
- Keep only one class to provide access to identities stored in the database.
- Remove old code and its tests.
- Align KeyRing and IdentityRepository APIs.
- Implement a (very) simple unit test for IdentityRepository.
Introduce new Python modules:
- lacre.notify -- to send notifications from the cron script;
- lacre.dbschema -- to keep database schema definition as code (SQLAlchemy);
- lacre.repositories -- to define key and identity repositories with high
level APIs that we can then use elsewhere.
Also:
- rework GnuPG.add_key to return fingerprint so we can use it in the cron
script;
- rename cron-job's logger name, replacing dash with an underscore as logging
module doesn't like dashes.
- ContentManager sets default Content-Type even if it was missing in the
original message.
- Make sure that when Content-Type is missing, copying parameters doesn't
raise an error.
- Add a unit-test to check that.
Introduce modules:
- lacre.transport - for actual delivery via SMTP
- lacre.smime - to take care of S/MIME stuff
Implement lacre.transport.SendFrom class that does a almost exactly the same
thing as the original send_msg function, but without using global variable to
store original message sender.
In the daemon, specify policy as SMTPUTF8. That sets the deafult message type
to EmailMessage.
EmailMessage class is richer, including support for Content Managers, giving
it the capability to properly handle textual data and its encodings.
Also: add another contract test.
- Use MIMEPart instead of Message when encrypting in PGP/MIME mode.
- Wrap text/plain messages in MIMEPart, instead of manipulating payloads
manually.
- Add a test for wrapping.
- 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.