Commit Graph
100 Commits
Author SHA1 Message Date
link2xt 4ee65a049f fix: always exit fake IDLE after at most 60 seconds
Do not call `fetch_new_messages`,
always exit and let the IMAP loop
prepare the connection properly and run all pending tasks.
2024-11-01 21:28:22 +00:00
link2xt ded8c02c0f fix(send_msg_to_smtp): do not fail if the message does not exist anymore
If the number of retries for message is exceeded,
do not fail when marking it as failed if the message does not exist.
Otherwise we may never delete the message from SMTP queue
because corresponding msg_id is not valid anymore.
2024-11-01 13:39:24 +00:00
link2xt cbca5101b1 fix: do not percent-encode dot when passing to autoconfig server
The server should decode the URL and according to RFC 3986
query parameters may or may not be URL-encoded,
but at some servers don't decode the dot correctly.

`@` is decoded correctly by autoconfig.murena.io
2024-11-01 00:27:22 +00:00
link2xt 4850e3696d chore(cargo): upgrade iroh to 0.26.0 2024-10-31 02:17:37 +00:00
l 55702e4985 fix: skip IDLE if we got unsolicited FETCH (#6130)
This may indicate that there was a new \Seen flag
that we don't want to skip.

Also don't drain unsolicited responses while scanning folders. Now we
only drain unsolicited responses right before IDLE and always redo the
whole fetch cycle if there have been some. Some message in the scanned
folder may not be fetched that would be previously fetched otherwise,
but it will be picked up on the next folder scan.
2024-10-30 02:38:15 +00:00
link2xt 146bcfe455 chore(release): prepare for 1.148.5 2024-10-27 17:03:49 +00:00
link2xt f57cdc3a2c Revert "build: nix flake update fenix"
This reverts commit aa3ef5011b.

This fixes `nix build .#deltachat-rpc-server-armeabi-v7a-android`.
2024-10-27 16:53:49 +00:00
link2xt e11fddf9aa ci: take CHATMAIL_DOMAIN from variables instead of secrets 2024-10-26 16:44:28 +00:00
link2xt f396ff4297 fix: do not lock the account manager for the whole duration of background_fetch 2024-10-26 16:38:43 +00:00
link2xt 51a1762228 fix: do not take write lock for maybe_network_lost() and set_push_device_token() 2024-10-26 16:38:43 +00:00
link2xt 69b4c0ccb4 refactor: factor out add_gossip_peer_from_header()
Also don't even add the peer to SQL if realtime is disabled.
2024-10-25 19:25:51 +00:00
link2xt fc2b111f5d chore(release): prepare for 1.148.4 2024-10-24 20:25:58 +00:00
link2xt 913d2c45b3 fix: do not wait for connections in maybe_add_gossip_peers()
join() method of Gossip [1]
waits for at least one connection
and this is not what we want
because it may block receive_imf()
forever if no connection arrives.

[1] https://docs.rs/iroh-gossip/0.25.0/iroh_gossip/net/struct.Gossip.html#method.join
2024-10-24 19:59:00 +00:00
link2xt e32d676a08 fix: normalize proxy URLs before saving into proxy_url 2024-10-24 16:43:10 +00:00
link2xt bc7568e39b chore(release): prepare for 1.148.3 2024-10-24 14:08:59 +00:00
link2xt 11bf1c45d2 test: test that realtime advertisements work after chatting 2024-10-24 13:56:04 +00:00
link2xt 122c23ad4e api(deltachat-rpc-client): add EventType.WEBXDC_REALTIME_ADVERTISEMENT_RECEIVED 2024-10-24 13:56:04 +00:00
link2xt a0bde4699e fix: fix reception of realtime advertisements 2024-10-24 13:56:04 +00:00
link2xt ac01a4a771 feat: allow sending realtime messages up to 128 KB in size
Previous default value was 4 KiB.
2024-10-24 13:55:28 +00:00
link2xt 51f2a8d59e refactor: generate topic inside create_iroh_header() 2024-10-23 22:33:09 +00:00
link2xt acd7a1d17e chore(release): prepare for 1.148.2 2024-10-23 17:52:24 +00:00
link2xt db6d451c90 feat: add more logging for iroh initialization and peer addition 2024-10-23 17:48:33 +00:00
link2xt 4b3a6445fb fix: never initialize Iroh if realtime is disabled 2024-10-23 17:48:33 +00:00
link2xt aa3ef5011b build: nix flake update fenix 2024-10-23 03:31:39 +00:00
link2xt 1d3072c287 build: nix flake update nixpkgs 2024-10-23 03:19:33 +00:00
link2xt 4fb59177fa chore(release): prepare for 1.148.1 2024-10-23 02:37:22 +00:00
link2xt d841bcb41e Revert "build: nix flake update"
This reverts commit 6f22ce2722.
2024-10-23 02:07:22 +00:00
link2xt d205bc410b chore(release): prepare for 1.148.0 2024-10-23 00:27:49 +00:00
link2xt a55e33fbc7 fix(sql): run PRAGMA incremental_vacuum on a write connection
Otherwise it always fails with SQLITE_READONLY:
```
WARNING src/sql.rs:769: Failed to run incremental vacuum: attempt to write a readonly database: Error code 8: Attempt to write a readonly database.
```
2024-10-22 23:23:57 +00:00
link2xt 7424d06416 refactor(sql): move write mutex into connection pool 2024-10-21 19:14:37 +00:00
link2xt aa71fbe04c refactor: resultify get_self_fingerprint() 2024-10-21 13:03:58 +00:00
link2xt c5cadd9991 feat: add in-memory cache for DNS
This adds "stale-while-revalidate" in-memory cache for DNS. Instead of
calling `tokio::net::lookup_host` we use previous result of
`tokio::net::lookup_host` immediately and spawn revalidation task in the
background. This way all lookups after the first successful one return
immediately.

Most of the time results returned by resolvers are the same anyway, but
with this cache we avoid waiting 60 second timeout if DNS request is
lost. Common reason result may be different is round-robin DNS load
balancing and switching from IPv4 to IPv6 network. For round-robin DNS
we don't break load balancing but simply use a different result, and for
IPv6 we anyway likely have a result in persistent cache and can use IPv4
otherwise.

Especially frequent should be the case when you send a message over SMTP
and SMTP connection is stale (older than 60 s), so we open a new one.
With this change new connection will be set up faster as you don't need
to wait for DNS resolution, so message will be sent faster.
2024-10-21 10:46:11 +00:00
link2xt 94c6d1dea4 fix: call update_connection_history for proxified connections 2024-10-20 18:36:37 +00:00
link2xtandiequidoo 06a6cc48d2 feat(sql): set PRAGMA query_only to avoid writing on read-only connections
Co-authored-by: iequidoo <dgreshilov@gmail.com>
2024-10-20 14:51:46 +00:00
link2xt 6f22ce2722 build: nix flake update 2024-10-20 06:01:30 +00:00
link2xt 5e58bf7575 feat: add more context to send_msg errors 2024-10-19 20:52:30 +00:00
link2xt 85d7c1f942 ci: update Rust to 1.82.0 2024-10-19 20:31:30 +00:00
link2xt 65b970a191 test: fix test_securejoin_after_contact_resetup flakiness 2024-10-18 15:36:21 +00:00
link2xt 5e13b4c736 feat: log when late Autocrypt header is ignored 2024-10-18 15:36:21 +00:00
link2xt 864833d232 fix: increase MAX_SECONDS_TO_LEND_FROM_FUTURE to 30
5 seconds is easy to exhaust
by running securejoin, especially
when it happens in automatic tests.

This may however easily affect bots as well.
2024-10-17 22:22:14 +00:00
link2xt 3d07db6e62 feat: log the logic for (not) doing AEAP 2024-10-17 22:22:14 +00:00
link2xt 9e88764a8a test(test_aeap_flow_verified): do not start ac1new
ac1new is an account that is only used
to get a new address for ac1.
It should not even be started
and run IMAP loop.
2024-10-17 22:21:54 +00:00
link2xt e70b879182 test: make test_verified_group_member_added_recovery more reliable
To avoid reordering, wait for "member removed" message
to be received before sending "member added".
The test failed at least once
because email server may reorder the messages internally
while delivering.
2024-10-17 15:11:10 +00:00
link2xt 00d296e1ff test(test_aeap_flow_verified): wait for "member added" before sending messages (#6057)
Otherwise instead of "old address"
ac2 may receive "member added",
resulting in this failure:
```
>       assert msg_in_1.text == msg_out.text
E       AssertionError: assert 'Member Me (c...hat.computer.' == 'old address'
E         - old address
E         + Member Me (ci-hfpxxe@***) added by ci-8e7mkr@***.
```
2024-10-17 15:10:55 +00:00
link2xt e07f1a8b9c docs: fix too_long_first_doc_paragraph clippy lint
This lint is enabled for beta and nightly Rust.
2024-10-17 14:29:03 +00:00
link2xt 02b9085147 feat: prioritize cached results if DNS resolver returns many results
This ensures we do not get stuck trying DNS resolver results
when we have a known to work IP address in the cache
and DNS resolver returns garbage
either because it is a captive portal
or if it maliciously wants to get us stuck
trying a long list of unresponsive IP addresses.

This also limits the number of results we try to 10 overall.
If there are more results, we will retry later
with new resolution results.
2024-10-17 11:55:14 +00:00
link2xt 07fa9c35ee fix: replace old draft with a new one atomically
This prevents creation of multiple drafts per chat.
2024-10-17 11:52:50 +00:00
link2xt 7db7c0aab1 refactor: use HeaderDef constant for Chat-Disposition-Notification-To 2024-10-17 07:10:54 +00:00
link2xt 30b23df816 docs: document MimeFactory.req_mdn 2024-10-17 07:10:54 +00:00
link2xt 4efd0d1ef7 test: always gossip if gossip_period is set to 0
This fixes flakiness of `test_verified_group_vs_delete_server_after`.
2024-10-15 22:55:33 +00:00
link2xt f14880146a feat(deltachat-repl): built-in QR code printer
Print QR codes with Rust code
instead of depending on external `qrencode`.
2024-10-15 22:55:20 +00:00
link2xt 3a72188548 test(test_qr_setup_contact_svg): stop testing for no display name
It is impossible to set no display name anyway
in Delta Chat Android at least
because we don't want email addresses
in the UI.

This test does not work with long domains
that may get wrapped, so better remove it
instead of trying to prevent wrapping of domains.
2024-10-15 17:35:38 +00:00
link2xt 351f28361d docs: set_protection_for_timestamp_sort does not send messages
It only adds info messages.
2024-10-15 09:14:23 +00:00
link2xt c5b78741d6 refactor: fix clippy::needless_lifetimes warnings 2024-10-15 09:14:23 +00:00
link2xt 57871bbaf8 refactor(set_protection_for_timestamp_sort): do not log bubbled up errors
Otherwise error may be logged twice.
2024-10-15 09:14:23 +00:00
link2xt 287256693c refactor: fix elided_named_lifetimes warning in beta Rust 2024-10-15 09:14:23 +00:00
link2xt f1ca689f99 feat: IMAP COMPRESS support 2024-10-14 14:01:22 +00:00
link2xt 2ea5c86a5a chore(release): prepare for 1.147.1 2024-10-13 18:40:33 +00:00
link2xt 19be12a25d chore(cargo): upgrade async_zip to 0.0.17 (#6035) 2024-10-11 00:17:40 +00:00
link2xt 6a121b87eb fix: do not emit progress 1000 when configuration is cancelled
There is already code below that emits
progress 0 or 1000 depending on whether
configuration succeeded or failed.

Before this change cancelling resulted
in progress 0 emitted,
immediately followed by progress 1000.
2024-10-10 10:34:58 +00:00
link2xt 420c0ed9b0 build(deltachat-rpc-client): add classifiers for all supported Python versions 2024-10-10 07:18:06 +00:00
link2xt e05bb03db6 build: build Python 3.13 wheels 2024-10-10 07:18:06 +00:00
link2xt 73fcb97eef ci: update to Python 3.13 2024-10-10 07:18:06 +00:00
link2xt b7be0b7bf6 chore(release): prepare for 1.147.0 2024-10-05 18:04:17 +00:00
link2xt 2cb8b53256 fix: emit progress 0 if get_backup() fails 2024-10-05 17:58:24 +00:00
link2xt a592a470cf fix: make backup reception cancellable by stopping ongoing process
This is already documented in JSON-RPC API,
but in fact ongoing process was not allocated.
2024-10-05 17:58:24 +00:00
link2xt c4d07ab99e fix: smooth progress bar for backup transfer
Before this change progress bar only started
when database is already transferred.
Database is usually the largest file
in the whole transfer, so the transfer appears
to be stuck for the sender.

With this change progress bar
starts for backup export
as soon as connection is received
and counts bytes transferred over the connection
using AsyncWrite wrapper.

Similarly for backup import,
AsyncRead wrapper counts the bytes
received and emits progress events.
2024-10-05 17:58:24 +00:00
link2xt eddd5a0d25 fix: make it possible to cancel ongoing backup transfer 2024-10-05 17:58:24 +00:00
link2xt 0f43d5d8f4 fix: break out of accept() loop if there is an error transferring backup 2024-10-05 17:58:24 +00:00
link2xt 2e6d3aebae docs(CONTRIBUTING.md): add more SQL advices 2024-10-05 13:09:49 +00:00
link2xt 650995dc41 feat(deltachat-repl): print send-backup QR code to the terminal 2024-10-04 22:53:30 +00:00
link2xt 283a1f1653 fix: skip unconfigured folders in background_fetch()
Otherwise `background_fetch()` fails on unconfigured Mvbox,
which is typical for chatmail accounts,
and does not get to checking QUOTA ever.
2024-10-04 21:54:42 +00:00
link2xt d33909a054 feat: reuse existing connections in background_fetch() if I/O is started 2024-10-04 21:54:42 +00:00
link2xt 129be3aa27 feat(deltachat-repl): add fetch command to test background_fetch() 2024-10-04 15:52:59 +00:00
link2xt 8a88479d8f fix(query_row_optional): do not treat rows with NULL as missing rows
Instead of treating NULL type error
as absence of the row,
handle NULL values with SQL.
Previously we sometimes
accidentally treated a single column
being NULL as the lack of the whole row.
2024-10-04 14:43:06 +00:00
link2xt 46922d4d9d fix: do not attempt to reference info messages
Info messages are added
at the beginning of unpromoted group chats
("Others will only see this group after you sent a first message."),
may be created by WebXDC etc.

They are not sent outside
and have local Message-ID that
is not known to other recipients
so they should be skipped when constructing
In-Reply-To and References.
2024-10-03 21:49:58 +00:00
link2xt 75fe4e106a api!: remove deprecated get_next_media() APIs 2024-10-03 21:04:03 +00:00
link2xt fa9bd7f144 chore(release): prepare for 1.146.0 2024-10-03 17:21:42 +00:00
link2xt 22e5bf8571 fix(download_msg): do not fail if the message does not exist anymore
Without this fix IMAP loop may get stuck
trying to download non-existing message over and over
like this:
```
src/imap.rs:372: Logging into IMAP server with LOGIN.
src/imap.rs:388: Successfully logged into IMAP server
src/scheduler.rs:361: Failed to download message Msg#3467: Message Msg#3467 does not exist.
src/scheduler.rs:418: Failed fetch_idle: Failed to download messages: Message Msg#3467 does not exist
```

The whole download operation fails
due to attempt to set the state of non-existing message
to "failed". Now download of the message
will "succeed" if the message does not exist
and we don't try to set its state.
2024-10-03 17:13:53 +00:00
link2xt c8ba516e83 refactor(decode_ideltachat): construct error message lazily 2024-10-03 15:39:27 +00:00
link2xt 78a0d7501b feat: use Rustls instead of native TLS for HTTPS requests
HTTPS requests are used to fetch
remote images in HTML emails,
to fetch autoconfig XML,
to POST requests for `DCACCOUNT:` QR codes
to make OAuth 2 API requests
and to connect to HTTPS proxies.

Rustls is more aggressive than OpenSSL
in deprecating cryptographic algorithms
so we cannot use it for IMAP and SMTP
to avoid breaking compatibility,
but for HTTPS requests listed
above this should not result in problems.

As HTTPS requests use only strict TLS checks,
there is no `strict_tls` argument
in `wrap_rustls` function.

Rustls is already used by iroh,
so this change does not introduce new dependencies.
2024-09-26 22:35:44 +00:00
link2xt 638da904e7 refactor: merge build_tls() function into wrap_tls() 2024-09-26 22:35:44 +00:00
link2xt 02db6bcb8e chore(release): prepare for 1.145.0 2024-09-26 19:22:10 +00:00
link2xt 4b74c9d85f fix: avoid changing delete_server_after default for existing configurations 2024-09-26 19:18:12 +00:00
link2xt 040ac0ffe3 refactor: do not wrap shadowsocks::ProxyClientStream
Updated `shadowsocks` implements `Debug` for the type,
so there is no need to wrap it.
2024-09-26 14:28:08 +00:00
link2xt bfef129dbf chore: sort dependency list 2024-09-22 18:00:55 +00:00
link2xt 486ea3a358 chore(release): prepare for 1.144.0 2024-09-21 18:53:02 +00:00
link2xt 624ae86913 api!: make QR code type for proxy not specific to SOCKS5 (#5980) 2024-09-21 18:26:07 +00:00
link2xt b47b96d5d6 chore(cargo): update iroh to 0.25
According to
<https://www.iroh.computer/blog/iroh-0-25-0-custom-protocols-for-all>
gossip now handles updating direct addresses automatically.
2024-09-20 22:56:24 +00:00
link2xt f6b5c5d150 feat: generate 144-bit group IDs
Instead of generating 72 random bits
and reducing them to 66 bits of Base64 characters,
generate 144 bits (18 bytes)
which is exactly 24 Base64 characters.

This should still be accepted by existing
Delta Chat clients which expect group ID
to be between 11 and 32 characters.

Message-ID creation is also simplified
to not have `Mr.` prefix
and dot in between two IDs.
Now it is a single ID followed by `@localhost`.

Some outdated documentation comments
are removed, e.g. group messages
don't start with `Gr.` already.
2024-09-20 22:38:28 +00:00
link2xt 9cc65c615c feat(smtp): more verbose SMTP connection establishment errors
The greeting is now always read manually,
even for STARTTLS connections,
so the errors returned on failure to read form the stream
are the same regardless of the connection type.
2024-09-20 20:37:47 +00:00
link2xt 60cd6f56be chore(cargo): update lazy_static to 1.5.0
This removes duplicate `spin` dependency.
2024-09-18 15:31:13 +00:00
link2xt 060fd55249 feat: HTTP(S) tunneling
HTTP proxy is tested with deltachat-repl
against local Privoxy
using
```
> set proxy_url http://127.0.0.1:8118/
> setqr dcaccount:https://nine.testrun.org/new
> configure
> connect
```
2024-09-18 10:52:31 +00:00
link2xt 38c7f7300e Partially revert "test(test-data): remove public keys that can be derived from secret keys" (#5977)
This reverts commit 1caf672904.

Otherwise public key signature is regenerated each time the key is
loaded and test `key::tests::test_load_self_existing` which loads the
key twice fails when two loads happen on different seconds.

Closes #5976
2024-09-18 09:48:01 +00:00
link2xt f7a705c6da refactor: use KeyPair::new() in create_keypair() 2024-09-16 20:51:16 +00:00
link2xt 7efb5a269c docs(CONTRIBUTING.md): document how to format SQL statements 2024-09-16 18:11:42 +00:00
link2xt 1caf672904 test(test-data): remove public keys that can be derived from secret keys 2024-09-16 17:00:16 +00:00
link2xt 7743072411 refactor: remove addr from KeyPair 2024-09-16 17:00:16 +00:00
link2xt c461c4f02e refactor: do not store deprecated addr and is_default into keypairs 2024-09-16 17:00:16 +00:00
link2xt afb01e3e90 chore: update provider database
This change removes OAuth2 for Gmail
as Delta Chat does not have a working
client ID anymore.
Tests are adjusted to test against Yandex
and MX queries for OAuth2 are always disabled
because they were only used to detect Google Workspace.
2024-09-13 17:58:25 +00:00