Commit Graph

1069 Commits

Author SHA1 Message Date
Manos Pitsidianakis
974502c6ff
melib/addressbook: impl Hash for Card
Implement hashing for Card.

This fixes the appearance of duplicate entries in the add contacts
selector in an envelope view when an address appears more than one time
in the envelope headers.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-24 15:14:20 +02:00
Manos Pitsidianakis
ec01a4412a
melib/imap: turn some sync connections to unsync
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-16 23:47:30 +02:00
Manos Pitsidianakis
264782d228
Various unimportant minor style/doc fixups
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-16 18:15:50 +02:00
Manos Pitsidianakis
f31b5c4000
melib/connections: don't print raw bytes as escaped unicode
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-15 13:20:07 +02:00
Manos Pitsidianakis
8014af2563
imap/protocol_parser: reduce debug prints
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-15 13:19:26 +02:00
Manos Pitsidianakis
a3aaec382a
melib/conf: remove unused imports
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-14 19:18:23 +02:00
Manos Pitsidianakis
b8b24282a0
Update all instances of old domains with meli-email.org
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-10 21:38:12 +02:00
Manos Pitsidianakis
b820bd6d9c
melib/imap: remove unused imap_trace! and fix comp
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-10 13:08:58 +02:00
Manos Pitsidianakis
634bd1917a
melib/imap: convert log prints to traces
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-08 16:56:33 +02:00
Manos Pitsidianakis
e2cdebe89c
Add option to highlight self in mailing list threads
Use under `listing` options such as:

globally
========

  [listing]
  highlight_self = true

per-account
===========

  [accounts.work]
  root_mailbox = '[Gmail]'
  format = "imap"
  subscribed_mailboxes = ["*"]
  listing.index_style = "compact"
  listing.highlight_self = true

per-mailbox
===========

  [accounts.work.mailboxes]
  "INBOX/Lists/project-devel" = { listing.highlight_self=true }

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-06 17:39:28 +02:00
Manos Pitsidianakis
c7aee72525
melib: add clippy::doc_markdown
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-03 22:57:09 +02:00
Manos Pitsidianakis
62aee4644b
Add subcommand to print log file location
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-29 12:04:49 +02:00
Manos Pitsidianakis
4e7b665672
sqlite caching refactor
General refactoring to make blocking operations use special blocking
thread workers, SQL operations to use transactions, and setting up WAL
journal mode mode to minimize locking.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-24 19:16:42 +02:00
Manos Pitsidianakis
51e3f163d4
melib/jmap: Use Url instead of String in deserializing
Catch invalid URLs at the parsing stage.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-13 14:13:53 +02:00
Manos Pitsidianakis
873a67d0fb
Replace erroneous use of set_err_kind with set_kind
set_err_kind() is a method of the IntoError trait, not an Error method;
it is meant to be used for any error type that can be converted into
Error. Since melib::Error implements Into<melib::Error> tautologically,
this was not a compilation error. Nevertheless, the correct thing to do
is use the type method directly to set ErrorKind.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-11 17:13:05 +02:00
Manos Pitsidianakis
c332c2f5ff
Fix new clippy lints (mostly clippy::blocks_in_conditions)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-11 17:13:05 +02:00
Manos Pitsidianakis
1048ce6824
melib/utils: add hostname() utility function
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-11 17:13:05 +02:00
Manos Pitsidianakis
70fc2b455c
Update nix dependency to 0.27
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-11 17:13:05 +02:00
Manos Pitsidianakis
8de8addd11
melib/datetime: add cfg for musl builds
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-11 17:13:05 +02:00
Manos Pitsidianakis
1fe3619208
conf: Make conf validation recognize AccountSettings extra keys
AccountSettings extra keys like `vcard_folder` were not taken into
account when validating a config.

This commit introduces an AccountSettings::validate_config() method that
checks for the presence and validity of this key value.

Fixes #349

