Commit Graph

5690 Commits

Author SHA1 Message Date
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
iequidoo
b4471f2434 feat: Remove trailing '.' from device message about receive_imf failure
This is to avoid from the Android UI treating it as a part of URL.
2026-06-29 14:33:52 -03:00
iequidoo
abaa48d0a1 fix: Return early from receive_imf to not tombstone Iroh-Node-Addr message if webxdc instance isn't found (#8372)
An Iroh-Node-Addr message (realtime advertisement) may arrive earlier than the referenced webxdc in
case of multi-transport. By not creating a tombstone we still can receive it later on another
transport.
2026-06-29 14:33:52 -03:00
Hocuri
f6e819d2a5 refactor: improve comment (#8366)
It's unclear whether this logic works, but I think we should at least
properly document why it exists (I already sent this text while figuring
out what the code does, so it was easy making this PR now)

Could add a XXX note that it's unsure whether this works
2026-06-25 17:06:22 +00:00
Hocuri
abb84efc37 fix: Rerun the full securejoin protocol if the address was outdated (#8358)
Alternative to https://github.com/chatmail/core/pull/8355/, fixes
https://github.com/chatmail/core/issues/8329

This fixes the following bug:

Scanning QR for existing contact doesn't update relay list

Two chat partners suddenly lost connectivity to all of their relays. They added another relay, which is accessible, and set it as main. Of course, they still couldn't communicate, because there was no way to announce a new relay list to each other (clients know only about old relays so they try to send updates there).

That's why the friends used a different channel (e.g. met IRL) to send their QR codes once again.

Expected behavior: They would expect that clients update their relay lists according to the contact info inside the QR codes, and they can continue talking in Delta.

Actual behavior: But Delta Chat client doesn't update a list of announced relays on scanning a QR in case a contact already exists. It simply opens the existing chat without altering any contact info.

---------

Co-authored-by: holger krekel <holger@merlinux.eu>
2026-06-25 16:59:08 +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
iequidoo
8b80ac146f fix: Tombstone MDN before sending it (#8252)
Otherwise, when it appears on IMAP, it will mark chat messages as seen/noticed even if
markfresh_chat() is called meanwhile.
2026-06-22 13:52:04 -03:00
Hocuri
d1f4e59d82 api: Deprecate is_chatmail
BREAKING CHANGE: UIs should not behave differently for chatmail relays than for classical email servers; most usages of `is_chatmail` can be replaced by `force_encryption`
2026-06-22 17:48:56 +02: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
iequidoo
cd38aae4d6 doc: create_group_chat_unencrypted() may lead to chat split on the first device 2026-06-18 17:36:02 -03:00
link2xt
3f371b3895 refactor: remove commented out RenderedEmail.envelope 2026-06-18 17:59:56 +00:00
Jagoda Estera Ślązak
8a1d97d925 fix: Hide synced chat if we only know its visibility (#8343)
Prevents showing "empty" chat on other devices,
when pinning a chat that did not complete securejoin yet.

Fixes: #7713

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-06-18 11:42:28 +00:00
iequidoo
8f51c7b9d5 feat: Remove imap::Session::sync_seen_flags() (#7742) 2026-06-17 21:02:27 -03:00
iequidoo
fd4bf98776 feat: Add silent group changes messages as InNoticed, not InSeen
This way they also can be processed by `markseen_msgs()` resulting in self-MDNs which improves
multi-device synchronization. MDNs to contacts won't really be sent because silent group changes
messages are self-removal messages which don't request MDNs.
2026-06-17 21:02:27 -03:00
iequidoo
81dc56877c fix: Make truncated edited messages have HTML for receivers (#8249)
Otherwise it's not possible to see the full message text if it's too long in a received edit. On the
sender side let it still be text so that the message can be edited again.
2026-06-17 20:39:54 -03:00
iequidoo
58b3f0e89b fix: Make pre-messages w/o text want MDNs (#8004)
Maybe it's even good that MDNs will be sent for pre-messages only having placeholder text with the
viewtype and size, at least this way we notify the contact that we've noticed the message. Anyway,
with adding message previews the problem will be solved for the corresponding viewtypes.
2026-06-17 00:02:07 -03:00
link2xt
b860583f8d fix: request MDNs for resent channel messages 2026-06-16 14:49:49 +00:00
Hocuri
d39b79f6fc feat: Implement support for populating and maintaining a list of default relays (#8341) 2026-06-16 14:02:27 +02:00
WofWca
ab03fe3040 feat: add MsgReadCountChanged event
Useful for updating the read count on channel messages live.

This supersedes https://github.com/chatmail/core/pull/7979.
Unlike that MR, this one is not breaking.

Needed for https://github.com/deltachat/deltachat-desktop/issues/5220.
2026-06-16 11:38:07 +04: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
iequidoo
14b9577c39 feat: MsgId::get_html: Make only one db query
Merge `message::get_mime_headers()` into `MsgId::get_html()` for that, it's unlikely that it will be
used elsewhere.
2026-06-14 03:25:03 -03: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
iequidoo
b94c177997 fix: Ignore SecureJoin messages from blocked contacts (#8295)
- Ignore "vc-request-with-auth" if the sender is blocked.
- Ignore SecureJoin messages on an observing device if the joiner is blocked. Even if it's a
  "vc-contact-confirm" message, it might be issued by another device before the joiner was blocked
  on the observing device. Still, to avoid membership inconsistency on devices, don't ignore
  "vg-member-added".
- Ignore "vc-request-pubkey" if the sender is blocked by address. We don't know sender's key yet, so
  we should handle the sender as an address contact at this point.

The sender can generate a new key and still join, but it's at least an extra work and also, in case
of a group, other members will see that there's a new unknown member and be more careful.
2026-06-13 19:35:51 -03:00
iequidoo
15059ad8d7 test: exec_securejoin_qr_multi_device(): Make inviter devices receive each other messages
Otherwise we're testing an abnormal scenario when `Config::BccSelf` ("multi-device") is disabled.
2026-06-13 19:35:51 -03: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
72374
906e99a6f7 feat: Make quality of images sent in chats more consistent
Currently, the resolution of a resized image that was sent in a chat,
depends on the aspect-ratio.

Assuming the `balanced`-quality-setting is used,
a square image, that is larger than the limits for resolution and file-size,
will be resized to 1280x1280 (1,638,400 pixels),
an image with an aspect-ratio of 16:9,
will be resized to 1280x720 (921,600 pixels),
and if the aspect-ratio is 32:9, to 1280x360 (460,800 pixels).

This change makes it so, that the number of pixels,
in images with different aspect-ratios, will be similar.
2026-06-13 10:07:56 +02:00
72374
b215bc6d16 refactor: Move the definition of the target_wh-variable
to the only part of the function where it is used.
2026-06-13 10:07:56 +02:00
holger krekel
6cd5b21a26 fix: don't send or process webxdc status updates in pre-messages
it makes no sense to send or receive status updates in pre-messages for large webxdc attachments because they can't be processed anyway.
2026-06-12 17:01:46 +02: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
iequidoo
c91608e9f1 fix: Don't send removal message to contact that hasn't been a chat member (#8298)
I.e. don't fail `remove_contact_from_chat()` for such a contact because there may be a race
condition with a remote removal of the contact done without trace, but don't send a removal message
and sync message in this case and don't emit a `ChatModified` event.

If a contact is already a past member, we still send a removal message to the chat, this is safe and
protects from lost removal messages, so there's no need to complicate the code in this case.
2026-06-07 13:23:16 -03: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
Hocuri
8c56b63f21 feat: Add number_of_keys to statistics (#8297)
As of 3b29469102, all public keys except
for the currently-used one are ignored. But Delta Chat still tries to
use all _private_ keys for decryption.

This PR adds the information how many keys there are in the database. If
there is more than one, we know that the user imported their own key
back when that was possible. This info is interesting both for ourselves
and for the Cispa researchers that want to write a paper about Delta
Chat.

An alternative to this PR would be to make `key_create_timestamps`
actually contain the full list of key creation timestamps. I'm not sure
if that's worth the effort, though.

Follow-up to #8293
2026-06-03 12:36:31 +02:00
Hocuri
50e83f2072 feat: Add cryptography-related statistics (#8293)
This adds `number_of_transports`, `key_version`, `key_algorithm`,
`pubkey_size`.
2026-06-02 10:26:53 +02:00
link2xt
4a94a34c6d chore: update preloaded DNS cache 2026-06-01 11:29:25 +00:00
Hocuri
bd6c9908e4 fix: Update the channel title after joining if the QR code included a wrong title (#8260)
Fix https://github.com/chatmail/core/issues/8250. Not sure why anyone
would tamper with the link, but maybe the name gets ellipsized because
it is very long, or maybe we decide to ellipsize more aggressively in
the future.

The fix is easy enough, just set the GroupNameTimestamp when creating
the channel, so that `HeaderDef::ChatGroupNameTimestamp` gets set when
sending a message and the logic in
`apply_chat_name_avatar_and_description_changes()` recognizes the
incoming name's timestamp as newer than `chat_group_name_timestamp`
(which is 0 right after joining a chat).

The test is somewhat hacky and depends on the title being the last
parameter in the invite code URL, but this is fine; if we ever change
that, then the test will fail and we need to modify it.

This also removes some wrong doc comments.

Since groups are unpromoted until sending a first message, the same fix isn't needed for groups.
2026-06-01 08:48:01 +00:00
iequidoo
dd5ec9621b feat: Add IMAP folder to Context::get_info() (#8285)
Note that the default value "INBOX" isn't shown however.
2026-05-31 19:59:31 -03:00
iequidoo
049fd4f355 refactor: Remove misplaced comment
It was added in ff99e1997 "inital commit" and even there it looks misplaced.
2026-05-29 15:39:15 -03:00
WofWca
7a60c79301 feat: message info: add database msg ID
We have recently removed it from the normal "message info" dialog
at least on Delta Chat Desktop, so without this one can't easily find
the ID of a particular message,
which is useful for debugging.
2026-05-29 15:33:14 +04:00