Commit graph

416 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
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
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
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
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
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
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
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
567270e177
melib: use Vec instead of SmallVec for search results
There was no point in using SmallVec with this large a size; it was
32768 bytes, or 32KiB. Let's allocate that to the heap instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:53:15 +02:00
Manos Pitsidianakis
5af6e059b7
meli/accounts: use Arc<str> for account name
Since it gets cloned around a lot.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:53:10 +02:00
Manos Pitsidianakis
c375b48ebf
terminal: fix Synchronized Output response parsed as input
Since 2af5c8b6fd ("terminal: add
QuerySynchronizedOutputSupport WIP") we send a synchronised output
support query [1] to the terminal but we don't parse the response. If the
terminal replies, it gets parsed as user input. And if the user happens
to press a navigation key such as scroll_down which supports a number
modifier, the `2026` part of the mode response which was parsed as user
input makes meli scroll down 2026 lines.

Fixes: #502 ("Initial navigation state in mailbox index view is wrong")

[1]:
<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>

Resolves: <https://git.meli-email.org/meli/meli/issues/502>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 15:49:49 +02:00
Manos Pitsidianakis
25f0a3f814
conf/terminal: fix serde of ProgressSpinnerSequence
If ProgressSpinnerSequence / progress_spinner_sequence had a value of
just an array of strings, it could not be parsed correctly. Fix that
with a custom serde impl and also add unit tests.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 15:49:49 +02:00
Manos Pitsidianakis
2bd8d7ba01
conf/tests.rs: Rename test functions to follow path convention
Rename functions to follow the convention of being prefixed with the
module path before the function name (e.g. `fn
test_module_a_module_b_test_desc() {`)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 11:48:08 +02:00
Manos Pitsidianakis
a27a28275b
Bump version to 0.8.8
Finally!

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-19 16:14:21 +02:00
Manos Pitsidianakis
7ff1db143f
manage-mailboxes: add delete option
While there was a delete-mailbox command, there was no option for it in
the manage-mailboxes interface, so add it.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-18 16:15:18 +02:00
Manos Pitsidianakis
707a129ea4
Coalesce repeating TUI notification messages
Don't accept new Display Messages if it has the same content as the
latest one in the display message stack.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:44 +02:00
Manos Pitsidianakis
e7a164de0c
Configure some gpgme stuff under gpgme feature
Some stuff that are only used with gpgme feature were not guarded by
 #[cfg(feature = "gpgme")], so fix that.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:08 +02:00
Manos Pitsidianakis
b912aabca2
docs: add examples of file picker usage
Add an example for `fzf` use with the `add-attachment-file-picker < `
command when composing e-mail.

Closes #507

Resolves: <https://git.meli-email.org/meli/meli/issues/507>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 12:27:53 +02:00
Manos Pitsidianakis
cb2dd5def5
listing/threaded: impl missing select functionality
Selecting by searching for was missing for the threaded index style, so
add it.

Related to #513

Resolves: <https://git.meli-email.org/meli/meli/issues/513>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-11 00:55:17 +02:00
Manos Pitsidianakis
c6e9e4245d
listing/threaded: impl missing filter functionality
Somehow, filter (searching) was not implemented for the threaded index
style, so fix it.

Fixes: #513

Resolves: <https://git.meli-email.org/meli/meli/issues/513>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-11 00:41:12 +02:00
Manos Pitsidianakis
2411481196
manage: parse scroll_{left,right} actions
They were previously silently ignored despite tables (DataColumns)
having support for scrolling on the x axis.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
789a88b28d
shortcuts: add select_motion equivalent to select_entry
Change select_entry to toggle only one's selection entry (default 'V'),
while select_motion (default 'v') inherits the original functionality of
  performing a select motion when combined with a number and motion verb
  (scroll up/down etc)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
81ace71b35
terminal/embedded: lift error checking earlier
Lift error checks earlier in the function, before forking, allowing any
potential errors to show up properly in the main process.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
0d088962d5
lints: Address clippy::too_long_first_doc_paragraph
Ugh, annoying. It doesn't take the fact that markdown links do not
appear long when rendered. Anyway, fix them errors.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
ee89794248
lints: deny clippy::or_fun_call
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 14:29:40 +02:00
Manos Pitsidianakis
441fda568c
terminal: move TextPresentation trait to melib
Since this is a text-related trait, let's move this to melib's text module
instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:33 +02:00
Manos Pitsidianakis
f656aff08e
composer: add discard-draft command
Add command to discard draft and close the composer tab immediately.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
3a93103520
command: move Composer actions under TabActions
Semantically Composer actions should be tab actions since a composer is
a tab. Move them to a new enum in preparation for the next commit which
adds a new Discard draft action.

No functional change intended.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
3558db514a
Move jobs and mailbox management Components together
Move the components for :manage-jobs and :manage-mailboxes into the same
submodule, `manage`. No functional change intended.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
dba5b68be8
components: add prelude module
Add prelude module with exports that are commonly necessary for
Component types.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:31 +02:00
Manos Pitsidianakis
6c315580b1
compose: fix add-attachment-file-picker
Related to #507

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-24 21:09:18 +03:00
Manos Pitsidianakis
05f404ba1f
jobs: do not use AtomicU64
AtomicU64 is not portable, unfortunately.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-16 21:03:43 +03:00
Manos Pitsidianakis
77e7c3df60
Add support for signatures
Add config values to `composing` config section to enable signatures:

   signature_file Path                   (optional) Plain text file with signature that will pre-populate an email draft.  Signatures must be explicitly enabled to be used, otherwise this setting will be ignored.  (None)

   use_signature bool                    Pre-populate email drafts with signature, if any.  meli will lookup the signature value in this order:
                                         1.   The signature_file setting.
                                         2.   ${XDG_CONFIG_DIR}/meli/<account>/signature
                                         3.   ${XDG_CONFIG_DIR}/meli/signature
                                         4.   ${XDG_CONFIG_DIR}/signature
                                         5.   ${HOME}/.signature
                                         6.   No signature otherwise.
                                         (false)

   signature_delimiter String            (optional) Signature delimiter, that is, text that will be prefixed to your signature to separate it from the email body.  (‘\n\n-- \n’)

Closes #498

Resolves: https://git.meli-email.org/meli/meli/issues/498
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-05 18:50:02 +03:00