Commit Graph

1988 Commits (feature/async-job-delay-wait)
 

Author SHA1 Message Date
Manos Pitsidianakis ec1cc8100e
WIP implement wait/delay for scheduled jobs
This will allow scheduling reconnect attempts in the future instead of
sleeping inside the async job. Then, the reconnect job won't appear
active until its time to run has arrived. The frontend can then inspect
reconnect attempts and display messages like "Retrying in X time" to the
user.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis b3858de2f4
melib/error: impl From<io::ErrorKind> for ErrorKind
We inspect errors in the frontend to check for network errors. If the
network error comes from std::io, this would get converted to an Error
with description "timed out", kind OSError, and source the actual
networking error.

This commit converts network std::io::ErrorKinds into appropriate
native ErrorKinds.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis dc2b00442b
melib: run rustfmt and cargo-sort 9 months ago
Manos Pitsidianakis da8e810448
melib/connections: remove leftover debug prints 9 months ago
Damian Poddebniak 4f6081b663 chore: Update to `imap-codec 1.0.0-beta`. 9 months ago
Manos Pitsidianakis 67d2da0f88
ci: disable smtp::test::test_smtp in test.yaml
For some network-inside-docker reason this test fails, even thought it
works on my machines(TM).
10 months ago
Manos Pitsidianakis df638cceec
melib/connections: remove stale failing doc code example
This leftover doc test/example was failing to compile, so remove it.
10 months ago
Manos Pitsidianakis 97d3686815
melib/connections: use Happy Eyeballs algorithm Ꙭ
This commit adds a Happy Eyeballs [1] implementation taken from the
happy-eyeballs crate, which is in public domain.

While the function lookup_ip[0] iterates through the addresses returned by
A and AAAA records from a DNS lookup, it returns the first one  which
always is an IPv4 address, unless there only is an AAAA record.

RFC6555 [1] recommends an algorithm for choosing the fastest address to
connect to, called "Happy Eyeballs". Ꙭ

[0]: melib/src/utils/connections.rs:497
[1]: https://www.rfc-editor.org/rfc/rfc6555

Fixes #268
10 months ago
kdwarn 6578a56668 Update cargo install directions
The release available on crates.io is 2 years old and would not compile ("enum `TokenTree` is private"), but installing from repo works.
10 months ago
Manos Pitsidianakis 0f60009ea9
Makefile: add RUSTFLAGS with -D warnings 10 months ago
Manos Pitsidianakis 5c2b04719b
Normalize std::fmt::* imports 10 months ago
Manos Pitsidianakis 7c9a4b4b7c
meli: Move components/mail -> mail 10 months ago
Manos Pitsidianakis 64ab65ddff
meli: Move components/contacts -> contacts 10 months ago
Manos Pitsidianakis 005bf3881e
meli: Move components/utilities -> utilities 10 months ago
Manos Pitsidianakis a5446975c2
terminal: move braille and screen to their own module files 10 months ago
Manos Pitsidianakis 7c7f6e1923
melib/thread: don't increase Thread length for duplicates
If an envelope that was already in the Threads object was inserted,
the only modification would be to erroneously increase the Thread len by
one.
10 months ago
Manos Pitsidianakis 84081f4ed7
melib/nntp: minor style fix 10 months ago
Manos Pitsidianakis bf543855dc
melib/email: add PartialEq<str> for MessageID 10 months ago
Manos Pitsidianakis 448e0635e0
melib/nntp: log error when command length exceeds 512 octets
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

This commit adds a log::error entry when any sent command exceeds that
limit and recommends the user to report this as a bug.
10 months ago
Manos Pitsidianakis 4e654d2d02
melib/nntp: limit LIST ACTIVE command length to 512 octets
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

Sending a `LIST ACTIVE` command with lots of newgroups and passing the
512 byte limit is therefore invalid. This commit splits the mailboxes in
chunks and sends a separate command for each maximal chunk that has
a valid length.

Fixes #269.

Reported-by: r3k2
10 months ago
Manos Pitsidianakis 40d4ecefa0
melib/nntp: accept invalid (non-ascii) address comment text
NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.

Fixes #269.
10 months ago
Manos Pitsidianakis 0ee1b6e018
account: start background watch job in init
When IsOnline was introduced, the background watch job stopped being
created when the connection was initialized. Restore that behavior.
10 months ago
Manos Pitsidianakis 8cb2a515e1
melib/smtp: use localhost in lieu of 127.0.0.1 for CI 10 months ago
Manos Pitsidianakis 6e27edcb77
ci: use cargo-nextest 10 months ago
Manos Pitsidianakis ae25ffba43
melib/smtp: don't do plain EHLO before starting Tls connection 10 months ago
Manos Pitsidianakis 1e084c1d85
melib: move backends out of the backends module
No reason to have such a deep module tree.
10 months ago
Manos Pitsidianakis 9216e7bc65
melib/connections: add opt id string for tracing 10 months ago
Manos Pitsidianakis 8ecdb6df31
melib/imap: add imap-trace feature 10 months ago
Manos Pitsidianakis b65934facc
melib/nntp: add nntp-trace feature 10 months ago
Manos Pitsidianakis 89c90f224a
melib: add `nntp` feature 10 months ago
Manos Pitsidianakis 7db930cabd
melib: rename `jmap_backend` feature to `jmap` 10 months ago
Manos Pitsidianakis e9f09a153c
melib: rename `mbox_backend` feature to `mbox` 10 months ago
Manos Pitsidianakis fe7dcc508e
melib: rename `notmuch_backend` feature to `notmuch` 10 months ago
Manos Pitsidianakis fe027fa300
melib: rename `maildir_backend` feature to `maildir` 10 months ago
Manos Pitsidianakis 129f10911b
melib: rename `imap_backend` feature to `imap` 10 months ago
Manos Pitsidianakis 51e9fbe8f2
sqlite3: add account_name identifier to sqlite3 index database name 10 months ago
Manos Pitsidianakis 4874e30f3c
melib: add smtp-trace feature
If it's enabled, every read/write in an SMTP transaction will be logged
on TRACE level.
10 months ago
Manos Pitsidianakis 073d43b9b8
melib/test: move data files to data subdir 10 months ago
Manos Pitsidianakis 8e698cabcf
Fix unreachable-pub and disjoint-capture lint errors 10 months ago
Manos Pitsidianakis 1d0405ed5b
ci: add env vars 10 months ago
Manos Pitsidianakis bb7e119ade
Add gitea CI workflows 10 months ago
Manos Pitsidianakis 29b43e2c88
melib/datetime: replace mktime with timegm 10 months ago
Manos Pitsidianakis 2df7354751
mail/{listing,view}: fix overflow substracts 10 months ago
Manos Pitsidianakis 6280bc75e5
melib/jmap: fix blob download URL formatting 10 months ago
Manos Pitsidianakis 48a10f7241
melib: remove unused BackendOp::fetch_flags() method 10 months ago
Manos Pitsidianakis 0219dc8707
melib/jmap: respect max_objects_in_get when fetching email
Fixes #144
10 months ago
Manos Pitsidianakis c4c245ee19
melib/jmap: respect danger_accept_invalid_certs setting 10 months ago
Manos Pitsidianakis 53cba4beee
Update README.md relative file paths 11 months ago
Manos Pitsidianakis 561ba9c87b
listing: add relative_list_indices setting for thread listing 11 months ago
Manos Pitsidianakis 8abc9358a7
mail/pgp: add newline after Version: 1 header 11 months ago