Manos Pitsidianakis
b9343dfb32
imap: update supported capabilities
4 years ago
Manos Pitsidianakis
fadb3634e0
melib: take MailboxHash instead of &Mailbox in fetch*()
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
32f196143e
melib: add supports_search() method to MailBackend
4 years ago
Manos Pitsidianakis
931863436d
imap: remove blocking imap backend, replace with async
4 years ago
Manos Pitsidianakis
b5748c247a
MailBackend: remove connect() method
4 years ago
Manos Pitsidianakis
231471fa8c
MailBackend: add is_{async,online} methods
4 years ago
Manos Pitsidianakis
94e0aa4fe7
MailBackend: change get() ret type to Result<_>
4 years ago
Manos Pitsidianakis
a7e177586a
Fix clippy lints
4 years ago
Manos Pitsidianakis
e06308fed2
MailBackend: change more methods to Futures
4 years ago
Manos Pitsidianakis
de201b5d6c
imap: create message_sequence cache
...
Close #45 (hopefully)
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
efb06be09b
melib: return Result<_> from operation()
...
Envelope might have been deleted before main thread requests an
operation, which is a race condition.
4 years ago
Manos Pitsidianakis
6f6f795fd5
imap: use uidnext for fetching all messages in get()
4 years ago
Manos Pitsidianakis
c08ceae97c
imap: add status_response() parser
4 years ago
Manos Pitsidianakis
7d359624fe
imap: early return on empty mailbox in get()
4 years ago
Manos Pitsidianakis
af4ad19169
imap: add chain_err_summary error descriptions
4 years ago
Manos Pitsidianakis
40f66f3333
imap: modify connection timeouts
4 years ago
Manos Pitsidianakis
c7fbc5cafb
imap: remove redundant passing of AccountHash
4 years ago
Manos Pitsidianakis
2d862e39f4
imap: off by one error in iteration
4 years ago
Manos Pitsidianakis
2d3f49d64d
imap: index by (MailboxHash, UID) instead of just UID
...
Mailboxes can share UIDs.
4 years ago
Manos Pitsidianakis
f3d5edfe14
Add copy/move to other account operations
4 years ago
Manos Pitsidianakis
5435a4615e
imap: don't try to connect in is_online()
...
Attempting to connect to the server when calling imap's is_online()
blocks the UI process, so don't.
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
e4a1ab8a09
Fix rustfmt suggestions
4 years ago
Manos Pitsidianakis
bd404e6937
Execute user shell commands with /bin/sh
...
Execute user provided command invocations $CMD such as `editor_cmd` with
`/bin/sh` as `/bin/sh -c "$CMD"
Previously, user commands were split by whitespace which must trigger
erroneous behavior if quotes are involved.
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
e9a935dbf7
melib: add search method in mail backends
4 years ago
Manos Pitsidianakis
c37d8bd331
imap: add mutex timeout lock and remove unwraps
4 years ago
Manos Pitsidianakis
a8c1016f37
Add various logic checks
4 years ago
Manos Pitsidianakis
6ca8c3b964
imap: add server_password_command
4 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.
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
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