Commit Graph

10456 Commits

Author SHA1 Message Date
WofWca
e73643cd18 WIP: refactor: move draft reuse decision logic deeper 2026-08-02 19:25:35 +04:00
WofWca
2a6aad3abe fix: get_draft possibly returning non-draft msg
Due to a gap between `get_draft_msg_id()` and `Message::load_from_db`.
Possibly can happen if the draft gets sent
while `get_draft()` is in progress.
2026-08-02 15:25:09 +04:00
WofWca
486c206d92 fixup! fix: set_draft mutating real messages (race)
always assign msg.id in do_set_draft
2026-08-02 15:25:09 +04:00
WofWca
664f941a1c fix: set_draft mutating real messages (race)
The issue has been introduced in
cf33db3dcb
(https://github.com/chatmail/core/pull/2887).

This, again, has to do with a race where the draft message
is sent in another Future after `get_draft` but before `sql.execute`.

Related:
- 07fa9c35ee
  (https://github.com/chatmail/core/pull/6052).
- df4fd82140
  (https://github.com/chatmail/core/pull/6061).
2026-08-02 15:25:09 +04:00
WofWca
eaf0533232 fixup! fix: don't send an already sent draft
fix format
2026-08-02 15:24:47 +04:00
WofWca
f26cb8044f fixup! fix: don't send an already sent draft
always assign msg.id
2026-08-01 15:19:08 +04:00
WofWca
6bd1b57a6b fixup! fix: don't send an already sent draft
factor out `have_draft_with_id`, simplify ID check
2026-08-01 15:18:49 +04:00
WofWca
00022cf2d1 fixup! test: add test_dont_send_sent_draft
clippy test
2026-07-31 13:20:31 +04:00
WofWca
b9cf769924 fixup! test: add test_dont_send_sent_draft 2026-07-31 13:20:31 +04:00
WofWca
d0902bded2 fix: don't send an already sent draft
Calling `send_msg()` with a draft message that was already sent
(by specifying `msg.id`)
would mutate that message in the DB and try to send it again.

Additionally, `prepare_msg_raw` now errors out
if the draft is not present in the database.
Previosuly the `UPDATE` query would simply update 0 rows
and we would proceed with trying to send a message
without having it in the `msgs` table.

The bug has been introduced in cf33db3dcb
(https://github.com/chatmail/core/pull/2887).

Semantically this makes `prepare_msg_raw` API less generic,
narrowing down its `update_msg_id` function only to drafts.
The "update draft" is anyway the only use case so far
for this parameter.
Thus this also removes the ability to specify an ID
that is different from `msg.id`, as was suggested in
https://github.com/chatmail/core/pull/2887#discussion_r767256419.
These IDs were always the same anyway.

Maybe it would make sense to, instead of returning an error
if the draft is already sent or does not exist,
simply upsert a new message without looking at `msg.id`,
as we would do with non-draft `msg.state`s,
but I wasn't sure how CFFI users (DC Android and DC iOS)
would take that.
So for now let's simply return an error instead of messing up the DB.
2026-07-31 13:20:28 +04:00
WofWca
a122bd4638 test: add test_dont_send_sent_draft
Currently failing due to a bug.
2026-07-29 16:00:01 +04:00
WofWca
7223d7ed74 refactor: un-nest prepare_msg_blob 2026-07-28 12:22:42 +04: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
holger krekel
00e1d00dfa fix: send MDNs to all authentic relays of a contact, not just whatever get_addr() returns. 2026-07-27 21:54:42 +02:00
holger krekel
856ea29c47 feat: reduce unncessary gossipping of keys in group chats
- treat an Autocrypt header as a kind of Autocrypt-Gossip: addr=<self>
  letting it participate in the existing cooperative key gossipping mechanics.

- speed up processing of incoming autocrypt-gossip headers by using
  1 sql commit for N gossip headers instead of the current N commits.
2026-07-27 21:54:42 +02:00
holger krekel
6a07a2b222 feat: send Autocrypt pgp key in MDNs occassionally and when relaylist changes 2026-07-27 21:54:42 +02:00
holger krekel
411ad16ea9 fix(deltachat-rpc-client): don't depend on execnet for importing pytest plugin, remove deprecated "py" usage
unsuspecting consumers will otherwise require execnet to run pytest with deltachat-rpc-client installed.
"import py" is discouraged for pytest these days but still supported in compatibility mode.
2026-07-27 21:45:34 +02:00
Jagoda Estera Ślązak
afb1d0dba8 refactor: Unify naming of direct/single/1:1/normal chats (#8442)
Unifies internal naming of single/direct/1:1/normal chats
to match the naming used in the API.

Closes: #8368
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>

---------

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-07-27 16:31:09 +02:00
Jagoda Estera Ślązak
df4197df56 fix: Don't warn about correct EXIF orientation values. (#8483)
`unwrap_or` is eagerly evaluated,
which caused always printing the WARN log,
even if EXIF orientation value is correct
(and not ignored).

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-07-27 14:08:14 +00:00
WofWca
9b7b32a536 docs: clarify ChatId::do_set_draft() docs
Related:
- https://github.com/chatmail/core/pull/6212.
- https://github.com/chatmail/core/pull/2887.
2026-07-27 17:18:37 +04:00
Hocuri
682baff1b9 refactor: Remove FolderMeaning and target_folder (#8456)
The `FolderMeaning` and the `target_folder()` function and related code
were needed for the message moving logic. The message moving logic isn't
needed anymore, so, this PR is a first step to remove it.

We only ever look at one folder by now (usually the Inbox folder), so,
any message moving logic isn't needed anymore because we will never
notice a message that is supposed to be moved.

The `target` column of the `imap` table is mostly the same as the
`folder` column now. Except when the message is supposed to be deleted,
then it's an empty string.
2026-07-27 14:53:58 +02: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
dependabot[bot]
e2dd9b06e2 chore(cargo): bump regex from 1.12.4 to 1.13.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.12.4 to 1.13.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.12.4...1.13.1)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:49:44 +00:00
dependabot[bot]
cc41a9ea27 chore(cargo): bump tokio from 1.52.3 to 1.53.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.52.3 to 1.53.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.52.3...tokio-1.53.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.53.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:48:47 +00:00
dependabot[bot]
dff8fdb293 chore(cargo): bump futures from 0.3.32 to 0.3.33
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.32 to 0.3.33.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.32...0.3.33)

---
updated-dependencies:
- dependency-name: futures
  dependency-version: 0.3.33
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:47:34 +00:00
dependabot[bot]
85c407ab05 chore(deps): bump zizmorcore/zizmor-action from 0.5.7 to 0.6.0
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.7 to 0.6.0.
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](192e21d79a...6599ee8b7a)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:47:03 +00:00
dependabot[bot]
891a7f905d chore(deps): bump actions/setup-python from 6 to 6.3.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 6.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v6.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 17:46:48 +00:00
link2xt
55ede9f2f6 ci: update github actions monthly instead of weekly 2026-07-25 14:21:44 +00:00
holger krekel
7e5c1e8389 chore: bump version to 2.58.0-dev 2026-07-25 16:03:53 +02:00
holger krekel
758fb9daa0 chore(release): prepare for 2.57.0 v2.57.0 2026-07-25 15:47:44 +02:00
holger krekel
cd4850668f fix: migrate transports configured on 2.56 to also have a oauth:false flag
also fix test setup to include the oauth:false flag
2026-07-25 15:38:29 +02:00
Hocuri
98a902b2de fix: Re-add oauth2 to serialized structs (#8464)
fix https://github.com/chatmail/core/issues/8463

Followup to https://github.com/chatmail/core/pull/8431: Re-dd `oauth2`
to the two structs that serialized and sent over the wire. This solves
an incompatibility problem where transports could not be synced to older
versions of DC, and profiles could not be transferred, because the
deserializer expected the field to be present.

I now added `#[serde(default)]`, so that with this PR, Delta Chat will
be compatible with both v2.56 and with older versions.
2026-07-25 14:12:06 +02:00
dependabot[bot]
071358c605 chore(cargo): bump quinn-proto from 0.11.14 to 0.11.16
Bumps [quinn-proto](https://github.com/quinn-rs/quinn) from 0.11.14 to 0.11.16.
- [Release notes](https://github.com/quinn-rs/quinn/releases)
- [Commits](https://github.com/quinn-rs/quinn/compare/quinn-proto-0.11.14...quinn-proto-0.11.16)

---
updated-dependencies:
- dependency-name: quinn-proto
  dependency-version: 0.11.16
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 22:38:39 +00:00
dependabot[bot]
82861a6903 chore(deps): bump taiki-e/install-action from 2.82.10 to 2.83.4
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.82.10 to 2.83.4.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](50414676f9...07b4745e0c)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.83.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 20:33:35 +00:00
dependabot[bot]
ed6a335e9e chore(deps): bump EmbarkStudios/cargo-deny-action from 2.0.20 to 2.1.1
Bumps [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action) from 2.0.20 to 2.1.1.
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](bb137d7af7...3c6349835b)

---
updated-dependencies:
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 13:48:21 +00:00
link2xt
234e491172 fix: never merge outer To headers if standard header protection is used 2026-07-24 11:59:59 +00:00
B. Petersen
6a981ebef3 docs: remove oauth2 from standards 2026-07-24 13:24:47 +02:00
holger krekel
7ec888f48a remove hermes/aco-connexion special casing and simplify/address link2xt comments 2026-07-24 13:22:13 +02:00
holger krekel
eccd5ce03a address link2xt comments 2026-07-24 13:22:13 +02:00
holger krekel
3c171d539b fixup CI failures 2026-07-24 13:22:13 +02:00
holger krekel
0a71e181e4 add nauta.cu, hermes.radio and *.aco-connexion.org legacy options 2026-07-24 13:22:13 +02:00
holger krekel
1ac1917172 api!: remove provider-db handling and provider lookup APIs
BREAKING CHANGE: provider lookup APIs were removed from CFFI and JSON-RPC.

also removes offline provider database code and generated provider data,
provider-specific fields in configure/transport paths, and REPL providerinfo.
2026-07-24 13:22:13 +02:00
B. Petersen
7e257aa25f refactor: use correct variable name 2026-07-24 10:10:55 +02:00
dependabot[bot]
b448694006 chore(deps): bump cachix/install-nix-action from 31.10.6 to 31.11.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.10.6 to 31.11.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](8aa03977d8...630ae543ea)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.10.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 02:48:27 +00:00
holger krekel
461a328915 api!: remove heartbeat push notifications
Heartbeat notifications are only used on iOS for classic mail servers
but both code and privacy wise (notification server sees IP addresses from those users)
not something we want to support any longer (was discussed with bjoern).
2026-07-24 00:04:14 +02:00
holger krekel
0e4574cd41 feat: read SMTP recipient limit from relay IMAP metadata
Remove is_chatmail flag, and rely on IMAP metadata
advertising the recipients limit (usually 1000),
falling back to 50 (or fewer in some exceptional cases)
just as before when is_chatmail was false.

Also, server metadata is now keyed per transport,
which in the future eases collecting ICE servers
from all relays (instead of just any first relay).
2026-07-22 20:31:50 +02: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
dependabot[bot]
4e2238a38f chore(deps): bump actions/setup-node from 6 to 7
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 19:57:42 +00:00