From 5af6fcf4b8bc3901793963a5f42af93c2de873c1 Mon Sep 17 00:00:00 2001 From: Michael Spiss Date: Sun, 21 Apr 2019 17:07:40 +0200 Subject: [PATCH 1/4] Update "features and bugs" section in readme give clearer instructions on how to contribute --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1582145..89af694 100644 --- a/README.md +++ b/README.md @@ -109,4 +109,8 @@ await client.authenticate(new ImapPlainAuth("username", "password")); To close the connection, `logout` can either be called in a folder or the client itself. ## Features and bugs -Please file feature requests and bugs at the [issue tracker](https://github.com/michaelspiss/imap_client/issues). +Feel free to contribute to this project. + +If you find a bug or think of a new feature, but don't know how to fix/implement it, please [open an issue](https://github.com/michaelspiss/imap_client/issues). + +If you fixed a bug or implemented a new feature, please send a [pull request](https://github.com/michaelspiss/imap_client/pulls). From 01a834f564548e22c458ce11de948394d447f73c Mon Sep 17 00:00:00 2001 From: michaelspiss Date: Sat, 18 May 2019 15:53:12 +0200 Subject: [PATCH 2/4] Expose capability lists --- lib/src/imap_commandable.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/src/imap_commandable.dart b/lib/src/imap_commandable.dart index eff2fe8..e44de6e 100644 --- a/lib/src/imap_commandable.dart +++ b/lib/src/imap_commandable.dart @@ -4,6 +4,21 @@ part of imap_client; abstract class _ImapCommandable { ImapEngine _engine; + /// Gets full server capabilities list + List getCapabilities() { + return UnmodifiableListView(_engine._capabilities); + } + + /// Checks if server has capability + bool hasCapability(String capability) { + return _engine.hasCapability(capability.toUpperCase()); + } + + /// Gets all available authentication methods + List getAuthenticationMethods() { + return UnmodifiableListView(_engine._serverAuthCapabilities); + } + /// Sends custom command. Command must not include CRLF (\r\n)! /// /// Untagged handler maps must have keys in UPPERCASE! From e43a665235e0a8fa01f63c282a49afaea4b63240 Mon Sep 17 00:00:00 2001 From: michaelspiss Date: Sat, 18 May 2019 16:02:40 +0200 Subject: [PATCH 3/4] Fix #13 by refreshing capabilities after tls negotiation is complete --- lib/src/imap_client.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/imap_client.dart b/lib/src/imap_client.dart index ee7adda..fcb0106 100644 --- a/lib/src/imap_client.dart +++ b/lib/src/imap_client.dart @@ -122,6 +122,8 @@ class ImapClient extends _ImapCommandable { }); // Negotiate tls _engine._setSocket(await SecureSocket.secure(_engine._socket)); + // refresh capabilities list + await capability(); return response; } From 1d2caf8fa6213b13b474a5872b81e704339cc272 Mon Sep 17 00:00:00 2001 From: michaelspiss Date: Sat, 18 May 2019 16:06:38 +0200 Subject: [PATCH 4/4] Bump version to 0.2.3, add changes to changelog --- CHANGELOG.md | 5 +++++ pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d2e80..58dce0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.3 + +- Fix #13 by refreshing capabilities list after successful tls negotiation +- Expose capabilities list and accepted auth methods + ## 0.2.2 - Merge #10, fix string with leading escaped character diff --git a/pubspec.yaml b/pubspec.yaml index bb51fe7..ea3370a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: imap_client description: An interface to get emails via the imap protocol (version 4rev1) -version: 0.2.2 +version: 0.2.3 homepage: https://github.com/michaelspiss/imap_client author: Michael Spiss documentation: