Commit graph

2662 commits

Author SHA1 Message Date
Manos Pitsidianakis
9f7dcfc21e
Bump version to 0.8.10
Highlights:
  ===========

  - added pipe-attachment command
  - added sample scripts for using meli as a mailto scheme handler in
    contrib/
  - fixed GPG encryption with libgpgme

  Contributors in alphabetical order:
  ===================================

  - Manos Pitsidianakis
  - Matthias Geiger

  Added
  =====

  - 5e77821f mail/view: add pipe-attachment command in PR #540
    "mail/view: add pipe-attachment command"
  - fa896f6b contrib: add mailto: scheme handler scripts
  - 00ce9660
    melib/backends: add as_any/as_any_mut methods to BackendMailbox
  - fd243fa5 maildir: add mailbox creation tests
  - de65eec3 meli/accounts: add mailbox_by_path() tests in PR #535
    "Rework maildir mailbox path logic, add tests"
  - 6b363601 melib/gpgme: impl Display for gpgme::Key

  Bug Fixes
  =========

  - 60c90d75 melib/attachments: ensure MIME boundary prefixed with CRLF
  - 3433c5c3 compose/pgp: rewrite key selection logic in PR #541 "More
    gpgme/PGP fixes again"
  - 12de82e7 melib/conf: fix mutt_alias_file not being validated in PR
    #550 "Remove sealed_test dependency"
  - c8e055a7 Fix version migrations being triggered backwards in PR #557
    "Fix version migrations being triggered backwards"
  - efab99fd
    terminal: check for NO_COLOR env var without unicode validation
  - 36a63e88 melib/maildir: rewrite create_mailbox()
  - fcab855f view: ensure envelope headers are always populated in PR
    #538 "view: ensure envelope headers are always populated"
  - 84564f44 mailcap: don't drop File before opening it in PR #552
    "mailcap: don't drop File before opening it"

  Changes
  =======

  - ed85da51 Remove sealed_test dependency

  Refactoring
  ===========

  - 03df2ac1 meli/utilities: add print utilities for tests
  - 18e9d5c1 conf.rs: impl From<melib::AccountSettings> for AccountConf
  - 1f2fec19 Fix 1.83.0 lints in PR #536 "CI: Add action to check for
    DCO signoffs in PRs"
  - 192ecea2 compose/gpg.rs: Fix msrv regression

  Documentation
  =============

  - 4a61a4b8 melib: include README.md as preamble of crate rustdocs
  - 80e53471 BUILD.md: move melib specific stuff to melib/README.md
  - 91a17ece melib/README.md: mention sqlite3-static feature
  - b77a691b meli/README.md: Add cargo features section in PR #549
    "Document cargo features in READMEs"
  - 91dc271d contrib: add a README.md file
  - 2e900be6 contrib/README.md: add section about oauth2.py
  - 07812d2c contrib/README.md: elaborate a bit about mailto in PR #545
    "Add external mailto: handler support via scripts in contrib"
  - e784e8d2 scripts: add markdown_doc_lints.py

  Continuous Integration
  ======================

  - 77629851 CI: Add action to check for DCO signoffs in PRs
  - f944ebed CI: Add error msg when cargo-derivefmt check fails
  - d49344f9 CI: Move MSRV checks from manifest to lints in PR #553
    "ci-workflow-fixes"
  - ece6bfc2 CI: non-zero exit if cargo-derivefmt-* targets fail
  - 2257b91b CI: add actions/cache steps in PR #554 "CI: add
    actions/cache steps"
  - a1c9524f CI: fix check_dco.sh not working with other repos in PR
    #555 "CI: fix check_dco.sh not working with other repos"

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-06 07:56:00 +02:00
Manos Pitsidianakis
c8e055a718
Fix version migrations being triggered backwards
Fixes #539 ("Ensure versions migrations are suggested only when current
version is newer than the previous one")

Resolves: <https://git.meli-email.org/meli/meli/issues/539>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 21:09:38 +02:00
Manos Pitsidianakis
84564f44a3
mailcap: don't drop File before opening it
Created temporary file was incorrectly set to be deleted on Drop, but
this is not what we want to do when spawning an external command and pass
the file as the argument.

Fixes: #548 ("mailcap handling")

Resolves: <https://git.meli-email.org/meli/meli/issues/548>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 19:52:32 +02:00
Manos Pitsidianakis
a1c9524f74
CI: fix check_dco.sh not working with other repos
Fixes #546

