Commit Graph
100 Commits
Author SHA1 Message Date
link2xt c3563f73e4 chore: bump version to 2.59.0-dev 2026-08-11 03:07:37 +00:00
link2xt 7990e17859 refactor(mimefactory): separate rendering of message payload and sendable message
This change separates rendering into two separate steps:
1. Rendering of the message payload without the From, Date and Autocrypt headers.
2. Adding the From, Date and Autocrypt headers and possibly encrypting the message.

The goal is to have serializable result of the first step
that can be persisted in the database and sent later with any email address.
This way it will be possible to send queued messages over any relay.

This will make it possible not to remove all messages from the queue
when the sending relay is changed.
Currently changing `configured_addr` deletes everything from `smtp` table.

This change is however only a refactoring and does not implement any features.
2026-08-04 11:57:57 +00:00
link2xt 2ac217ddd4 feat: send messages to 5 relays instead of the newest 3 ones
Otherwise users may add up to 5 relays, but 2 oldest relays
are actually ignored.

Having the maximum number of published relays
and the number of relays used the same between all clients
makes the order of relays in the key irrelevant.
We may even remove sorting by `add_timestamp`
from `get_all_self_addrs()` in the future.
2026-08-03 14:04:15 +00:00
link2xt 8e60ed7d89 perf: Box::pin iroh::endpoint::Builder::bind
It is has a size of 13k and increases the size of all futures calling it as a result,
while only being used for initialization.
2026-08-03 13:54:49 +00:00
link2xt fab974f31e feat: collect ICE servers from all relays 2026-08-03 13:38:40 +00:00
link2xt 99d202a973 api(ffi): store reference-counted Context in dc_chatlist_t 2026-08-02 17:22:56 +00:00
link2xt ae02b6dcfc api!: remove dc_chatlist_get_context()
This API is dangerous because returned pointer
is only valid until the chatlist is freed,
and may accidentally be passed into dc_context_unref().
2026-08-02 17:22:56 +00:00
link2xt e1f5858fa3 api(ffi): store reference-counted Context in dc_contact_t 2026-08-02 17:22:56 +00:00
link2xt abfc1b9a76 api(ffi): store reference-counted Context in dc_msg_t
The change is similar to the change done to dc_chat_t
in b5acbaa31c
2026-08-02 17:22:56 +00:00
link2xt 057d6c0c5e refactor: reduce the scope of unsafe in dc_context_unref() 2026-08-02 17:09:56 +00:00
link2xt cf5f87c81b chore(cargo): introduce syn 3 dependency
It is now used by at the latest versions of anyhow and thiserror,
so we will eventually have this duplicate dependency anyway.
2026-08-02 02:31:45 +00:00
link2xt 62d3f3877f refactor: mark enabled ephemeral timer duration as NonZero
Now the type system ensures that Timer::Enabled
never stores 0 value inside accidentally,
it is impossible to put 0 there without unsafe code.
2026-07-31 23:55:49 +00:00
link2xt fb4fdeb470 fix(python): create event emitter when EventThread is initialized
EventThread is created in Account.__init__,
but the thread start may be scheduled later.
If the thread only cals dc_get_event_emitter()
after some events have been emitted,
EventThread will never capture such events
and the tests will timeout waiting for the event.

This happened in CI on a Linux runner
with test_markseen_invalid_message_ids
timing out waiting for DC_EVENT_MSGS_CHANGED
right after sending a message.
2026-07-31 23:20:17 +00:00
link2xt 3d50f3c9a3 refactor: do not clean imap_send table on transport change
imap_send table is not unused anymore
and should eventually be deleted.
It only exists for compatibility
and no other SQL statements use it anymore.
2026-07-30 16:54:04 +00:00
link2xt e74ffb6e93 docs: add missing slash to ConnectionSecurity::Starttls doc comment 2026-07-29 23:50:59 +00:00
link2xt bbcfa5e40e chore: disable "large futures" lint again
The lint is reasonable, but without some work
to bring the future sizes way below the limit,
this lint is frequently triggered in unrelated PRs
that just add some local variables to async functions
or extend some structure that is passed on the stack.
2026-07-29 00:47:39 +00:00
link2xt 733bec326a fix: mark as_path() function unsafe 2026-07-27 23:48:11 +00:00
link2xt 2d7af15124 build: update all crates to Rust 2024 edition
Largest change is in the FFI crate.
With 2024 (but not 2021) edition unsafe code
inside unsafe functions should be marked separately
so we can mark exactly the code that is unsafe.
Some CFFI functions even have no unsafe code inside.

