Manos Pitsidianakis
733de5a5fb
Fix some clippy suggestions
3 years ago
Manos Pitsidianakis
24b4c117e7
melib: don't use both {set,push}_references()
...
set_references() already calls push_references()
3 years ago
Manos Pitsidianakis
781a1d0e1b
melib/backends: add collection() method to MailBackend
...
Keep track of the Collection state in the backend side
3 years ago
Manos Pitsidianakis
829f1243fb
melib/imap: fix invalid FETCH edge case
...
If mailbox was empty, this FETCH would request "0:*" which is an invalid
message set since message sequence numbers start with 1.
3 years ago
Manos Pitsidianakis
09684e821d
melib/imap: check INBOX when pausing IDLE
3 years ago
Manos Pitsidianakis
68f9d1220b
melib/imap: remove DoubleEndedIterator for ImapLineIterator
3 years ago
Manos Pitsidianakis
1408690a9a
melib/imap: don't retry watch conn on non-network error
3 years ago
Manos Pitsidianakis
bedf181aff
melib/imap: examine all mailboxes before idle
4 years ago
Manos Pitsidianakis
4939a1ad9e
melib/imap: remove some debug prints
4 years ago
Manos Pitsidianakis
5f6b4745b8
melib/imap: don't use UNSEEN select response for unseen count
...
UNSEEN field in SELECT/EXAMINE response is meant to be the message
sequence number of the first unseen message, not the count of unseen
messages.
4 years ago
Manos Pitsidianakis
76c1c1a213
melib/imap: don't examine unloaded mailboxes for updates
...
In examine_updates() which is periodically executed in the IMAP watch
thread, the mailbox's contents get fetched regardless if the user has
fetched the mailbox before. That means eg a large mailbox that was
unused by the user might perform a large fetch all of a sudden without
the user's knowledge/touch.
Add `warm` property in ImapMailbox that states whether the mailbox has
been loaded before in current execution.
Closes #88 IMAP: don't examine unloaded mailboxes for updates, just for message count stats
4 years ago
Manos Pitsidianakis
ddfadc748d
melib/imap: don't fetch RFC822 except when requested
...
In some cases when handling new server events, the entire body message
was unnecessarily fetched.
Closes #87 IMAP: don't fetch RFC822 except when requested
4 years ago
Manos Pitsidianakis
ce559b05d7
melib/imap: EXAMINE instead of SELECT in IDLE connection
4 years ago
Manos Pitsidianakis
3618bdcffb
melib/imap: treat server input as bytes
...
Server input was assumed valid ascii and converted haphazardly to &str.
Don't do that, since it might not be valid UTF8.
4 years ago
Manos Pitsidianakis
0e2641f7ed
melib/imap: always retry connection in watch()
4 years ago
Manos Pitsidianakis
17a4ccdcbc
melib/imap: perform reconnect on IDLE failure
4 years ago
Manos Pitsidianakis
352f7505fc
melib/imap: don't poll \Noselect mailboxes for updates
4 years ago
Manos Pitsidianakis
06a58a70bd
melib/imap: introduce a conf flag for server timeout
...
timeout integer (optional) Timeout to use for server connections in seconds. A timeout of 0 seconds means there's no timeout. (16)
4 years ago
Manos Pitsidianakis
d00055fdb1
melib/imap: update online instant only on server read IO
4 years ago
Manos Pitsidianakis
1751509739
melib/imap: prevent false IDLE wakeups
...
Prevent IDLE loop waking up when receiving continuation "+ " lines
4 years ago
Manos Pitsidianakis
b4fe34eacf
melib/imap: add ImapCache trait
4 years ago
Manos Pitsidianakis
75f59ee726
melib/imap: split by lines when reading IDLE unsolicited responses
4 years ago
Manos Pitsidianakis
e9a80b32ac
melib/imap: small cleanups
4 years ago
Manos Pitsidianakis
f7c9f21575
melib/imap: add CONDSTORE support
...
Closes #52
4 years ago
Manos Pitsidianakis
031e81ac8f
imap: add UntaggedResponse::UIDFetch
4 years ago
Manos Pitsidianakis
0a7f283582
imap: prevent deadlock in watch::examine_updates
...
uid_store.mailboxes was locked before calling examine_updates, which
calls examine_mailbox() which also attempts to lock uid_store.mailboxes
4 years ago
Manos Pitsidianakis
931863436d
imap: remove blocking imap backend, replace with async
4 years ago
Manos Pitsidianakis
f8b84a192c
imap: add current_mailbox enum MailboxSelection
...
Add enum to track the currently selected Mailbox in the IMAP connection
4 years ago
Manos Pitsidianakis
91badc3960
imap: count message totals using HashSet
...
This way it's easy to know if a flag change in an envelope requires the
unseen total of a mailbox to change.
4 years ago
Manos Pitsidianakis
d7444a5b19
imap: recognize EXPUNGE events
4 years ago
Manos Pitsidianakis
c7fbc5cafb
imap: remove redundant passing of AccountHash
4 years ago
Manos Pitsidianakis
2d3f49d64d
imap: index by (MailboxHash, UID) instead of just UID
...
Mailboxes can share UIDs.
4 years ago
Manos Pitsidianakis
b4dfc1f89d
imap: add experimental header caching with sqlite3
...
Add support for header caching. It is currently unstable and should not
be used. It can be turned on by specifying "X_header_caching" to true in
the IMAP account's configuration.
The header cache is saved in a sqlite3 database in your XDG_DATA_DIR,
for example:
/home/epilys/.local/share/meli/17328072387188469646_header_cache.db
Concerns #31 https://git.meli.delivery/meli/meli/issues/31
4 years ago
Manos Pitsidianakis
6ec249dd7f
melib: update nom dependency from 3.2.0 to 5.1.1
...
That was hecking exhausting
4 years ago
Manos Pitsidianakis
815ff98acc
imap: add smarter untagged reply detection
4 years ago
Manos Pitsidianakis
8648b229ad
Add AccountHash to RefreshEvent
...
Different accounts might have same inboxes with same MailboxHashes. Use
the hash of the account's name to differentiate.
4 years ago
Manos Pitsidianakis
eb701695f7
Remove fnv crate
4 years ago
Manos Pitsidianakis
c37d8bd331
imap: add mutex timeout lock and remove unwraps
4 years ago
Manos Pitsidianakis
7a770c7f7b
imap: fetch RFC822 instead of RFC822.HEADER
...
RFC822.HEADER is not parsed in imap/protocol_parser.rs
4 years ago
Manos Pitsidianakis
ca51077f53
imap: Add support for untagged FETCH (FLAG.. messages
...
IDLE connection can get untagged "* FETCH (FLAGS ({flag_list))" messages
if any client has changed flags. Support this refresh event.
4 years ago
Manos Pitsidianakis
4ac52d9d5b
Replace every use of Folder with Mailbox
...
Use Mailbox for consistency.
4 years ago
Manos Pitsidianakis
499fd59c6e
melib/imap: implement refresh()
4 years ago
Manos Pitsidianakis
bbdc9d69b4
melib/imap: add ImapConnection::connect()
4 years ago
Manos Pitsidianakis
f208948651
melib: add mailbox delete/create to IMAP
4 years ago
Manos Pitsidianakis
21526b5faf
melib: make Work use FnOnce closures
...
There was no need to use Fn() instead of FnOnce()
4 years ago
Manos Pitsidianakis
2b6f6ab42c
melib: Add BackendFolder methods, move special usage logic to backend
...
- add count() method to return (unseen, total) counts
- add is_subscribed()
- add set_special_usage() and set_is_subscribed()
concerns #8
4 years ago
Manos Pitsidianakis
2e38ea11e2
melib: make MailBackend::is_online() return Result<()>
...
Return Result<()> instead of bool to indicate connection status in order
to be able to show errors to user.
4 years ago
Manos Pitsidianakis
6f76cd9acc
melib: add special_usage() method to BackendFolder
...
Eventually after loading potential usage values from configuration,
backends will be able to change the usage values themselves. IMAP and
JMAP have the ability to set Mailbox roles (IMAP needs LIST-SPECIAL
extension
4 years ago
Manos Pitsidianakis
504b658f68
melib/imap: add UidFetchResponse struct and parser
...
Add handwritten parser for UID FETCH responses and use it for all UID
FETCH calls.
4 years ago
Manos Pitsidianakis
8235af9237
melib/imap: quote mailbox names on SELECT/EXAMINE
4 years ago