Commit Graph

1107 Commits

Author SHA1 Message Date
Damian Poddebniak
7856ea33f0 refactor: Transition more to imap-codec 2024-06-08 17:50:35 +03:00
Damian Poddebniak
a8956bafc8 chore: Update to imap-codec v2.0.0-alpha.1 2024-06-08 17:49:55 +03:00
Manos Pitsidianakis
f1332e82b6
Bump version to 0.8.6
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-08 11:55:13 +03:00
Manos Pitsidianakis
01bc62e0ad
melib/attachments: add new_plaintext method
Add new convenience method AttachmentBuilder::new_plaintext(Vec<u8>)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-05 19:46:38 +03:00
Manos Pitsidianakis
8dd87c1ac5
melib/email: add ContentType::is_text_plain()
Simple helper method to check if content-type is text/plain

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-03 10:12:26 +03:00
Manos Pitsidianakis
6be25ac3df
melib/jmap: don't use client field for get/posts
HTTP Requests should go through the get_async()/post_async() methods of
JmapConnection, which traces requests if optional feature `jmap-trace`
is enabled.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-02 15:15:34 +03:00
Manos Pitsidianakis
33999fc6ab
melib/jmap: re-add Submission to USING
Submission capability is necessary for Identity retrievals.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-02 15:15:34 +03:00
Manos Pitsidianakis
45bfcf8707
melib/email/headers/standards.rs: minor refactors
Refactor the standards! macro to remove unnecessary repetitions, and
also add RFC2183 as source for the Content-Disposition header.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-02 12:17:56 +03:00
Manos Pitsidianakis
3bab5324c4
melib/email: Improve Debug impl for ContentType etc
Improve Debug impl for ContentType, Text, ContentTransferEncoding which
all include bytes in some of their variants. The derived Debug
implementation did not show them as readable ascii strings, so a custom
impl was necessary to make it readable.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-06-02 12:15:33 +03:00
Manos Pitsidianakis
2bfe608678
view.rs: hide self from "add contacts" options
Adding ourselves to our contacts doesn't make sense (in the generic
case) so remove them from the list that is shown when the user selects
the add contacts shortcut.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-30 15:44:19 +03:00
Manos Pitsidianakis
571bd98497
Add proper imap-shell in tools subcommand for debugging
Add imap-shell to tools subcommand.

To use, run

  $ meli tools imap-shell <account-name>

Where account name is what you have in your config file.

For convenience, typing an invalid name will list all the valid names:

  $ meli tools imap-shell "asdf"
  The configuration file does not contain the account `asdf`. It contains the following:
  user@example.com
  work
  personal account
  Try again with a valid account name.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 22:46:08 +03:00
Manos Pitsidianakis
7eed944abc
melib/jmap: fix screwed up rfc8620 module split
I first split the rfc8620.rs into two files with an octopus merge but
getting fixups autosquashed in rebase was impossible with this approach.
So I made the split manually and botched the state of the two splitted
halves.

This commit removes extraneous code and the unused rfc8620.rs file.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 13:59:03 +03:00
Manos Pitsidianakis
f2b59a7633
jmap: add RequestUrlTemplate type
Add type that preserves both text (String) and parsed Url value for a
Url template.

Also add a test to catch regressions.

Closes #403 (JMAP: message body fetching broken on v0.8.5)

Fixes: 51e3f163d4 ("melib/jmap: Use Url instead of String in deserializing")
Resolves: https://git.meli-email.org/meli/meli/issues/403
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:13 +03:00
Manos Pitsidianakis
f7838b1ddf
jmap/rfc8620.rs: split to methods.rs and objects.rs
Split rfc8620 to two separate files.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
a78f3f261d
jmap/rfc8620: move submodules to jmap/
Part of simplifying jmap module hierarchy.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
50ecade74a
jmap: merge rfc8620/tests.rs to tests.rs
In anticipation of next commit which will flatten the rfc8620 module
(move submodules to root).

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
77867aeed4
jmap: unwrap object module
jmap module hierarchy has been historically weird at places, because
some modules had been developed in separate bursts.

Flatten object module since it was not necessary.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
fc1122a2aa
jmap/mailbox.rs: rename to backend_mailbox.rs
To differentiate with the `Mailbox` object module.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
7ba7dc70c5
jmap: imports cleanup in all modules
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
dce3852fe5
jmap: add capabilities module
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-29 00:51:12 +03:00
Manos Pitsidianakis
c65635ef60
melib/connections.rs: Fix compilation for macos
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-20 10:17:04 +03:00
Manos Pitsidianakis
4148aee59b
melib: refactor smtp,draft errors and email tests
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-20 10:17:04 +03:00
Manos Pitsidianakis
4bdfb3a31b
melib/connections.rs: disable Nagle's algorithm by default
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-18 12:16:47 +03:00
Manos Pitsidianakis
671d35e21e
melib: update mailin-embedded dependency to 0.8.2
Closes: #391

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-16 08:49:00 +02:00
Manos Pitsidianakis
a4ebe3b7d4
conf.rs: Add ErrorKind::Platform
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-14 12:01:32 +02:00
Manos Pitsidianakis
a8c7582fa3
melib/imap: fix ENVELOPE parsing in untagged responses
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-14 12:01:31 +02:00
Manos Pitsidianakis
a9c3b151f1
listing.rs: impl highlight_self in all index styles
Add highlight_self to all listing styles (compact, conversations, plain,
thread).

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-14 12:01:31 +02:00
Manos Pitsidianakis
1abce964c7
melib: add Envelope::recipient_any method
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-14 12:01:30 +02:00
Manos Pitsidianakis
9ca34a6864
Update MSRV to 1.70.0
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-07 11:49:19 +03:00
Manos Pitsidianakis
8eaf03554f
Bump version to 0.8.5
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-06 18:37:30 +03:00
Manos Pitsidianakis
8ec6f22090
Use ShellExpandTrait::expand in more user-provided paths
ShellExpandTrait::expand was not used consistently, leading to only some
functionalities supporting things like tilde expansion.

Fixes #387

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-06 18:33:43 +03:00
Manos Pitsidianakis
ab04189887
clippy: fix new warnings for 1.78.0
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-04 20:26:32 +03:00
Manos Pitsidianakis
36b7c00b97
clippy: Put doc text type names and co. in backtics
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-04 20:26:31 +03:00
Manos Pitsidianakis
29cc1bce5b
Remove obsolete file melib/src/text/tables.rs.gz
Fixes #382

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-02 13:20:01 +03:00
Manos Pitsidianakis
dedee908d1
Update notify dep from 4.0.17 to 6.1.1
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-04-11 21:48:30 +03:00
Manos Pitsidianakis
ae96038fbf
Make unicode-segmentation a hard dependency
meli/melib are UTF8 software, so we should have proper Unicode support.

A compile-time env var is added, `UNICODE_REGENERATE_TABLES` to force
network access and rebuild the cached unicode tables.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-04-11 21:15:47 +03:00
Manos Pitsidianakis
07072e2e3f
melib/thread: prevent panic if envelope is deleted
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-04-06 21:08:37 +03:00
Manos Pitsidianakis
a69c674c07
Fix new 1.77 clippy lints
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-03-24 16:04:51 +02:00
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