Most interesting change is that .strdup()
functions are not marked as unsafe anymore.
They are allocating memory and return raw pointers,
but there is nothing unsafe about it.
Only using the returned raw pointers is unsafe.
This way calls to .strdup() don't have to be marked
with unsafe{} blocks.
2026-07-27 23:48:11 +00:00
link2xt 850ac0831f refactor: use the new regex! macro
It was introduced in regex crate 1.13.0
2026-07-26 13:21:40 +00:00
link2xt 55ede9f2f6 ci: update github actions monthly instead of weekly 2026-07-25 14:21:44 +00:00
link2xt 234e491172 fix: never merge outer To headers if standard header protection is used 2026-07-24 11:59:59 +00:00
link2xt 3a913dfb07 feat: enable TLS certificate compression
Enabling brotli does not add new dependencies,
we have it already.
Documentation at <https://docs.rs/rustls/0.23.42/rustls/compress/>
recommends enabling at least brotli.

zlib feature is not enabled as it pulls in duplicate zlib-rs 0.6.6
zlib was even never supported in Chromium (while brotli is).
It might still be interesting to enable it in the future
because it seems to be the only option supported by OpenSSL
and there may be servers that support zlib but not brotli.

RFC 8879 specifies zstd as well, but there is no feature to enable it yet.

This also brings back explicit TLS 1.2 feature that was reverted.
We don't want TLS 1.2 support to be accidentally dropped
if no dependencies explicitly require it anymore.
2026-07-22 14:03:36 +00:00
link2xt bdd9d96844 feat: accept messages from key contacts with forged From address
From address is not used for key contacts
other than as the address to send replies to.
2026-07-21 19:59:32 +00:00
link2xt 8c53f86fbc chore: bump version to 2.57.0-dev 2026-07-21 19:35:26 +00:00
link2xt 1721c0316a feat: do not set backup_time in exported databases
backup_time is unused, it is only set, but nobody reads it.
2026-07-21 12:02:39 +00:00
link2xt 35d7b4e21c chore(release): prepare for 2.55.0 2026-07-20 18:47:28 +00:00
link2xt 03725c5f32 ci: update Node version to 24
https://docs.npmjs.com/trusted-publishers recommends node-version 24
and not updating npm separately, this change copies the recommended configuration.

Also update node version to 24 in non-release workflows, version 18 is EOL.
There is a version 26 already, but 24 is LTS.

Also disable cache for release pipelines.
2026-07-20 17:39:13 +00:00
link2xt a0c96f4ce1 chore: bump version to 2.55.0-dev 2026-07-20 15:20:53 +00:00
link2xt b432d08aa8 chore(release): prepare for 2.54.0 2026-07-20 14:57:57 +00:00
link2xt ebd1c20997 fix: do not log errors if full message is not available on any transport
Before this change "Err" case spams the logs with
"Failed to download message rfc724_mid=...: IMAP location for ... post-message is unknown."
logged by every transports when the message is not available on any transport.
2026-07-20 09:50:27 +00:00
link2xt aadd11a771 feat(imap): use CAPABILITY response code if LOGIN command returns it
This saves one round trip during connection establishment
if the server returns capabilities in the LOGIN command response already.
2026-07-17 21:36:45 +00:00
link2xt 17b32a17f5 chore: update async-imap to 0.11.3 2026-07-17 21:36:45 +00:00
link2xt 355ab8b3bc ci: update Rust to 1.97.1 2026-07-17 13:49:35 +00:00
link2xt 1a24bf612a refactor: label the loop iterating over the candidates
The loop is large, so having an explicit label
makes it easier to understand what the "continue" statement does.
2026-07-16 09:49:41 +00:00
link2xt 492741ac60 fix(imap): do not bubble up errors in IMAP candidate loop
Network errors such as timeouts should not break out of the loop
by bubbling up errors. There may be more candidates to try,
breaking out of the loop skips trying them.
2026-07-16 09:49:41 +00:00
link2xt d940f96a5c feat: limit the number of published relays instead of all relays 2026-07-15 17:24:58 +00:00
link2xt e5c920f1a1 api(deltachat-rpc-client): add Account.set_transport_unpublished() 2026-07-15 17:24:58 +00:00
link2xt ce2d237ffd refactor: remove unnecessary reference in format string 2026-07-14 11:14:36 +00:00
link2xt f2d11305bd chore: update yanked spin@0.9.8 and spin@0.10.0
Upstream issue with the reason for yanking the crate is <https://codeberg.org/zesterer/spin/issues/192>
2026-07-14 11:14:10 +00:00
link2xt 5adf7454ea ci: update Rust to 1.97.0 2026-07-12 13:10:21 +00:00
link2xt 079fb352e3 refactor: remove set_modseq() function
This is a follow-up to 8f51c7b9d5
which removed sync_seen_flags().