https://git.meli-email.org/meli/meli/issues/349

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-04 14:52:06 +02:00
Manos Pitsidianakis
0b468d88ad
addressbook/vcard: improve Error messages
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-04 14:52:06 +02:00
Manos Pitsidianakis
60f26f9dae
melib: Fix some old pre-intradoc rustdoc links
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-11 09:22:28 +02:00
Manos Pitsidianakis
7952006870
melib/percent_encoding: remove doctests, add tests module
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-04 10:41:00 +02:00
Manos Pitsidianakis
ddab3179c2
melib/wcwidth: move tests to tests module
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-04 10:40:31 +02:00
Manos Pitsidianakis
7861fb0402
Fix typos found with typos tool
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-03 11:08:55 +02:00
Manos Pitsidianakis
0270db0123
melib: From<&[u8]> -> From<B: AsRef<[u8]>>
This change allows byte literals to be used with the from trait method.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-01 15:16:47 +02:00
Manos Pitsidianakis
8ddd673dd8
melib/imap/untagged: update all mailboxes
When receiving an envelope event (deleted, or changed flags), update all
mailboxes that contain that envelope hash; not just the currently
selected mailbox.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-01 14:36:29 +02:00
Manos Pitsidianakis
e3351d2755
melib/imap: fix set unseen updating all mboxes
When manually setting an envelope as not seen, all mailboxes had their
unseen count increased. This commit updates only those that include the
envelope in the first place.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-01 14:34:50 +02:00
Manos Pitsidianakis
31401fa35c
melib/backends: add LazyCountSet::contains method
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-01 14:34:05 +02:00
Manos Pitsidianakis
73d5b24e98
melib/tests: merge integration tests in one crate
Saves about 0.5 seconds from compilation and runtime.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-01-01 10:44:31 +02:00
Manos Pitsidianakis
933bf157ae
melib/email/parser: ack \ as an atom
I think this is not spec compliant but the MIME spec (rfc6068 - The
'mailto' URI Scheme) uses it for "valid" addresses.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:56:52 +02:00
Manos Pitsidianakis
f685726eac
melib/email/parser: add backtrace field to ParsingError
Add backtrace field to ParsingError when the build is for testing or
documentation.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:56:52 +02:00
Manos Pitsidianakis
ab1b946fd9
melib/error: don't print details if it's an empty string.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:56:52 +02:00
Manos Pitsidianakis
bebb473d1b
melib/mbox: derive extra traits for enums
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:51:45 +02:00
Manos Pitsidianakis
f0866a3965
meli: make config error more user-friendly
If `send_mail` is incorrect, display a long-ish list of valid examples.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:51:45 +02:00
Manos Pitsidianakis
f63774fa6d
Fix new clippy lints (1.75)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-29 19:51:44 +02:00
Manos Pitsidianakis
808aa4942d
melib: rename text_processing to text for the whole brevity thing
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-26 16:47:42 +02:00
Manos Pitsidianakis
34a2d52e7e
Fix rustdoc::redundant_explicit_links
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-17 19:14:00 +02:00
Manos Pitsidianakis
4026e25428
melib/notmuch: add some doc comments
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-17 19:13:15 +02:00
Manos Pitsidianakis
ca7d7bb95d
melib/notmuch: use message freeze/thaw for flag changes
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-17 19:12:45 +02:00
Manos Pitsidianakis
ebe1b3da7e
melib/notmuch: wrap *mut struct fields in NonNull<_>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-17 18:50:23 +02:00
Manos Pitsidianakis
506ae9f594
melib/error: Add ErrorKind::LinkedLibrary variant
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-17 18:43:12 +02:00
Manos Pitsidianakis
b3079715f6
melib/smtp: disable flakey test_smtp()
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-13 09:45:17 +02:00
Manos Pitsidianakis
86bbf1ea57
melib/notmuch: refresh NotmuchMailbox counts when setting flags
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-12 20:03:14 +02:00
Manos Pitsidianakis
1b0bdd0a9a
melib/notmuch: split queries and mailbox into submodules
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-12 20:03:14 +02:00
Manos Pitsidianakis
7412c23870
Bump meli version to 0.8.5-rc.3
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-11 13:18:50 +02:00
Manos Pitsidianakis
e19f3e572c
Cargo-sort all Cargo.toml files
With:

cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace meli
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace melib
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace tools
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace fuzz

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-10 15:33:10 +02:00
Manos Pitsidianakis
f900dbea46
Use cargo-derivefmt to sort derives alphabetically
Used https://github.com/dcchut/cargo-derivefmt

With command:

cargo install --locked \
--git https://github.com/dcchut/cargo-derivefmt \
--bin cargo-derivefmt \
--rev 2ff93de7fb418180458dd1ba27e5655607c23ab6

Since it's not on crates.io at the moment.

Sample diff:

  -#[derive(Debug, Deserialize, Clone, Serialize)]
  +#[derive(Clone, Debug, Deserialize, Serialize)]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-09 21:28:12 +02:00
Manos Pitsidianakis
3a70979483
Update minimum rust version from 1.65.0 to 1.68.2
Found with `cargo msrv --bisect --min 1.67.0`

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-09 18:01:12 +02:00
Manos Pitsidianakis
d16afc7d8d
Bump version to 0.8.5-rc.2
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-04 17:22:56 +02:00