Commit graph

208 commits

Author SHA1 Message Date
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
Todd Mortimer
753e1b9db1 Fix trivial clippy warnings. 2020-11-11 11:25:21 -05:00
mordak
ae07c9f31c
Add append_with_flags (#171)
Allows a client to set flags on a new message as it is appended to a mailbox.
2020-08-23 12:02:57 -04:00
Christian Krause
45a8fcf27e
Add note about server greeting to Client::new 2020-06-22 08:03:56 +02:00
sergey
a29b6f0cce Adding METADATA support 2020-05-19 15:58:43 +03:00
Remy Vuong
d6a6592420 Changed: a typo was fixed 2020-05-19 10:41:38 +02:00
Dillen Meijboom
391caf042a
Ignore server comments 2020-02-20 17:22:53 +01:00
Celti Burroughs
a4b03568be
Add imap::connect_starttls convenience function
Add a `imap::connect_starttls` convenience function, with the same
syntax as `imap::connect`, to make STARTTLS connections as easily as
IMAPS.

PR#140 removed `imap::connect_insecure` with the stated goal of
encouraging users to connect securely. With that change, users are
forced to construct their own `TcpStream`s when interacting with
non-IMAPS servers.

This change may perversely incentivise the use of insecure connections,
instead of discouraging them, as users may blindly copy-paste code
involving `Client::new` and `TcpStream`s so things "just work", without
the visual indicator of `_insecure` suggesting something is wrong.

Tangentially, [RFC 2595] encourages using STARTTLS instead of raw SSL
sockets. Ideally, we should support both options equally well.

[RFC 2595]: https://tools.ietf.org/html/rfc2595#section-7
2019-11-30 05:18:05 -07:00
Friedel Ziegelmayer
465481de88 fix(auth): handle single + response (#145) 2019-10-21 10:49:15 -04:00
Friedel Ziegelmayer
0e5aa5c004 feat: expose read_greeting (#144)
This is sometimes needed when manually using `Client::new()`.

We enforce that the greeting is read at most once.
2019-10-21 10:13:39 -04:00
Lem
39b8087b3c
Update src/client.rs
Fix typo in fix for typo.

It's not 'data_times' or 'data_itmes'. It should be 'data_items'!

Co-Authored-By: Jon Gjengset <jon@thesquareplanet.com>
2019-10-18 20:31:34 +02:00
Lemm
e41b235387 Fix typo in documentation
data_times should be data_items for
function "status"
2019-10-18 20:23:10 +02:00
Bryce Fisher-Fleig
29fece1221 (security) Remove connect_insecure
In order to discourage folks from connecting securely, we're removing the
convenience method imap::connect_insecure.

Fear not\! For those who manage security in another way (aka a private network
or similar measures), it is still possible to connect without TLS by using the
imap::Client::new() method. See that method for examples of how to do this.
2019-09-24 08:13:17 -07:00
Bryce Fisher-Fleig
f15bdfb458 (feat) default feature for native_tls (aka openssl)
Establishes conditional compilation for all integration with the
native_tls crate in this crate. Since native_tls has been deeply
integrated into this crate for a long time, we want to maintain
backwards compatibility by making this feature part of the default.

For a consumer of this crate to "opt-out", including this in
cargo.toml:

```
[dependencies.imap]
version = 0.16.0        # Replace this with the correct version
default-features = false
```

See the conversation on Github for details on this approach:
https://github.com/jonhoo/rust-imap/issues/123
2019-09-24 08:13:17 -07:00
Bryce Fisher-Fleig
beb41d2f52 (feat) Provide example integration with Rustls crate
By checking this code in as an example, we can prevent bitrot as we continuously test this
in CI. It also demonstrates how to setup TLS without relying on platform specific dependencies
via native_tls crate.
2019-09-17 12:51:38 -07:00
avitex
ff48dc9755
Decrease alloc on auth resp parsing 2019-09-03 23:41:57 +10:00
Jon Gjengset
2aa8c87e35
Move to 2018 edition 2019-09-03 09:35:15 -04:00
avitex
1c51fbe3ac
Make clippy happy again 2019-09-02 23:44:18 +10:00
Lucas
3a5c2e9d91
Implemented new enumerated Capabilities from imap-proto crate. 2019-09-02 23:00:40 +10:00
Niklas Claesson
b35823da7c Fix quoting issue in LIST command 2019-04-28 21:59:55 +02:00
Jon Gjengset
a7a2798bf1
Merge pull request #110 from Emm54321/fix-noop
Handle unsolicited responses in noop.
2019-03-18 21:35:43 -04:00
Jon Gjengset
5577fa678e
for old Rust too 2019-03-17 12:43:11 -04:00
Jon Gjengset
1dd4b31fa2
clippy 2019-03-17 12:39:29 -04:00
Emmanuel Lesueur
5df0759446 Handle unsolicited responses in noop. 2019-03-16 13:31:52 +01:00
Seo Sanghyeon
d01eb40de0 Fix uid_fetch doc 2019-02-22 01:48:50 +09:00
Jon Gjengset
ead7d2173b
rustfmt beta 2018-12-10 10:14:09 -05:00
Jon Gjengset
5dc51ac6b1
Show example of how to use store to delete 2018-11-22 17:57:56 -05:00
Jon Gjengset
357603b15f
Empty string != "" 2018-11-22 17:57:41 -05:00
Jon Gjengset
2b17bc0538
Make all public methods generic over str ref 2018-11-22 17:57:05 -05:00
Jon Gjengset
bce4831ccb
Clippy clean 2018-11-22 14:27:07 -05:00
Jon Gjengset
fc935bf884
Simplify fetch a little 2018-11-22 14:03:29 -05:00
Jon Gjengset
5dd9dfe469
Even more doc updates 2018-11-22 14:00:58 -05:00
Jon Gjengset
f83742dc3d
A significant documentation upgrade
Fixes #77.
Touches on #74.
Fixes #70 through documentation (I think?)
Fixes #62.
2018-11-21 16:37:47 -05:00
Kim Minh Kaplan
de5a38366c [BUGFIX] Expect a space after the "+" in Client::authenticate.
RFC 3501: A continue-req from the server starts with "+" SP.
2018-11-17 07:37:33 +00:00
Kim Minh Kaplan
c2c7e2a3f7 In Authenticator::process change the challenge from a Vec<u8> to a &[u8] 2018-11-10 08:54:46 +00:00
Kim Minh Kaplan
892fe49a68 Decode the Base64 AUTHENTICATE challenge 2018-11-09 22:35:22 +00:00
Kim Minh Kaplan
1dd55ff066 Move Authenticator to returning an AsRef<u8>. 2018-11-09 22:35:12 +00:00
Kim Minh Kaplan
93d032181d imap::client::Client::authenticate: Base64 encode the result of the Authenticator.
Fixes issue #95.
2018-11-07 11:05:48 +00:00
Jon Gjengset
b45beb88ed
Fix #93; why doesn't this fail for me or CI? 2018-11-03 16:03:32 -04:00
Johannes Schilling
930bd86dbf pass unsolicited responses channel by reference
as suggested in
https://github.com/mattnenterprise/rust-imap/pull/91#issuecomment-434055085
2018-11-01 21:47:50 +01:00
Johannes Schilling
f98398aecf send unsolicited responses to a channel instead of discarding them
notes

  * i tried to avoid the term "async", because that term is very
    overloaded and we're not using e.g. tokio/async-io here
  * i'm a little unhappy having to string the channel through the
    parser, because that seems rather a part of the client logic than
    parsing. on the other hand it's better than passing the whole
    client, so there's that at least.
2018-11-01 21:46:49 +01:00
Jon Gjengset
5c91f4c1bb
Move to new nom + tokio-proto 2018-10-31 21:15:19 -04:00
Jon Gjengset
e68d61a1e2
rustfmt 2018-10-31 21:15:13 -04:00
Jon Gjengset
510dab9604
Merge pull request #87 from mtorromeo/feature-uid_expunge
client: Add UID EXPUNGE support
2018-10-08 12:19:37 -04:00
Jon Gjengset
a9e993f98b
Merge pull request #88 from mtorromeo/feature-move
client: Add MOVE and UID MOVE support
2018-10-06 12:14:52 -04:00
Massimiliano Torromeo
201269423d
Renamed uid_move to uid_mv 2018-10-06 10:02:10 +02:00
Jon Gjengset
a10769feba
Tidy up search a little
There's no reason to carry around a ZeroCopy here, since we own all the
values.
2018-10-05 14:53:12 -04:00
Massimiliano Torromeo
11e666ea91
Use imap_proto to parse the search responses into a HashSet of ids 2018-10-05 18:20:59 +02:00
Massimiliano Torromeo
a6f0240f94 Renamed imap_move to mv 2018-10-05 17:29:43 +02:00