Resolves: <https://git.meli-email.org/meli/meli/issues/546>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 18:04:40 +02:00
Manos Pitsidianakis
2257b91b40
CI: add actions/cache steps
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 15:51:48 +02:00
Manos Pitsidianakis
ece6bfc2ce
CI: non-zero exit if cargo-derivefmt-* targets fail
A previous commit made a change to show an error message and a diff if
cargo-derivefmt check failed, but did not exit with a non-zero code,
thus allowing the failed check to pass.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 15:33:21 +02:00
Manos Pitsidianakis
d49344f9d8
CI: Move MSRV checks from manifest to lints
While MSRV is defined in the manifest files, it doesn't make sense to
verify the code compiles under the MSRV only when the manifest files
change. Code changes can break MSRV compliance.

Move the MSRV checks to the lints.yaml workflow instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 12:22:11 +02:00
Manos Pitsidianakis
f944ebed81
CI: Add error msg when cargo-derivefmt check fails
If cargo-derivefmt fails, no relevant message shows up on CI, only
something like this:

  cargo-derivefmt-melib
  cargo derivefmt --manifest-path ./melib/Cargo.toml
  git checkout meli/src/conf/overrides.rs
  Updated 1 path from the index
  git add --update ./melib/ && git diff --quiet && git diff --cached --quiet
  make: *** [.gitea/Makefile.lint:33: cargo-derivefmt-melib] Error 1

