Commit graph

129 commits

Author SHA1 Message Date
Jos van den Oever
08c2b6847b Add APPEND call. (#30) 2017-05-02 22:08:24 -04:00
drevilt
89a8d0eaf3 update to openssl 0.9 (#31) 2017-05-01 15:39:12 -04:00
Jon Gjengset
e5b4346114 Add IMAP IDLE support (#27)
* Add IMAP IDLE support

This patch adds support for the IMAP IDLE command specified in RFC 2177.
It allows clients to block while waiting for changes to a selected
mailbox, without having to poll the server. This is especially useful
for monitoring a mailbox for new messages.

The API is currently somewhat primitive: users can call `Client::idle()`
to get an IDLE "handle", which they can then call `wait()` on to block
until a change is detected. The implementation also provides
`wait_keepalive()` (which tries to avoid connection timeouts) and
`wait_timeout()` (which allows the user to specify the maximum time to
block).

Further down the line, the handle should probably also implement
`Iterator` to allow clients to watch new events as they happen. This
*could* be implemented today, but given that most other `Client` methods
just return unparsed strings at the moment, I didn't feel like that
enhancement was a high priority. For now, users will have to manually
query the mailbox for what changed.

Fixes #26.

* Avoid unnecessary as_bytes()

* Make wait_keepalive interval configurable

* Avoid ?, which requires Rust 1.13
2017-03-02 17:55:32 -05:00
drevilt
59163929d3 update regex to 0.2 (#25) 2017-03-02 17:16:22 -05:00
drevilt
dc3b4f92e6 update to openssl 0.8 and unspecify micro versions (#22) 2017-03-02 17:08:54 -05:00
Matt McCoy
576b12b68a Use try! for conversion of io error to my error 2016-07-14 20:05:03 -04:00
Matt McCoy
75410ed5b5 Adding debugging functionality 2016-07-14 19:58:25 -04:00
Matt McCoy
e033e4bcde Removing print from readline 2016-07-14 16:35:38 -04:00
Miquel Ruiz
6e872bb340 Refactor tests to better support UID commands 2016-07-12 10:37:09 +01:00
Miquel Ruiz
eb0b4d9b50 Support for UID FETCH & tests 2016-07-11 22:48:03 +01:00
Miquel Ruiz
2f1af34b2d Support for UID COPY & tests 2016-07-11 22:44:46 +01:00
Matt McCoy
2f73134f64 Merge pull request #17 from miquelruiz/master
Add support for "STORE" command
2016-07-11 13:24:43 -04:00
Miquel Ruiz
a481c6f0c7 Support for UID STORE 2016-07-10 20:55:30 +01:00
Miquel Ruiz
be8796fe49 Use try! macro instead of explicity match Results 2016-07-10 18:51:10 +01:00
Miquel Ruiz
9e5d5986d0 Support for STORE 2016-07-10 14:47:46 +01:00
Matt McCoy
75c4268e4e Removing invalid parse test 2016-06-29 19:20:32 -04:00
Matt McCoy
25633dee98 Adding option to upgrade tcp connection to ssl connection 2016-06-29 17:01:48 -04:00
Matt McCoy
43f4737b85 Cleaning up some of the authenticator code 2016-06-29 16:45:36 -04:00
Matt McCoy
8d39bfd343 Hardening the oauth2 example for gmail 2016-06-28 22:29:55 -04:00
Matt McCoy
8a1162ada4 Initial testing for authentication 2016-06-28 21:48:25 -04:00
Matt McCoy
8653a02b87 Adding initial work for authentication 2016-06-26 22:40:15 -04:00
Matt McCoy
a9d59209e3 Adding new function to create client with an underlying stream 2016-06-24 22:36:46 -04:00
Matt McCoy
318b14bc62 removing TODOs for making sure test response was read correctly 2016-06-24 21:30:37 -04:00
Matt McCoy
d2a3482f1f Adding status command and putting parsing response into method 2016-06-24 21:27:36 -04:00
Matt McCoy
472f77de55 Adding LSUB command 2016-06-24 21:20:50 -04:00
Matt McCoy
92341ad125 Adding list command 2016-06-24 21:17:18 -04:00
Matt McCoy
a87c58bf91 Adding more tests for the parser 2016-06-24 20:10:47 -04:00
Matt McCoy
69179ebdac Add testing for capability parsing 2016-06-24 19:49:41 -04:00
Matt McCoy
378b4bbb96 Adding errors for parsing problems 2016-06-24 19:38:04 -04:00
Matt McCoy
56edd6c46b Adding some comments and cleaning up imports 2016-06-24 09:54:03 -04:00
Matt McCoy
aa989ce0e5 Fixing some extra imports 2016-06-23 22:56:22 -04:00
Matt McCoy
6c826625fd Initial work for adding errors 2016-06-23 22:44:12 -04:00
Matt McCoy
923339e5f0 More through testing of select and examine 2016-06-22 21:25:48 -04:00
Matt McCoy
808640e00d Adding test for select 2016-06-22 21:16:39 -04:00
Matt McCoy
2011d3a92a Adding docs for pub functions that run commands 2016-06-22 21:14:24 -04:00
Matt McCoy
e344438e60 Moving pars select or examine to parse 2016-06-22 19:32:52 -04:00
Matt McCoy
5d94a5d7d7 Moving parse capability into parse file 2016-06-22 19:19:56 -04:00
Matt McCoy
829b7de542 Moving parse response ok to its own file 2016-06-22 19:17:18 -04:00
Matt McCoy
c08385e061 Removing more uneeded regex checks 2016-06-21 23:26:13 -04:00
Matt McCoy
eca26018e8 Removing error check for invalid regex 2016-06-21 23:22:36 -04:00
Matt McCoy
2aa66be25d Adding capability tests 2016-06-21 23:16:03 -04:00
Matt McCoy
8e99f80dca Add testing for the examine command 2016-06-21 23:05:22 -04:00
Matt McCoy
bebcfab52c Adding test for readline failing on err 2016-06-21 22:02:24 -04:00
Matt McCoy
d5e8877eaf Changing error message for readline 2016-06-21 21:55:11 -04:00
Matt McCoy
eeffe7420f Moving line reading into its own function 2016-06-21 21:31:17 -04:00
Matt McCoy
625fb09c8b Move mailbox to its own file 2016-06-21 20:34:19 -04:00
Matt McCoy
50a55d59c4 Adding FETCH test 2016-06-21 20:28:59 -04:00
Matt McCoy
6dd23c4647 Adding tests for create and delete 2016-06-21 20:19:31 -04:00
Matt McCoy
de06ae7960 Adding NOOP test 2016-06-21 20:13:24 -04:00
Matt McCoy
2d2c0ba961 Adding login and logout test 2016-06-21 20:11:41 -04:00