Well this was more complex that it should have been. And not very
optimized because we're not using pipelining in the submit() path:
1. first upload email bytes as a Blob object. This requires a standalone
API post call at a specific url so it cannot be changed with followup
calls to reference the blob's id.
2. Create an EmailObject in the drafts folder.
3. Create an EmailSubmission object referencing the email id of prevous
call. Unfortunately I cannot get the Result Reference to work in
stalwart jmap, so for now this is too a separate transaction.
Caveat emptor: Errors might not be returned to the user.
Closes#277.
https://git.meli.delivery/meli/meli/issues/277https://git.meli.delivery/meli/meli/pulls/279
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We will need this in the future when we're going to support extra
extensions like Blob and also now to support server submission.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
- Use HeaderName in parsers instead of raw byte strings.
- Use byte literal constants where appropriate instead of repeating
&b"___"[..]
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
When adding contacts from an envelope view, its hash/id/key was a random
Uuidv4, so it was always possible to add a contact again and again with
no limits. Now, the id is calculated from the hash of the email address
and display name, preventing duplicate additions.
Note that the hash algorithm is not supposed to be stable across
versions, meaning that in the future the same contact might have a
different hash. This means a more sophisticated method for
detecting/disallowing dupes must eventually be introduced.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We want to use SortOrder enum for non-thread purposes in the next
commit, so move it out of the thread module.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We inspect errors in the frontend to check for network errors. If the
network error comes from std::io, this would get converted to an Error
with description "timed out", kind OSError, and source the actual
networking error.
This commit converts network std::io::ErrorKinds into appropriate
native ErrorKinds.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit adds a Happy Eyeballs [1] implementation taken from the
happy-eyeballs crate, which is in public domain.
While the function lookup_ip[0] iterates through the addresses returned by
A and AAAA records from a DNS lookup, it returns the first one which
always is an IPv4 address, unless there only is an AAAA record.
RFC6555 [1] recommends an algorithm for choosing the fastest address to
connect to, called "Happy Eyeballs". Ꙭ
[0]: melib/src/utils/connections.rs:497
[1]: https://www.rfc-editor.org/rfc/rfc6555Fixes#268
According to RFC 3977:
> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair
This commit adds a log::error entry when any sent command exceeds that
limit and recommends the user to report this as a bug.
According to RFC 3977:
> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair
Sending a `LIST ACTIVE` command with lots of newgroups and passing the
512 byte limit is therefore invalid. This commit splits the mailboxes in
chunks and sends a separate command for each maximal chunk that has
a valid length.
Fixes#269.
Reported-by: r3k2
NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.
Fixes#269.
Source Code Annotation Tags:
Global tags (in tagref format <https://github.com/stepchowfun/tagref>)
for source code annotation:
- [tag:hardcoded_color_value] Replace hardcoded color values with user
configurable ones.
- [tag:needs_unit_test]
- [tag:needs_user_doc]
- [tag:needs_dev_doc]
- [tag:FIXME]
- [tag:TODO]
- [tag:VERIFY] Verify whether this is the correct way to do something
- [tag:DEBT] Technical debt
When missing intermediate and/or parent messages in a thread, the
printed thread tree branches were completely invalid. This commit makes
sure thread node entries that have no corresponding envelopes are
accounted for in the tree structure.
- Add an ID field in ImapConnection and ImapStream that records where
each instance was created. This is useful for differentiating main
backend connections from watching thread connections (the ones that
listen to updates from the IMAP server with IDLE or polling).
- Add an imap_trace! macro that uses log::trace! internally but also
prepends the connection's ID string to each log line.
compose-hooks run before submitting an e-mail.
They perform draft validation and/or transformations.
If a hook encounters an error or warning, it will show up as a notification.
The currently available hooks are:
- past-date-warn
Warn if Date header value is far in the past or future.
- important-header-warn
Warn if important headers (From, Date, To, Cc, Bcc) are missing or invalid.
- missing-attachment-warn
Warn if Subject, draft body mention attachments but they are missing.
- empty-draft-warn
Warn if draft has no subject and no body.
They can be disabled with [composing.disabled_compose_hooks] setting.
Fastmail now uses an API token in a http header for authentication.
This can be used either as a server_password or provided by a
server_password_command like oauth2.
Move the handling of either `server_password` or
`server_password_command` from the imap backend to the common
`AccountSettings` struct and add it for jmap as well.
Try with managesieve REPL in src/managesieve.rs:
cargo run --bin managesieve-client ~/.config/meli/config.toml
"accountname"
rfc5804 <https://www.rfc-editor.org/rfc/rfc5804.html>
This commit adds a new configuration value for the composing section of
settings. Quoting the documentation:
wrap_header_preamble: Option<(String, String)>
optional
Wrap header preample when editing a draft in an editor. This allows you
to write non-plain text email without the preamble creating syntax
errors. They are stripped when you return from the editor. The values
should be a two element array of strings, a prefix and suffix. This can
be useful when for example you're writing Markdown; you can set the
value to ["<!--",\ "-->"] which wraps the headers in an HTML comment.
Don't fail when parsing an IMAP config when it has
`server_password_command` set.
Closes#139
Meli stopped recognizing server_password_command configuration #139
May be related to #132
Cannot remove tags in the notmuch backend #132
> Running tag remove TAG on the notmuch backend does nothing. At a
> glance, this seems to be because NotmuchMailbox::set_flags never bothers
> to remove tags that are already present but not in the list of new tags.
> I could try fixing it, but I have no idea how the contribution process
> works here (my guess is the mailing list, but, well, #131).
https://git.meli.delivery/meli/meli/issues/132
This commit adds logic in configuration file validation that checks that
each account "extra" field is empty after getting it back from the
backend validation. This is to ensure the user doesn't set options that
are invalidly stated in the documentation or by accident.
Closes#135
Configuration error (xxx): the following flags are set but are not recognized: ["index_style"] https://git.meli.delivery/meli/meli/issues/135
According to the vcard RFC
https://datatracker.ietf.org/doc/html/rfc6350#section-3.2 all lines must
end with CRLF (\r\n or 0x0d 0x0a)
Some VCard sources use only newline, which, while spec violating is easy
to recover from. So parse them as if they are correct.
Closes#121
Forward email with shortcut 'forward' (default ctrl+f)
This opens a composing tab letting you to select receiver etc.
"composing" config setting "forward_as_attachment" selects the
forwarding behavior:
- "ask" asks you ever time
- true always forwards by attaching the entire email as a single
attachment
- false always forwards by inlining the email, like most email clients
do.
Closes#120