Commit Graph

155 Commits (733de5a5fbd0115ea02393f6caab99d728e189eb)

Author SHA1 Message Date
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 f38d03e43a
melib: {create,delete}_folder returns updated folders
Potential parent folders will have their children fields updated, so
just return all folders.
4 years ago
Manos Pitsidianakis f5e694cf5a
Make small cosmetic fixes 4 years ago
Manos Pitsidianakis f208948651
melib: add mailbox delete/create to IMAP 4 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
4 years ago
Manos Pitsidianakis 56e3ea1548
melib/imap: refactor early error exit 4 years ago
Manos Pitsidianakis 7f8c638361
melib/imap: add mailbox creation ability 4 years ago
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
4 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 7eceef93e9
melib/backends: remove folder_operation
folder_operation functionalities will go to BackendFolder trait
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 d2b4057b7b
melib/MailBackend: add connect() method 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 9fae0f2fa3
melib/imap: prevent minor blocking cases 5 years ago
Manos Pitsidianakis bce97d71bb
testing/imap_conn: update imapconn shell use 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 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 ba52c59859
bin: add backend specific validation functions for --test-config flag 5 years ago
Manos Pitsidianakis 4677f9c6bb
melib/imap: initialise uid_store folders in folders() 5 years ago
Manos Pitsidianakis b8e4a35963
melib/imap: add default capabilities to SUPPORTED_CAPABILITIES 5 years ago
Manos Pitsidianakis 41a678c6ef
melib: make MailBackend::folders return Result
Change folders() signature:
-    fn folders(&self) -> FnvHashMap<FolderHash, Folder>;
+    fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>>;

Imap may not be online, therefore we need the ability to return an
error.
5 years ago
Manos Pitsidianakis fc2d9a684d
melib/imap: set has_attachments based on BODYSTRUCTURE
fetch BODYSTRUCTURE along with ENVELOPE from server and set
has_attachments based on the MIME structure of the envelope.

Notes: BODYSTRUCTURE returns the MIME structure of the envelope without
the data, so if it includes a multipart/mixed it *should* have
attachments.
ENVELOPE returns basic headers of the message like Sender, Subject, Date
etc.
5 years ago
Manos Pitsidianakis b2cd4f4b7a
melib/imap: put imap folders in RwLock instead of Mutex
This should prevent lockups if the IMAP conn thread gets blocked
5 years ago
Manos Pitsidianakis 321be8555f
Cleanup startup error exit paths
Make startup methods return Results so that the main binary can exit
cleanly instead of using std::process::exit from arbitrary positions,
which exits the process immediately and doesn't run destructors.
5 years ago
Manos Pitsidianakis 5761f854e2
melib: Add FolderPermissions
permissions() method on BackendFolder and SetPermissions in
FolderOperation enum.
5 years ago
Manos Pitsidianakis c1902f96b5
imap: add UIDVALIDITY check
On UIDVALIDITY change, discard cache and force rescan.
5 years ago
Manos Pitsidianakis 229e879c26
ui/imap: select user given folder before search
IMAP search() didn't select a folder before searching, thus searching
the mailbox the previous user of self.connection had selected.
5 years ago
Manos Pitsidianakis 99697a8fd5
ui: Add search for IMAP
Add basic search utilising the default SEARCH capability.
5 years ago
Manos Pitsidianakis 7936aef476
Fix infinite watch threads spawning
Watch threads were launched every time the account's online status was
checked, added a check to only do it when it was previously offline.
5 years ago
Manos Pitsidianakis 61fa6d3d4b
ui: show supported IMAP CAPABILITIES list in Status
In status page for IMAP accounts, show a list of CAPABILITIES and
whether meli supports them
5 years ago
Manos Pitsidianakis f56b89dde3
melib: add as_any() method to MailBackend trait
Cast the trait object into an &Any object. Then we can downcast it to
its actual type with downcast_ref().
5 years ago
Manos Pitsidianakis d926cadc4d
melib: remove argument from MailBackend operation()
The operation() method on the MailBackend trait returns a trait object
that can read or modify an Envelope directly from the backend. This is
used to get eg the envelope's text, or set flags. It has two arguments,
envelope hash and folder hash.

Only the Maildir backend needed the latter argument, and it can be replaced with a dictionary to match envelope hashes to folder hashes within the Maildir backend.
5 years ago
Manos Pitsidianakis e5b6faf6bd
Add account online status
Add a boolean field to accounts that states if the account can be
accessed. Local backends (Maildir/mbox) return true every time, but
remote backends (IMAP) may not. Accounts start as offline and then get
initialised when their status goes to online. Right now if an IMAP
account startup but later get offline, there are crashes. With this
change the account can be switched back to offline when that happens.
5 years ago
Manos Pitsidianakis ee82ae175a
imap: add support for imaps connections
Take port value and a `use_starttls` flag from the configuration file.
5 years ago
Manos Pitsidianakis 7dc3efaedd
imap: allow conn to be offline and retry on demand
Split the TlsStream of the live IMAP connection to an enum to allow both
offline and online states. The connection is restarted if offline when
requested.
5 years ago
Manos Pitsidianakis 059d86de93
map: restart connection on failure in read_lines 5 years ago
Manos Pitsidianakis bfc36f63de
imap: add byte cache for Envelopes in IMAP backend 5 years ago
Manos Pitsidianakis f394fde143
add priority and info to jobs and workers
jobs now have a priority given to them, in order to parse some mailboxes
(eg INBOX, Sent) first.

worker threads now can set their names and status
5 years ago
Manos Pitsidianakis 81a55abc7c
Update crossbeam to 0.7.2 and remove chan 5 years ago
Manos Pitsidianakis ecb3fd7f3d
Add dyn keyword to Trait objects
And fix some unused var warnings as well
5 years ago
Manos Pitsidianakis d1d11356db
imap: get() ENVELOPE instead of RFC822.HEADER; it's faster 5 years ago
Manos Pitsidianakis 335a1011de
imap: add watch 5 years ago
Manos Pitsidianakis c3e3c98fb0
melib: filter subscribed folders in MailBackend::new() 5 years ago
Manos Pitsidianakis 64dc44f18f
imap: replace unwraps with checks 5 years ago
Manos Pitsidianakis 525bd16493
imap: add folder operations in backend 5 years ago
Manos Pitsidianakis c9f7b41e47
imap: continuous payload delivery in async workers 5 years ago
Manos Pitsidianakis c561814cd6
imap: add `danger_accept_invalid_certs` option 5 years ago
Manos Pitsidianakis 0812242f60
Add IMAP backend
TODOs: new message events (untagged responses)
5 years ago
Manos Pitsidianakis c6674a294d
melib: unwrap mailbox module 5 years ago