Commit Graph

26 Commits (258b6c8fe81c7d80c943f8e827f87c936c38698e)

Author SHA1 Message Date
Manos Pitsidianakis 258b6c8fe8
melib: add tags() method in MailBackend
Add tags() method that returns Option<Arc<RwLock<BTreeMap<u64, String>>>>.

The BTreeMap holds available tags in a mail backend and uses the tag's
hash as key.

The method returns an Option because not all backends may support
tagging.
2019-11-30 17:37:00 +02:00
Manos Pitsidianakis ba52c59859
bin: add backend specific validation functions for --test-config flag 2019-11-27 17:42:11 +02:00
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.
2019-11-23 17:47:24 +02:00
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.
2019-11-16 00:33:22 +02:00
Manos Pitsidianakis 77936e0cd5
melib: add notmuch backend
Missing:
- Watching for updates functionality
- Using tags
- Search
2019-11-15 22:56:45 +02:00
Manos Pitsidianakis 7463248da8
melib: change BackendOp::set_flag() signature 2019-11-15 21:32:55 +02:00
Manos Pitsidianakis 8f36678abf
melib: make Backendfolder::children return slice 2019-11-14 17:55:24 +02:00
Manos Pitsidianakis 5761f854e2
melib: Add FolderPermissions
permissions() method on BackendFolder and SetPermissions in
FolderOperation enum.
2019-11-11 00:47:23 +02:00
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().
2019-11-08 15:13:42 +02:00
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.
2019-11-08 15:13:41 +02:00
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.
2019-10-24 20:30:17 +03:00
Manos Pitsidianakis 6e75160b70
melib: turn unicode algos and backends into features 2019-09-21 21:29:33 +03:00
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
2019-09-15 13:21:14 +03:00
Manos Pitsidianakis ecb3fd7f3d
Add dyn keyword to Trait objects
And fix some unused var warnings as well
2019-09-15 13:21:14 +03:00
Manos Pitsidianakis c3e3c98fb0
melib: filter subscribed folders in MailBackend::new() 2019-09-15 13:21:14 +03:00
Manos Pitsidianakis c2c5f2db69
melib: add Failure to RefreshEventKind 2019-09-15 13:21:13 +03:00
Manos Pitsidianakis 0812242f60
Add IMAP backend
TODOs: new message events (untagged responses)
2019-09-15 13:21:13 +03:00
Manos Pitsidianakis dc2184a9de
melib: add Folder operations in mail backends
Add following operations in mail backend:
- Create,
- Delete,
- Subscribe,
- Unsubscribe,
- Rename
2019-09-08 11:15:57 +03:00
Manos Pitsidianakis 1328f994f3
Make config objects Serializable with serde 2019-08-25 21:44:19 +03:00
Manos Pitsidianakis b474b44b10
Add special use semantics for mailboxes 2019-08-25 10:48:01 +03:00
Manos Pitsidianakis 76909a1959
add folder subscriptions 2019-08-25 10:48:01 +03:00
Manos Pitsidianakis 84a042411d
melib: remove unnecessary unsafe impls 2019-08-15 11:30:25 +03:00
Manos Pitsidianakis 38da6c83b9
melib: add read-only support for mbox 2019-07-28 20:20:14 +03:00
Manos Pitsidianakis a62f1d6c01
add read-only option in accounts 2019-07-18 20:16:51 +03:00
Manos Pitsidianakis 14f1527e61
melib: remove BackendOpGenerator 2019-07-18 20:14:14 +03:00
Manos Pitsidianakis c6674a294d
melib: unwrap mailbox module 2019-06-10 19:40:50 +03:00