{"id":20038521,"url":"https://github.com/yahoo/imapnio","last_synced_at":"2025-04-06T01:05:52.943Z","repository":{"id":36990181,"uuid":"39282693","full_name":"yahoo/imapnio","owner":"yahoo","description":"Java imap nio client that is designed to scale well for thousands of connections per machine and reduce contention when using large number of threads and cpus. ","archived":false,"fork":false,"pushed_at":"2025-02-11T03:10:21.000Z","size":843,"stargazers_count":60,"open_issues_count":7,"forks_count":50,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-30T00:05:03.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yahoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":null,"code_of_conduct":"Code-of-Conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-18T01:42:26.000Z","updated_at":"2025-03-13T03:22:58.000Z","dependencies_parsed_at":"2025-02-24T20:01:41.015Z","dependency_job_id":null,"html_url":"https://github.com/yahoo/imapnio","commit_stats":null,"previous_names":["lafaspot/imapnioclient"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Fimapnio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Fimapnio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Fimapnio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Fimapnio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yahoo","download_url":"https://codeload.github.com/yahoo/imapnio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419859,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:29:46.767Z","updated_at":"2025-04-06T01:05:52.923Z","avatar_url":"https://github.com/yahoo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# imapnio\nA Java library that supports NIO (Non-blocking I/O) based IMAP clients.\n\nThe IMAP NIO client provides a framework to access an IMAP message store using None-blocking I/O mechanism.  This design scales well for thousands of connections per machine and reduces contention when using a large number of threads and CPUs.\n\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [Release](#release)\n- [Contribute](#contribute)\n- [License](#license)\n\n\n## Background\n\nThe traditional accessing IMAP message store uses [JavaMail API](https://www.oracle.com/technetwork/java/javamail/index.html), which requires a blocking I/O. In this case, threads are blocked when performing I/O with the other end. This project was developed to relieve the waiting thread to perform other tasks, and it's design efficiently improves thread utilization to maximize hardware throughput and capacity.\n\nSome of the more distinguishing features of this library are:\n- Highly customizable thread model and server/client idle max limit.\n- Leverages the well-established framework [Netty](https://netty.io/)\n- Future-based design enables a clean separation of IMAP client threads pool versus consumers threads pool. \n- IMAPv4, [RFC3501](https://tools.ietf.org/html/rfc3501) support.\n- ID command, [RFC2971](https://tools.ietf.org/html/rfc2971) support.\n- IDLE command, [RFC2177](https://tools.ietf.org/html/rfc2177) support\n- MOVE command, [RFC6851](https://tools.ietf.org/html/rfc6851) support\n- UNSELECT command, [RFC3691](https://tools.ietf.org/html/rfc3691) support\n\nThis project is ideal for applications that have a high requirement to optimize thread utilization and improve overall resource capacity. Specifically, this is best for situations where users perform a very high level of sessions and communication with the IMAP server.\n \n## Install\n\nThis is a Java library. After downloading it, compile it using `mvn clean install`\n\nThen, update your project's pom.xml file dependencies, as follows:\n\n```\n  \u003cdependency\u003e\n      \u003cgroupId\u003ecom.yahoo.imapnio\u003c/groupId\u003e\n      \u003cartifactId\u003eimapnio.core\u003c/artifactId\u003e\n      \u003cversion\u003e5.0.15\u003c/version\u003e\n  \u003c/dependency\u003e\n```\nFinally, import the relevant classes and use this library according to the usage section below.\n\n- For contributors run deploy to do a push to nexus servers\n\n```\n\t$ mvn clean deploy -Dgpg.passphrase=[pathPhrase]\n```\n\n## Usage\n\nThe following code examples demonstrate basic functionality relate to connecting to and communicating with IMAP servers.\n\n### Create a client\n```java\n  // Create a ImapAsyncClient instance with number of threads to handle the server requests\n  final int numOfThreads = 5;\n  final ImapAsyncClient imapClient = new ImapAsyncClient(numOfThreads);\n```\n### Establish a session with an IMAP server\n```java\n  // Create a new session via the ImapAsyncClient instance created above and connect to that server.  For the illustration purpose, \n  // \"imaps://imap.server.com:993\" is used\n  final URI serverUri = new URI(\"imaps://imap.server.com:993\");\n  final ImapAsyncSessionConfig config = new ImapAsyncSessionConfig();\n  config.setConnectionTimeoutMillis(5000);\n  config.setReadTimeoutMillis(6000);\n  final List\u003cString\u003e sniNames = null;\n\n  final InetSocketAddress localAddress = null;\n  final Future\u003cImapAsyncCreateSessionResponse\u003e future = imapClient.createSession(serverUri, config, localAddress, sniNames, DebugMode.DEBUG_OFF);\n  \n  //this version is a future-based nio client.  Check whether future is done by following code.\n  if (future.isDone()) {\n\tSystem.out.println(\"Future is done.\");\n  }\n```\n\n### Execute the IMAP command to IMAP server\nFollowing codes uses a Capability command as an example.\n\n```java\n  // Executes the capability command\n  final Future\u003cImapAsyncResponse\u003e capaCmdFuture = session.execute(new CapaCommand());\n\n```\n\n### Handle the response from IMAP server\nIf the future of the executed command is done, obtain the response.\nFollowing example shows how to read ImapAsyncResponse which wraps the content sent from the server.\n\n```java\n  if (capaCmdFuture.isDone()) {\n\tSystem.out.println(\"Capability command is done.\");\n\tfinal ImapAsyncResponse resp = capaCmdFuture.get(5, TimeUnit.MILLISECONDS);\n\tfinal ImapResponseMapper mapper = new ImapResponseMapper();\n\tfinal Capability capa = mapper.readValue(resp.getResponseLines().toArray(new IMAPResponse[0]), Capability.class);\n\tfinal List\u003cString\u003e values = capa.getCapability(\"AUTH\");\n  }\n```\n\n## Release\n\nThis release, 2.0.x, is a major release.  Changes are:\n- It supports non-blocking IO functionality through providing callers with java.util.concurrent.Future object.\n- Listener-based non-blocking IO capability will not be supported in this release.\n\nThis release, 5.0.x, is a major release.  Changes are:\n- It supports request and response bytes counting per command\n\n## Contribute\n\nPlease refer to the [contributing.md](Contributing.md) for information about how to get involved. We welcome issues, questions, and pull requests. Pull Requests are welcome.\n\n\n## Maintainers\n\nFan Su : fsu@yahooinc.com\nVikram Nagulakonda : nvikram@yahooinc.com\n\n\n## License\n\nThis project is licensed under the terms of the [Apache 2.0](LICENSE-Apache-2.0) open source license. Please refer to [LICENSE](LICENSE) for the full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoo%2Fimapnio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyahoo%2Fimapnio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoo%2Fimapnio/lists"}