Commit Graph

176 Commits (592339bdcae593ff4de5bcb627cb0c643d9ee4c2)

Author SHA1 Message Date
Manos Pitsidianakis c6c0da7fcb
melib: cleanup commit
Cleanup melib module exports, add some document tests, change some
documentation.
4 years ago
Manos Pitsidianakis d14f26569e
melib/email/parser: Add rfc5322 compliant parser for MessageID 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 be2d268a20
melib/imap: build uid<>msn cache in {select,examine}_mailbox() 4 years ago
Manos Pitsidianakis 209bd98814
melib/imap: fix cache not being updated in some events 4 years ago
Manos Pitsidianakis e9a80b32ac
melib/imap: small cleanups 4 years ago
Manos Pitsidianakis 8c6c9806b5
Fix some clippy lints 4 years ago
Manos Pitsidianakis f7c9f21575
melib/imap: add CONDSTORE support
Closes #52
4 years ago
Manos Pitsidianakis 0f3bf858a3
melib/imap: impl UNSELECT via nonexistent mailbox 4 years ago
Manos Pitsidianakis 876e1bc510
melib/imap: turn ImapResponse From to TryFrom 4 years ago
Manos Pitsidianakis a190805384
melib/backends: Add BackendEvent enum 4 years ago
Manos Pitsidianakis dede8d2a9e
melib/imap: timeout when establishing connection 4 years ago
Manos Pitsidianakis ce45cf5f17
melib/{imap,nntp}: flush after write_all
IMAP IDLE got stuck, because the IDLE connection used `send_raw` that
didn't flush output after `write_all`, *if* DEFLATE was on. DEFLATE
needs to flush output.
4 years ago
Manos Pitsidianakis ec0153e7b2
melib: add protocol extension info in MailBackendCapabilities 4 years ago
Manos Pitsidianakis 3ac2c12e7a
Small fixes 4 years ago
Manos Pitsidianakis 9a29f4245f
melib/imap: add COMPRESS=DEFLATE support
Closes #53
4 years ago
Manos Pitsidianakis 8ec0da4fbd
melib/imap: add conf toggle flags for IMAP extensions 4 years ago
Manos Pitsidianakis 7bbfd188ef
melib/imap: move current_mailbox to ImapStream
ImapStream holds the connection state (current command id), so it makes
sense to move current_mailbox state there. That way, when a connection
drops for whatever reason the old current_mailbox is dropped and not
carried over to new connections.
4 years ago
Manos Pitsidianakis 32b4c30fee
melib/email.rs: use SmallVec for Address fields 4 years ago
Manos Pitsidianakis 031e81ac8f
imap: add UntaggedResponse::UIDFetch 4 years ago
Manos Pitsidianakis f41a1ffe3a
imap: remove FLAGS.SILENT from STOREs
Flag updates were not received, because FLAGS.SILENT was used.
4 years ago
Manos Pitsidianakis 5a5408ecd5
imap: small fixes 4 years ago
Manos Pitsidianakis 00acba7717
melib/MailBackend: add copy_messages,set_flags,delete_messages methods 4 years ago
Manos Pitsidianakis 6121f77853
imap: support LIST-STATUS 4 years ago
Manos Pitsidianakis 350c8033b1
imap: use ImapLineIterator in imap_mailboxes() 4 years ago
Manos Pitsidianakis e49c293b01
imap: impl DoubleEndedIterator for ImapLineIterator 4 years ago
Manos Pitsidianakis 9103d05617
melib: s/get/fetch in MailBackend methods 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 97c76cc6a1
melib/error: add ErrorKind struct 4 years ago
Manos Pitsidianakis c7bbf7ed7e
melib: move lookup_ipv4() to connection module 4 years ago
Manos Pitsidianakis 9db6b07b71
Remove some needless clones and stuff (thanks to Clippy) 4 years ago
Manos Pitsidianakis 931863436d
imap: remove blocking imap backend, replace with async 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis bbedeed3e3
More imap async fixes 4 years ago
Manos Pitsidianakis b3876113aa
BackendOp: return future in as_bytes() 4 years ago
Manos Pitsidianakis 1ddde9ccba
BackendOp: change fetch_flags() retval to future 4 years ago
Manos Pitsidianakis ed3e66cedf
BackendOp: remove description() method 4 years ago
Manos Pitsidianakis e06308fed2
MailBackend: change more methods to Futures 4 years ago
Manos Pitsidianakis c82367e00d
BackendOp: Change set_{flag,tag} methods 4 years ago
Manos Pitsidianakis 8c1fc031e5
BackendOp: change fetch_flags retval to Result<Flag> 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 64e5d4af4f
imap/untagged.rs: properly queue refresh events
RefreshEvents where added in self.uid_store.refresh_events queue though
ImapConnection has a method add_refresh_event() that drains the queue if
possible
4 years ago
Manos Pitsidianakis 2a0ad92374
imap: don't send CRLF twice when sending LITERAL
This results in BAD IMAP errors, as a CRLF results in an empty command.
4 years ago
Manos Pitsidianakis d7444a5b19
imap: recognize EXPUNGE events 4 years ago
Manos Pitsidianakis d827ea1001
imap/connection.rs: debug print NO/BAD responses 4 years ago
Manos Pitsidianakis fda947f8fb
imap.rs: fix two warnings 4 years ago
Manos Pitsidianakis c08ceae97c
imap: add status_response() parser 4 years ago
Manos Pitsidianakis c7835ccc13
imap: add mailbox_token() parser 4 years ago
Manos Pitsidianakis c2300e8ea0
imap: update is_online flag on successful read/write 4 years ago
Manos Pitsidianakis 01e1f4111c
imap: make hostname optional in ENVELOPE address parser 4 years ago
Manos Pitsidianakis 79b2e20557
imap: add message to Badcharset, Permanentflags responses 4 years ago
Manos Pitsidianakis 3703ae762e
imap: show reason for error on invalid uid fetch response 4 years ago
Manos Pitsidianakis af4ad19169
imap: add chain_err_summary error descriptions 4 years ago
Manos Pitsidianakis 75f9256a50
email/parser: change Error type to include error location
Add ParsingError type that includes a string with the location and
possibly an explanation for the error.
4 years ago
Manos Pitsidianakis 40f66f3333
imap: modify connection timeouts 4 years ago
Manos Pitsidianakis 34d782f16f
imap: Remove panic from fetch_flags 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 5 years ago
Manos Pitsidianakis c77af98b26
imap: prevent deadlock in operations.rs
imap/operations.rs could deadlock with imap/watch.rs when both lock the
main IMAP connection but both also need to lock UIDStore
5 years ago
Manos Pitsidianakis 7a770c7f7b
imap: fetch RFC822 instead of RFC822.HEADER
RFC822.HEADER is not parsed in imap/protocol_parser.rs
5 years ago
Manos Pitsidianakis 6079909f9c
imap: add managesieve connection
So far only the connection is implemented, and using the
testing/manage_sieve binary you can get a shell to a managesieve server.

