- 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