MODSEQ is a message attribute related to
CONDSTORE IMAP extension and is not used anymore
since CONDSTORE is not used.
2026-07-12 06:16:01 +00:00
link2xt 31b2d7961a fix: ensure public key signatures are not in the past compared to the public key
We use the timestamp of the latest transport modification
as the timestamp of the Direct Key Signature.
However, first transport is created before the public key
and existing transports may even have zero timestamp
if they were created before migration 142.

For interoperability with Sequoia-PGP,
make sure signatures always have a timestamp
that is not in the past compared to the timestamp
of the primary key.
2026-07-08 17:41:45 +00:00
link2xt ee1095be9d chore: update quick-xml to 0.41.0
Fixes cargo-deny complaining about https://rustsec.org/advisories/RUSTSEC-2026-0194
2026-07-03 16:21:02 +00:00
link2xt 89a1f55a87 feat: increase max idle timeout for backup receiver to 60 seconds
Default is 30 seconds according to
<https://docs.rs/iroh/0.35.0/iroh/endpoint/struct.TransportConfig.html#method.max_idle_timeout>
2026-07-02 05:00:38 +00:00
link2xt 30bdcd6809 fix: do not put locations into pre-messages 2026-07-01 12:02:53 +00:00
link2xt 5eb5d22d7b fix: replace last_added_location_id with last_added_location_timestamp
Stored location ID was not actually used
and locations_last_sent timestamp was updated
with the current time, possibly skipping
locations.
2026-07-01 12:02:53 +00:00
link2xt a14e617059 feat: remove ?emailaddress argument from autoconfig URL that is not using a dedicated domain
This brings the implementation closer to the specification <https://datatracker.ietf.org/doc/draft-ietf-mailmaint-autoconfig/06/>
as it is confirmed that `?emailaddress` should not be included.
2026-06-29 18:07:17 +00:00
link2xt 1b2ec2e88c chore: update astral-tokio-tar from 0.6.2 to 0.6.3 2026-06-27 06:04:18 +00:00
link2xt 09d5d0bddf chore: update rPGP from 0.19.0 to 0.20.0 2026-06-25 16:17:24 +00:00
link2xt b38277c294 feat: log transport ID in store_seen_flags_on_imap 2026-06-23 05:05:19 +00:00
link2xt 5a54e18fee fix: recreate imap_markseen with PRIMARY KEY constraint
It is needed to speed up "DELETE FROM imap_markseen_new WHERE id = ?".
Otherwise if imap_markseen table grows large,
marking a lot of messages at once as seen and trying to delete them one by one
from imap_markseen table may have quadratic complexity.
2026-06-23 03:33:33 +00:00
link2xt 0a82d73eb5 refactor: move ensure_secret_key_exists into key.rs 2026-06-21 04:18:39 +00:00
link2xt c026910fa7 chore: deprecate unused SkipAutocrypt param
I renamed SkipAutocrypt into DeprecatedSkipAutocrypt
instead of removing to make sure the letter is not reused.
2026-06-21 04:18:20 +00:00
link2xt 2aba6aa339 refactor: make crate::pgp::symm_encrypt_message non-async 2026-06-20 00:36:05 +00:00
link2xt 93a6f35ef7 refactor: remove the ability to send messages with non-standard header protection 2026-06-20 00:09:48 +00:00
link2xt 3f371b3895 refactor: remove commented out RenderedEmail.envelope 2026-06-18 17:59:56 +00:00
link2xt b860583f8d fix: request MDNs for resent channel messages 2026-06-16 14:49:49 +00:00
link2xt 44bdd5ef0c chore: bump version to 2.54.0-dev 2026-06-15 21:38:38 +02:00
link2xt d844f29c68 chore(release): prepare for 2.53.0 2026-06-15 21:26:11 +02:00
link2xt 07d6b89b85 chore: bump version to 2.53.0-dev
Fixup for 93bf3d6ebb
which should have bumped the version to 2.53.0-dev
but bumped to 2.52.0-dev.
2026-06-15 18:29:14 +02:00
link2xt 2bcfbe99fa fix: do not abort IMAP connection if setting the push token fails
With madmail 2.2.2 from https://github.com/themadorg/madmail/releases/download/v2.2.2/madmail-linux-amd64
using IMAP command SETMETADATA to set /private/devicetoken
returns error "A0003 BAD command not supported".

