Change ImapConnection::read_lines function argument termination_string
from &[u8] to Option<&[u8]>.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This new setting defines shell commands with names that can be applied
at any time on a text attachment by using the `filter` command without
any arguments.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
If UID FETCH returns an OK response but without untagged fetch
responses, it means the UID was not found. Return a NotFound error in
this case and a ProtocolError in other error cases.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
I run something similar to get each releases' contributor names, and
rust-bindgen happens to have this in a script, so let's import it.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add identify! macro which expands to stringify! but also const type
checks the value to prevent typos/wrong values.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add a prelude module under melib::backends that exports all types needed
to interact with a mail backend. This reduces the number of imports in
every related file.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
RFC3501 seems to prefer BODY attributes as the more modern equivalent
to RFC822. For example, this also allows us to use BODY.PEEK. Since the
fetch methods in melib are tightly coupled with the parser, we have to
add this here if we want to use BODY attributes during fetch.
Similar to Envelope::recipient_any, this method searches if its argument
exists in From: or Author: headers.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
I suspect this is annoying to see when opening a PR for everyone and not
just me, so I comment it out by default.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
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>
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>
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>
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>
When printing and line-breaking a string in CellBuffer::write_string(),
the line should continue from the "beginning" of the previous one.
However it might be different than the offset of the first character of
the string, because it may be indented already.
This would result in awkward line breaks like:
Available actions: [ list- |# end of terminal/border
post, list-unsubscribe, lis|
t-archive ]
This commit adds an extra argument to write_string() to specify the x
offset of the string, so that we can apply it while printing characters
but ignore it when the line changes; then the x coordinate will take the
value of the line_break value.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
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>
Add tools subcommand, with options to launch imap, smtp or jmap shells.
Currently only smtp is implemented, imap is working but with quirks.
To use, run
$ meli tools smtp-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 smtp-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>
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>
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>