The managesieve interface will be used in the UI from a plugin, but the
plugin's interface isn't implemented yet.
5 years ago
Manos Pitsidianakis 6b2a1f7757
imap: Don't fail on WouldBlock on ImapBlockingConnection 5 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.
5 years ago
Manos Pitsidianakis 33c1bf6558
Add consume newlines flag to phrase() 5 years ago
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
5 years ago
Manos Pitsidianakis 499fd59c6e
melib/imap: implement refresh() 5 years ago
Manos Pitsidianakis bbdc9d69b4
melib/imap: add ImapConnection::connect() 5 years ago
Manos Pitsidianakis 9a46e58029
imap: don't retry command on reconnection
If a command fails and connection is restarted, don't try the command
again; it only made sense in the previous connection's context.
5 years ago
Manos Pitsidianakis f208948651
melib: add mailbox delete/create to IMAP 5 years ago
Manos Pitsidianakis 6a096dd405
Add missing copyright preambles 5 years ago
Manos Pitsidianakis 5dc477bcd5
Fix some unused etc warnings 5 years ago
Manos Pitsidianakis 77d9cef6fc
melib/imap: small fixes
- Ignore final line ("M__ OK ...") when parsing FETCH response.

- Remove unnecessary import and reword some error messages
5 years ago
Manos Pitsidianakis 7f8c638361
melib/imap: add mailbox creation ability 5 years ago
Manos Pitsidianakis ca7d72e732
melib: Replace String with Cow<'static, str> 5 years ago
Manos Pitsidianakis 21526b5faf
melib: make Work use FnOnce closures
There was no need to use Fn() instead of FnOnce()
5 years ago
Manos Pitsidianakis 9211913405
meli/backends: honor mailbox subscriptions in IMAP/JMAP 5 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
5 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.
5 years ago
Manos Pitsidianakis 7732b851e6
melib: fix minor header parsing errors
- set_subject checked if last byte was control character instead of last
character. Characters can be multi-byte, duh.
- email::parser::date didn't provide for Date values that had -0000
instead of +0000 (that's a chrono requirement/bug)
5 years ago
Manos Pitsidianakis 9fae0f2fa3
melib/imap: prevent minor blocking cases 5 years ago
Manos Pitsidianakis f05a4205f7
melib/ui: small fixes
- melib/imap: accept quoted strings with escaped quotes in
protocol_parser
- ui/accounts: return unavailabity correctly if folder's worker slot is
empty instead of judging only by its vacancy
- ui/MailView: set view as not dirty if envelope loading from backend
fails so that it stops requesting it in every subsequent redraw
5 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
5 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.
5 years ago
Manos Pitsidianakis 569127fac5
melib/imap: detect untagged CAPABILITY responses
Gmail sends an untagged CAPABILITY response before accepting login, so
be smarter when logging in
5 years ago
Manos Pitsidianakis 8235af9237
melib/imap: quote mailbox names on SELECT/EXAMINE 5 years ago
Manos Pitsidianakis a20e08eb43
imap: treat \NoSelect mailboxes as empty
\NoSelect are mailboxes that can't be selected, thus treat them as if
they are empty.
5 years ago
Manos Pitsidianakis 0eaf17871a
melib: add set_tags command in BackendOp 5 years ago
Manos Pitsidianakis dab9b39f4d
melib/imap: detect tag (\* flag) support 5 years ago
Manos Pitsidianakis 9d8d3e09f4
melib: remove unused methods from BackendOp 5 years ago
Manos Pitsidianakis 3dc0cb1963
imap: send 'finished' signal when watch thread dies 5 years ago
Manos Pitsidianakis eecec551c1
Display watch thread errors to user
Show a proper notification with the error message to the user instead of
just logging it on debug-tracing.
5 years ago
Manos Pitsidianakis 424b244bb7
fixup some TODO and FIXMEs 5 years ago