With this change connection is not aborted anymore
and the error is logged like this:
src/scheduler.rs:458: Transport 1: Failed to register push token: SETMETADATA command failed: bad response: code: None, info: Some("command not supported").

madmail 2.2.2 however fails to select the INBOX afterwards
and the following command `A0004 SELECT "INBOX"`
results in `* BAD command not supported` response.

Fixes https://github.com/chatmail/core/issues/8334
2026-06-15 13:45:26 +00:00
link2xt 3e10cf2c07 feat: do not log the recipient list for sent messages 2026-06-15 13:41:40 +00:00
link2xt c7a399e3ca refactor(flake.nix): Use hostPlatform.rust.rustcTarget instead of hardcoding it 2026-06-15 13:41:16 +00:00
link2xt f961a49906 test: remove timeout from pop_sent_msg_ex()
Arbitrary timeouts often result in flaky tests,
especially if CI runners may be paused.
In this case however timeout was not used by any tests
and only slowed down the tests in cases where
no message is expected but non-zero timeout is set.
2026-06-13 23:14:13 +00:00
link2xt b98b32317c test: fixup the tests after removing timesmearing 2026-06-13 22:59:03 +00:00
link2xt 293b524373 refactor: remove timesmearing 2026-06-13 15:43:47 +00:00
link2xt edb8a87cf8 test: print multiline chat descriptions with debug formatter 2026-06-13 15:43:47 +00:00
link2xt 9f2de665fc build(nix): switch to the "master" branch for naersk
PR <https://github.com/nix-community/naersk/pull/391> has been merged.
2026-06-13 14:21:31 +00:00
link2xt e8b94781a5 fix: do not trash pre-messages without text but with a webxdc update
Webxdc updates go to pre-message and when the message has no text,
the whole pre-message is trashed if it has a webxdc update.
The solution is not to trash pre-message in this case so preview is displayed.
2026-06-11 15:10:14 +00:00
link2xt 93bf3d6ebb chore: bump version to 2.52.0-dev 2026-06-09 02:18:40 +02:00
link2xt f05336f793 chore(release): prepare for 2.52.0 2026-06-09 00:40:07 +02:00
link2xt 8df028e9a8 build(nix): fix windows cross-compilation 2026-06-08 17:17:10 +00:00
link2xt 40309ce857 chore: add exception for unmaintained proc-macro-error2 to deny.toml 2026-06-08 17:16:10 +00:00
link2xt 207c2e6e4c feat: switch to aws-lc-rs cryptography provider for Rustls
aws-lc-rs is the default provider for Rustls.
We have been using ring as the default provider
to avoid duplicate dependency
because iroh supports only ring in 0.35.0,
but with version 1.0 it will be possible
to select other crypto providers
and we can switch to using more common default.

This change also enables "tls12" feature explicitly,
otherwise if there is no other dependency
requiring it, only TLS 1.3 will be supported
and we want to keep supporting TLS 1.2.
2026-06-06 09:56:31 +00:00
link2xt 4a94a34c6d chore: update preloaded DNS cache 2026-06-01 11:29:25 +00:00
link2xt 92d522473f refactor: remove support for building "source" packages for deltachat-rpc-server
This hack was needed to "build" Android packages
by repackaging Linux packages on-the-fly,
but PyPI has since added Android support
and we are using it directly.
2026-05-31 08:45:39 +00:00
link2xt 7ea637c930 chore: bump version to 2.51.0-dev 2026-05-29 18:32:58 +02:00
link2xt 3a1b0d4679 chore(release): prepare for 2.51.0 2026-05-29 18:05:43 +02:00
link2xt 0bc7849e8a build(nix): fix downloads from crates.io in nix builds
crates.io recently started rejecting requests to https://crates.io/api/v1/crates
made by Nix: https://github.com/rust-lang/crates.io/issues/13482
This resulted in failing to download any dependencies
from crates.io with 403 error during Rust package builds.
The problem was solved in nixpkgs by switching
to CDN URL https://static.crates.io/crates
in https://github.com/NixOS/nixpkgs/pull/524985

As of writing this on 2026-05-29
the fix is on "master" branch of nixpkgs,
but not on "nixos-unstable" or "nixpkgs-unstable"
branches yet according to https://nixpk.gs/pr-tracker.html?pr=524985
so I have switched nixpkgs to "master" branch to get the problem fixed.

naersk needs a similar fix. I opened a PR for it
https://github.com/nix-community/naersk/pull/391
but because the fix is not merged yet,
switched to my PR branch in flake.nix.

