Commit graph

85 commits

Author SHA1 Message Date
Edward Rudd
9c08e14523 adjust parse_until_done to return an Option so it is more versatile 2022-09-26 14:21:55 -04:00
Edward Rudd
1da3eb5571 add parse_many_into2 which supports capturing two different data types 2022-09-26 12:25:06 -04:00
Edward Rudd
b12eda4924 implement ACL extension 2022-09-05 15:22:03 -04:00
Conrad Hoffmann
1732482a4f Add test for MULTIAPPEND UIDPLUS response 2022-08-02 10:47:23 +02:00
Conrad Hoffmann
213887bf27 Add test for parse_append() 2022-08-02 10:34:04 +02:00
Conrad Hoffmann
75e5d7cf79 Add support for APPENDUID response data
If the `UIDPLUS` extension is supported, the server will reply to
`APPEND` commands with the UID of the new message. This can even be a
list of UIDs if the `MULTIAPPEND` extension is also supported.

Make this information available to the user as the result of an
`AppendCmd`. The added doc strings have links to the relevant RFCs.

Related to #131.
2022-08-02 10:32:55 +02:00
Conrad Hoffmann
b068208877 Add test case for EXPUNGE response w/ mod sequence 2022-07-14 14:55:46 +02:00
Conrad Hoffmann
81ed9ff1cf Expose HIGHESTMODSEQ value in EXPUNGE response
If the `QRESYNC` extension (RFC 7162) is being used, `EXPUNGE` responses
will return the new highest mod sequence for the mailbox after the
expunge operation. Access to this value is quite valuable for caching
clients.
2022-07-14 12:05:37 +02:00
Crispin Stichart
b22ce3a605 Add support for Gmail Labels 2022-04-12 11:33:02 -05:00
Todd Mortimer
57834a1466 Use get() in tests 2021-07-31 20:04:22 -04:00
Todd Mortimer
7e581a6b5e Use std::iter::once instead of Some. 2021-07-25 22:13:16 -04:00
Todd Mortimer
826e6d413b Fix tests and examples. 2021-07-17 16:51:35 -04:00
Todd Mortimer
3f2331423c Rework Name and Fetch to use ouroboros.
Use a helper function in `parse_many_into` to support parsing into
any container that implements Extend. Refactor Capabilities to use it.

Delete ZeroCopy and associated bits.