Now it shows a helpful error message with a diff:

  cargo-derivefmt-melib
  Checking that derives are sorted alphabetically...
  cargo derivefmt --manifest-path ./melib/Cargo.toml
  Some derives in the ./melib crate are not sorted alphabetically, see diff:
  diff --git a/melib/src/contacts/notmuchcontact.rs b/melib/src/contacts/notmuchcontact.rs
  index 4ee18f1a..bfcbf54a 100644
  --- a/melib/src/contacts/notmuchcontact.rs
  +++ b/melib/src/contacts/notmuchcontact.rs
  @@ -22,7 +22,7 @@

   use crate::{contacts::Card, error::Result};

  -#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
  +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
   pub struct NotMuchContact {
       pub name: String,
       pub address: String,

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 12:22:11 +02:00
Manos Pitsidianakis
07812d2c85
contrib/README.md: elaborate a bit about mailto
Elaborate on the necessary steps to make the mailto scheme handler
scripts work.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 12:08:13 +02:00
Manos Pitsidianakis
2e900be698
contrib/README.md: add section about oauth2.py
Add section explaining what the oauth2.py script is for.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 12:08:00 +02:00
Manos Pitsidianakis
91dc271d74
contrib: add a README.md file
Add a README.md file for the entire contrib/ directory, and merge
existing `mailto-readme.md` into it.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-05 11:53:17 +02:00
Matthias Geiger
fa896f6bb9
contrib: add mailto: scheme handler scripts
Signed-off-by: Matthias Geiger <werdahias@debian.org>
2024-12-05 11:50:07 +02:00
Manos Pitsidianakis
b77a691b7d
meli/README.md: Add cargo features section
Add section with a table explaining each cargo feature, like we do in
melib/README.md

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:52:22 +02:00
Manos Pitsidianakis
91a17ece5c
melib/README.md: mention sqlite3-static feature
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:52:22 +02:00
Manos Pitsidianakis
e784e8d239
scripts: add markdown_doc_lints.py
This script is meant for lints to run against our markdown files
(README.md, BUILD.md maybe even CHANGELOG.md someday).

For now it checks that a README.md file documents all cargo features,
sample output:

  epilys ~meli % python3 scripts/markdown_doc_lints.py melib/README.md melib/Cargo.toml
  The following features are not mentioned in melib/README.md

  - sqlite3-static add the following string in the Features section: <a name="sqlite3-static-feature">`sqlite3-static`</a>

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:52:22 +02:00
Manos Pitsidianakis
80e5347178
BUILD.md: move melib specific stuff to melib/README.md
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:52:21 +02:00
Manos Pitsidianakis
4a61a4b857
melib: include README.md as preamble of crate rustdocs
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:52:21 +02:00
Manos Pitsidianakis
12de82e7b4
melib/conf: fix mutt_alias_file not being validated
`mutt_alias_file` was not removed from the `extras` field of
`AccountSettings` in the `validate_config` function, thus if you used it
in your account configuration you'd get an error: 'Configuration error:
Unrecognised configuration values: {"mutt_alias_file": "<value>"}'

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:37:33 +02:00
Manos Pitsidianakis
192ecea2a4
compose/gpg.rs: Fix msrv regression
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 18:19:32 +02:00
Manos Pitsidianakis
ed85da51df
Remove sealed_test dependency
We're not using its features it provides over using just rusty-fork,
which sealed-test uses its own fork of it (rusty-forkfork) under the
hood.

Revert to just using the original rusty-fork crate, which is also
packaged in debian.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-12-04 17:38:49 +02:00
Manos Pitsidianakis
3433c5c3d5
compose/pgp: rewrite key selection logic
Rewrite key selection logic when opening the key selector widget for
signing or encryption keys:

- Fix encrypt_for_self incorrectly using the To: header email instead of
  From: (ugh!)
- Include all recipient addresses in selection (To:, Cc: Bcc:), also
  From:
- Use all addresses in a header value instead of just the first address
- Show shortcuts to sign/encrypt fields in Compose form

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-30 17:39:26 +02:00
Manos Pitsidianakis
6b3636013c
melib/gpgme: impl Display for gpgme::Key
Implement display to show more info on the user interface other than
just the fingerprint.

Will show the fingerprint, the primary user id and a list of properties/flags:

- revoked status
- expired status
- disabled status
- invalid status
- can encrypt status
- can sign status
- whether it's a secret or a public key

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-30 17:35:50 +02:00
Manos Pitsidianakis
60c90d7549
melib/attachments: ensure MIME boundary prefixed with CRLF
Sometimes attachment bytes don't end with CRLF, so we must prefix the
boundary line ourselves.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-30 17:35:50 +02:00
Manos Pitsidianakis
5e77821f78
mail/view: add pipe-attachment command
You can pipe individual attachments to binaries with the following
     command:

     pipe-attachment INDEX binary ARGS

     Example usage with the less(1) pager:
           pipe-attachment 0 less
     If the binary does not wait for your input before exiting, you will
     probably not see its output since you will return back to the user
     interface immediately.  You can write a wrapper script that pipes your
     binary's output to
           less
     or
           less -r
     if you want to preserve the ANSI escape codes in the pager's output.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-30 11:25:31 +02:00
Manos Pitsidianakis
fcab855fda
view: ensure envelope headers are always populated
Some email backends return Envelopes with only the basic headers filled
in. But that might clash with a user's configurations which operates on
specific headers when viewing an email. So, when having loaded an email
completely, make sure its envelope's headers is completely populated
before presenting it to the user.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-29 23:27:20 +02:00
Manos Pitsidianakis
1f2fec198f
Fix 1.83.0 lints
Mostly lifetime ones (elided-named-lifetimes and needless-lifetimes)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 18:01:59 +02:00
Manos Pitsidianakis
776298511b
CI: Add action to check for DCO signoffs in PRs
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 17:29:19 +02:00
Manos Pitsidianakis
de65eec3a9
meli/accounts: add mailbox_by_path() tests
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 14:19:10 +02:00
Manos Pitsidianakis
18e9d5c148
conf.rs: impl From<melib::AccountSettings> for AccountConf
No functional changes.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:11 +02:00
Manos Pitsidianakis
fd243fa5ab
maildir: add mailbox creation tests
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:11 +02:00
Manos Pitsidianakis
36a63e8878
melib/maildir: rewrite create_mailbox()
Rewrite create_mailbox() to better detect errors, and make its behavior
consistent across different scenarios (being given a file system path or
not, being given absolute paths or not, having a valid (maildir) root
mailbox or not)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:10 +02:00
Manos Pitsidianakis
00ce9660ef
melib/backends: add as_any/as_any_mut methods to BackendMailbox
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:10 +02:00
Manos Pitsidianakis
03df2ac128
meli/utilities: add print utilities for tests
Add:

- eprint_step_fn():  Returns a closure that prints a formatted message,
  without a trailing newline, and prefixed with an increasing counter.
- eprintln_ok_fn(): Returns a closure that prints the string " OK\n" to
  `stderr` with optional color formatting.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:10 +02:00
Manos Pitsidianakis
efab99fda2
terminal: check for NO_COLOR env var without unicode validation
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-28 12:44:10 +02:00
Manos Pitsidianakis
ce53925f36
Bump version to 0.8.9
This is mostly a fixups release.

Added
=====

- cf16bf65 meli/sqlite3: add tests for reindexing
- a389772d accounts: suggest tips on mailbox_by_path error

Bug Fixes
=========

- 25f0a3f8 conf/terminal: fix serde of ProgressSpinnerSequence
- c375b48e terminal: fix Synchronized Output response parsed as input
  in PR #523 "terminal: fix Synchronized Output response parsed as
  input"
- b7e215f9
  melib/utils: fix test_fd_locks() on platforms without OFD support in
  PR #524 "melib/utils: fix test_fd_locks() on platforms without OFD
  support"
- 25c32a6b meli/docs/meli.conf.examples.5: fix .Dt macro arguments
- 18ae5848 meli: fix reindex of previously indexed account with sqlite3
  backend
- 13e917d9 Fix some compilation errors with cfg feature attrs in PR #531
  "accounts: suggest tips on mailbox_by_path error"
- 8c176d38 contacts/editor: fix crash on saving contact in PR #532
  "contacts/editor: fix crash on saving contact"
- fb5a88c2
  melib/collection: ensure mailbox exists when inserting new envelopes
  in PR #529 "Small account stuff fixes"

Changes
=======

- 7f8f1cf6 melib/gpgme bindings renewal in PR #533 "melib/gpgme
  bindings renewal"
- 9b7825bc Update futures-util dep, remove stderrlog dep
- 4be69360 Remove obsolete "encoding" dependency in PR #530
  "Remove/update obsolete dependencies"

Refactoring
===========

- 5af6e059 meli/accounts: use Arc<str> for account name
- 567270e1 melib: use Vec instead of SmallVec for search results
- 2bd8d7ba
  conf/tests.rs: Rename test functions to follow path convention

Documentation
=============

- 97242482 meli/docs: add meli.conf.examples to CLI and tests
- 0f096338 README.md: Update ways to install, add gitlab mirror link
  in PR #528 "Integrate meli.conf.examples.5 into CLI and build, also
  update README with installation instructions"

Continuous Integration
======================

- 630df308 CI: Add arm64 runners in job matrices in PR #527 "CI: Add
  arm64 runners in job matrices"
- 49ecbb56 CI: .gitea/Makefile.lint: check if nightly exists

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-27 16:16:29 +02:00
Manos Pitsidianakis
7dae430759
version_migrations: add compile-time checks
Add compile-time checks that version map is sorted.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-27 16:12:31 +02:00
Manos Pitsidianakis
a6df350843
v0.8.9: add version migrations and tests for upcoming version
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-27 14:27:54 +02:00
Manos Pitsidianakis
7f8f1cf65f
melib/gpgme bindings renewal
Regenerate libgpgme bindings for 32bit and 64bit targets separately.

This fixes the gpgme bindings tests failing for 32bit targets (which
prior to this commit where cfg'd to run only on x86-64 with #[cfg(target_arch = "x86_64")]

Tests confirm passing with:

    cross test --target i686-unknown-linux-gnu --all-targets --all -- --skip test_cli_subcommands

Note: We don't currently test on 32bit arches on CI, failure was spotted
on downstream Debian's build servers

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 19:35:05 +02:00
Manos Pitsidianakis
4be6936026
Remove obsolete "encoding" dependency
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 18:54:48 +02:00
Manos Pitsidianakis
9b7825bc59
Update futures-util dep, remove stderrlog dep
stderrlog was not used at all, so remove it.

Also update yanked futures-util dep.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 18:54:48 +02:00
Manos Pitsidianakis
8c176d3840
contacts/editor: fix crash on saving contact
Oops...

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 17:52:44 +02:00
Manos Pitsidianakis
13e917d97b
Fix some compilation errors with cfg feature attrs
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 16:44:02 +02:00
Manos Pitsidianakis
49ecbb56f7
CI: .gitea/Makefile.lint: check if nightly exists
If nightly toolchain exists and `cargo +nightly fmt --check --all` runs
but fails because --check returns an error, and the same error does not
trigger under the current active toolchain when the `|| cargo fmt
--check --all` path is executed, then that error is completely ignored.

That wouldn't happen on the CI where the nightly toolchain is not
installed but it would happen if someone (i.e. me) used the Makefiles
locally.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 14:12:56 +02:00
Manos Pitsidianakis
cf16bf65f7
meli/sqlite3: add tests for reindexing
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 12:19:15 +02:00
Manos Pitsidianakis
18ae584836
meli: fix reindex of previously indexed account with sqlite3 backend
Reported-by: iooioio <meli@iooioio.xyz>
Co-authored-by: iooioio <meli@iooioio.xyz>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-26 12:18:40 +02:00
Manos Pitsidianakis
a389772d96
accounts: suggest tips on mailbox_by_path error
If Account::mailbox_by_path() fails, suggest matching mailbox paths
using aho_corasick case insensitive matching, and also suggest to the
user to inspect mailboxes with the manage-mailboxes command.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 13:57:11 +02:00
Manos Pitsidianakis
0f09633899
README.md: Update ways to install, add gitlab mirror link
- Add repology table/badge
- Add more ways to install thanks to people packaging meli for package
  managers/platforms
- Update list of official mirrors by adding new gitlab mirror
- While at it, fix ugly html table with quickstart instructions

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:56:24 +02:00
Manos Pitsidianakis
972424829c
meli/docs: add meli.conf.examples to CLI and tests
We kinda forgot to do that when adding that new manpage, do it now.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:56:23 +02:00
Manos Pitsidianakis
25c32a6b95
meli/docs/meli.conf.examples.5: fix .Dt macro arguments
Dt macro takes two arguments, or three of the last one is the host
machine architecture.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:56:07 +02:00
Manos Pitsidianakis
fb5a88c22c
melib/collection: ensure mailbox exists when inserting new envelopes
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:53:15 +02:00