Updating nixpkgs required some minor changes,
e.g. sphinx_rtd_theme has been renamed to sphinx-rtd-theme,
pthreads in Windows builds had to be moved to buildInputs to fix
"Refusing to evaluate package 'mingw_w64-pthreads-13.0.0'
in /nix/store/f78lkqnk63pd0kf52zf2wcx35p1nnalr-source/pkgs/os-specific/windows/mingw-w64/headers.nix:35
because it is not available on the requested hostPlatform"
2026-05-29 10:16:16 +00:00
link2xt dfea8b0134 test: test encrypted messages in test_delete_expired_imap_messages 2026-05-29 08:37:21 +00:00
link2xt 376c819374 feat: immediately remove all encrypted messages from the server in single-device mode 2026-05-29 08:37:21 +00:00
link2xt 02827406f3 docs: fix reference in delete_expired_imap_messages comment
It should refer to delete_expired_messages,
not to itself.
2026-05-29 08:37:21 +00:00
link2xt 9d9f61d9eb refactor: make should_delete_all_downloaded_messages non-async
Pass bcc_self into it as a boolean.
2026-05-29 08:37:21 +00:00
link2xt a2816d7bd3 test: test bcc_self in test_delete_expired_imap_messages 2026-05-29 08:37:21 +00:00
link2xt 480248a168 refactor: remove pre_encrypt_mime_hook
It is only used in a single test
and the test is more reliable by having a blob .eml
that will not be accidentally modified
by mimefactory changes.
2026-05-26 08:10:51 +00:00
link2xt 24848c0265 fix: do not fail to receive post-message with status updates for deleted webxdc
receive_imf should not fail in this case,
but trash the post-message and updates.

The problem with previously used message::rfc724_mid_exists check
was that rfc724_mid_exists may return a trashed message.
2026-05-23 21:57:58 +00:00
link2xt 98123afb62 test: test IPv6 addresses in HTTP(S) proxies 2026-05-23 21:49:37 +00:00
link2xt 16b65c59bf fix: do not try to resolve proxy IPv6 addresses in square brackets
"[::1]" is not a hostname, but an IPv6 address,
and should be passed as "::1" to tokio::net functions.

Otherwise connecting to proxy addresses such as `socks5://[::1]:9150`
fails by trying to resolve IPv6 address with DNS.
2026-05-23 07:01:05 +00:00
link2xt bafb5f71ad chore: bump version to 2.51.0-dev 2026-05-22 21:41:03 +02:00
link2xt 784a6abb3b chore(release): prepare for 2.50.0 2026-05-22 20:16:32 +02:00
link2xt 602922c1d5 feat: mask local part of email addresses in used_transport_settings
Also remove redundant all_self_addrs from the info,
each address corresponds to the transport.
2026-05-21 22:58:51 +00:00
link2xt 03b10ea83a feat: remove key fingerprint from Context.get_info()
This info is added at the top of the logs
and we don't want users to send us the logs
with the key fingerprint for debugging,
it is not really useful but identifies the profile.
2026-05-21 22:58:51 +00:00
link2xt 72f5dafc68 docs(spec): remove AEAP section
AEAP is replaced with key contacts.
2026-05-21 16:30:34 +00:00
link2xt 85308b9263 ci: use --locked flag with cargo build 2026-05-20 15:57:12 +00:00
link2xt d0696504d1 feat: add option to force encryption 2026-05-19 22:40:28 +00:00
link2xt 32e4a74050 test: online test for legacy Secure-Join key request 2026-05-19 22:40:28 +00:00
link2xt f0992070be test: add TestContext.allow_unencrypted() 2026-05-19 22:40:28 +00:00
link2xt 02f5dba620 test: use encrypted messages in more tests
This change is a preparation for ignoring
unencrypted messages by default.

New test_utils::encrypt_raw_message and
test_utils::receive_encrypted_imf are
used to encrypt the messages before
"receiving" them with receive_imf.
2026-05-19 22:40:28 +00:00
l ac3c5c55e4 chore: upgrade astral-tokio-tar to 0.6.2 (#8255)
Closes https://rustsec.org/advisories/RUSTSEC-2026-0145
2026-05-19 17:21:55 +00:00
link2xt 7a39a0c8ff ci: set cache-bin to "false" for swatinem/rust-cache action
Workaround for <https://github.com/actions/runner-images/issues/14099>.
Not clear why caching ~/.cargo/bin is needed in the first place,
so we can disable it permanently.
2026-05-15 01:14:26 +00:00