Move Flag into it's own module in types.
2021-07-17 16:32:26 -04:00
Todd Mortimer
c2d3aed978 Convert Capabilities to ouroboros. 2021-07-05 20:11:36 -04:00
comex
55cd6465c7
Support parsing STATUS responses. (v2) (#192)
Fixes #185.
2021-05-16 18:12:16 -04:00
mordak
1db492ed3b
Add test for dovecot unsolicited OK progress message. (#196) 2021-04-25 19:59:05 -04:00
Clément DOUIN
2898e19530
RFC 5256 - SORT command (#180) 2021-04-19 23:03:23 -04:00
Todd Mortimer
f2d7919f60 Do not wrap AttributeValue. 2021-04-07 20:10:33 -04:00
Todd Mortimer
5942553e7d Use iterators for Flag::from_strs() 2021-04-07 18:09:46 -04:00
Todd Mortimer
e1db863691 Add helper function to transform a vec of flag strings into a vec of Flags.
Also use it where we were previously iterating manually.
2021-04-05 15:59:12 -04:00
Todd Mortimer
5e3f087007 Merge remote-tracking branch 'origin/master' into idle-responses 2021-04-05 15:23:50 -04:00
Todd Mortimer
35ddb48d3b Remove redundant slice.
Thanks clippy.
2021-03-28 18:19:57 -04:00
Todd Mortimer
529401a36d Implement a method to pass unilateral responses while IDLE.
While IDLE, the server sends unilateral responses to notify the client of
changes to the mailbox as they happen. Instead of always exiting the IDLE
on any change, allow the caller to pass a callback function which receives
the messages and returns an action to either Continue IDLE or Stop and exit.

For clients wishing to use the previous behaviour, a callback_stop convenience
function is provided that terminates the IDLE on any change to the mailbox.
2021-03-28 15:27:39 -04:00
Todd Mortimer
ec835d67e4 Rename handle_unilateral to try_handle_unilateral.
More accurately conveys that the function might not actually handle it.
2021-03-20 14:21:13 -04:00
Jon Gjengset
fa30a90827
Handle other MailboxDatum 2021-03-14 11:02:03 -07:00
Jon Gjengset
7860b14088 Revert "Release first 3.0.0 alpha"
This reverts commit 8490407d2e.
2021-03-06 15:35:00 -08:00
Jon Gjengset
8490407d2e Release first 3.0.0 alpha 2021-03-06 15:34:42 -08:00
Jon Gjengset
18ca65dd3f Expose mailbox read-only flag 2021-03-06 15:02:48 -08:00
Jon Gjengset
9b78550394 Adopt latest imap_proto and expose error status codes 2021-03-06 14:53:14 -08:00
Jon Gjengset
3cf13d2260 cargo fmt 2021-03-06 09:44:56 -08:00
Jon Gjengset
a466e947bd
Merge branch 'master' into metadata-merge 2021-03-06 12:43:43 -05:00
Jon Gjengset
137f3de14f
Merge branch 'master' into mod_seq_vanished 2021-03-06 12:40:30 -05:00
Todd Mortimer
166a0cb6b3 Link to QRESYNC RFC section describing VANISHED vs EXPUNGE responses. 2020-12-06 15:49:11 -05:00
Todd Mortimer
a9788ad1e0 Add a Deleted type to wrap EXPUNGE and VANISHED responses.
EXPUNGE may return either a series of EXPUNGE responses each with
a single message sequence number, or a VANISHED response with a
sequence set of UIDs. This adds a wrapper enum and some associated
iterators to make it easy to handle these in the client.
2020-12-05 20:32:14 -05:00
Todd Mortimer
c49e78b4d0 Update imap-proto and nom dependencies.
Add support for HIGHESTMODSEQ (RFC 4551) and VANISHED (RFC 7162),
which allows users to quickly synchronize to a mailbox by fetching
only changes since the last known highest mod sequence.
2020-11-11 11:37:33 -05:00
sergey
a29b6f0cce Adding METADATA support 2020-05-19 15:58:43 +03:00
Jon Gjengset
0c3ce7943d
Expose unilateral mailbox flag changes
This is a backwards incompatible change, since it adds a variant to a
public enum.
2020-05-18 14:12:13 -04:00
Jon Gjengset
b74bfa79c6
FLAGS can be sent as unilateral response
Fixes #161 (well, the side-issue in #161).
2020-05-18 14:03:16 -04:00
Jon Gjengset
949ea3bd6b
Bump dependencies
This also pulls in imap-proto 0.11, which exposes message envelopes as
`&[u8]` instead of `&str`. This directly affects our public API.
2020-02-20 12:49:25 -05:00
Alexander Krotov
2221cd2e18
Update imap-proto and test that "IMAP4REV1" capability is accepted
See issue https://github.com/djc/tokio-imap/issues/54
2019-09-04 18:08:12 +03:00
avitex
ff48dc9755
Decrease alloc on auth resp parsing 2019-09-03 23:41:57 +10:00
Lucas
3a5c2e9d91
Implemented new enumerated Capabilities from imap-proto crate. 2019-09-02 23:00:40 +10:00
Jon Gjengset
466c06c1f2
Avoid unnecessary import 2019-04-29 12:07:04 -04:00
Jon Gjengset
c0e1fbba0c
Avoid duplicating unilateral response handling 2019-03-18 21:43:30 -04:00
Jon Gjengset
b0ac079c30
rustfmt 2019-03-18 21:37:39 -04:00
Emmanuel Lesueur
5df0759446 Handle unsolicited responses in noop. 2019-03-16 13:31:52 +01:00
Jon Gjengset
67ee2f5175
Bump version for imap-proto fixes
- A `NIL` hierarchy delimiter in a `Name` is now properly parsed and exposed as `None`
 - `RFC822.TEXT` responses are now returned by `Fetch::text()`.
2018-12-07 16:34:57 -05:00
Jon Gjengset
1b086d40de
Prep for 2018 edition [skip ci] 2018-11-28 09:44:01 -05:00
Jon Gjengset
a610283861
Fix nightly clippy warning 2018-11-24 12:45:07 -05:00
Jon Gjengset
bce4831ccb
Clippy clean 2018-11-22 14:27:07 -05:00