{"id":27055493,"url":"https://github.com/duesee/imap-next","last_synced_at":"2025-04-05T09:27:53.700Z","repository":{"id":199340544,"uuid":"702180701","full_name":"duesee/imap-next","owner":"duesee","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-07T17:06:06.000Z","size":462,"stargazers_count":14,"open_issues_count":31,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-03T00:38:03.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duesee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"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},"funding":{"github":["duesee"]}},"created_at":"2023-10-08T18:17:50.000Z","updated_at":"2025-03-13T07:45:16.000Z","dependencies_parsed_at":"2023-10-14T22:20:46.352Z","dependency_job_id":"699d2ae2-b68e-4d7d-b0bc-5abe943ca252","html_url":"https://github.com/duesee/imap-next","commit_stats":null,"previous_names":["duesee/imap-flow"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fimap-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fimap-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fimap-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duesee%2Fimap-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duesee","download_url":"https://codeload.github.com/duesee/imap-next/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247315898,"owners_count":20919160,"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":"2025-04-05T09:27:53.036Z","updated_at":"2025-04-05T09:27:53.680Z","avatar_url":"https://github.com/duesee.png","language":"Rust","funding_links":["https://github.com/sponsors/duesee"],"categories":[],"sub_categories":[],"readme":"[![main](https://github.com/duesee/imap-next/actions/workflows/main.yml/badge.svg)](https://github.com/duesee/imap-next/actions/workflows/main.yml)\n[![audit](https://github.com/duesee/imap-next/actions/workflows/audit.yml/badge.svg)](https://github.com/duesee/imap-next/actions/workflows/audit.yml)\n[![Coverage](https://coveralls.io/repos/github/duesee/imap-next/badge.svg?branch=main)](https://coveralls.io/github/duesee/imap-next?branch=main)\n\n# imap-next 𓅟\n\n```mermaid\n%%{init: {'theme': 'neutral' } }%%\nflowchart LR\n    imap-types --\u003e imap-codec\n    imap-codec --\u003e imap-next\n    imap-next -.-\u003e imap-proxy\n    imap-next -.-\u003e imap-client\n    \n    style imap-codec stroke-dasharray: 10 5\n    style imap-next stroke-width:4px\n    \n    click imap-types href \"https://github.com/duesee/imap-codec/tree/main/imap-types\"\n    click imap-codec href \"https://github.com/duesee/imap-codec\"\n    click imap-next href \"https://github.com/duesee/imap-next\"\n    click imap-proxy href \"https://github.com/duesee/imap-proxy\"\n    click imap-client href \"https://github.com/soywod/imap-client\"\n```\n\n`imap-next` is a thin sans I/O abstraction over IMAP's distinct protocol flows.\nThese are literal handling, AUTHENTICATE, and IDLE.\n\nThe way these protocol flows were defined in IMAP couples networking, parsing, and business logic.\n`imap-next` untangles them, providing a minimal interface allowing sending and receiving coherent messages.\nIt's a thin layer paving the ground for higher-level client or server implementations.\nAnd it's sans I/O enabling the integration in any existing I/O runtime.\n\n## Lower-level Libraries\n\n`imap-next` uses [`imap-codec`](https://github.com/duesee/imap-codec) internally for parsing and serialization, and\nre-exposes [`imap-types`](https://github.com/duesee/imap-codec/tree/main/imap-types).\n\n## Higher-level Libraries\n\n* [`imap-proxy`](https://github.com/duesee/imap-proxy) is an IMAP proxy that gracefully forwards unsolicited responses,\n  abstracts over literals, and `Debug`-prints messages.\n* [`imap-client`](https://github.com/soywod/imap-client) is a methods-based client library with\n  a `client.capability()`, `client.login()`, ... interface.\n\n## Usage\n\n```rust,no_run\nuse std::error::Error;\nuse imap_next::{\n    client::{Client, Event, Options},\n    imap_types::{\n        command::{Command, CommandBody},\n        core::Tag,\n    },\n    stream::Stream,\n};\nuse tokio::net::TcpStream;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let mut stream = Stream::insecure(TcpStream::connect(\"127.0.0.1:1143\").await?);\n    let mut client = Client::new(Options::default());\n\n    loop {\n        match stream.next(\u0026mut client).await? {\n            event =\u003e {\n                println!(\"{event:?}\");\n\n                if matches!(event, Event::GreetingReceived { .. }) {\n                    break;\n                }\n            }\n        }\n    }\n\n    let handle = client.enqueue_command(Command::new(\"A1\", CommandBody::login(\"Al¹cE\", \"pa²²w0rd\")?)?);\n\n    loop {\n        match stream.next(\u0026mut client).await? {\n            event =\u003e println!(\"{event:?}\"),\n        }\n    }\n}\n```\n\n# License\n\nThis crate is dual-licensed under Apache 2.0 and MIT terms.\n\n# Thanks\n\nThanks to the [NLnet Foundation](https://nlnet.nl/) for supporting `imap-next` through\ntheir [NGI Assure](https://nlnet.nl/assure/) program!\n\n\u003cdiv align=\"right\"\u003e\n    \u003cimg alt=\"NLnet logo\" height=\"100px\" src=\"https://user-images.githubusercontent.com/8997731/215262095-ab12d43a-ca8a-4d44-b79b-7e99ab91ca01.png\"/\u003e\n    \u003cimg alt=\"Whitespace\" height=\"100px\" src=\"https://user-images.githubusercontent.com/8997731/221422192-60d28ed4-10bb-441e-957d-93af58166707.png\"/\u003e\n    \u003cimg alt=\"NGI Assure logo\" height=\"100px\" src=\"https://user-images.githubusercontent.com/8997731/215262235-0db02da9-7c6c-498e-a3d2-7ea7901637bf.png\"/\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduesee%2Fimap-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduesee%2Fimap-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduesee%2Fimap-next/lists"}