{"id":30115358,"url":"https://github.com/rockorager/go-jmap","last_synced_at":"2025-08-10T08:17:37.803Z","repository":{"id":301429890,"uuid":"667630499","full_name":"rockorager/go-jmap","owner":"rockorager","description":"JMAP client library for go (mirror of git.sr.ht/~rockorager/go-jmap)","archived":false,"fork":false,"pushed_at":"2023-10-01T20:22:16.000Z","size":325,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-26T21:10:51.224Z","etag":null,"topics":["email","golang","jmap"],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~rockorager/go-jmap","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rockorager.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-07-18T00:48:47.000Z","updated_at":"2025-03-20T22:21:08.000Z","dependencies_parsed_at":"2025-06-26T21:10:54.403Z","dependency_job_id":"c20da206-4c62-48c0-ab72-c37f4120bfc5","html_url":"https://github.com/rockorager/go-jmap","commit_stats":null,"previous_names":["rockorager/go-jmap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rockorager/go-jmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fgo-jmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fgo-jmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fgo-jmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fgo-jmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockorager","download_url":"https://codeload.github.com/rockorager/go-jmap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fgo-jmap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269693610,"owners_count":24460254,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["email","golang","jmap"],"created_at":"2025-08-10T08:17:35.627Z","updated_at":"2025-08-10T08:17:37.422Z","avatar_url":"https://github.com/rockorager.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-jmap\n\nA JMAP client library. Includes support for all core functionality (including\nPushSubscription and EventSource event streams), mail, smime-verify, and MDN \nspecifications\n\nNote: this library started as a fork of [github.com/foxcpp/go-jmap](https://github.com/foxcpp/go-jmap)\nIt has since undergone massive refactoring and probably doesn't look very\nsimilar anymore, but many thanks to foxcpp for the initial work.\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"git.sr.ht/~rockorager/go-jmap\"\n\t\"git.sr.ht/~rockorager/go-jmap/mail\"\n\t\"git.sr.ht/~rockorager/go-jmap/mail/email\"\n\t\"git.sr.ht/~rockorager/go-jmap/mail/mailbox\"\n)\n\nfunc main() {\n\t// Create a new client. The SessionEndpoint must be specified for\n\t// initial connections.\n\tclient := \u0026jmap.Client{\n\t\tSessionEndpoint: \"https://api.fastmail.com/jmap/session\",\n\t}\n\t// Set the authentication mechanism. This also sets the HttpClient of\n\t// the jmap client\n\tclient.WithAccessToken(\"my-access-token\")\n\n\t// Authenticate the client. This gets a Session object. Session objects\n\t// are cacheable, and have their own state string clients can use to\n\t// decide when to refresh. The client can be initialized with a cached\n\t// Session object. If one isn't available, the first request will also\n\t// authenticate the client\n\tif err := client.Authenticate(); err != nil {\n\t\t// Handle the error\n\t}\n\n\t// Get the account ID of the primary mail account\n\tid := client.Session.PrimaryAccounts[mail.URI]\n\n\t// Create a new request\n\treq := \u0026jmap.Request{}\n\n\t// Invoke a method. The CallID of this method will be returned to be\n\t// used when chaining calls\n\treq.Invoke(\u0026mailbox.Get{\n\t\tAccount: id,\n\t})\n\n\t// Invoke a changes call, let's save the callID and pass it to a Get\n\t// method\n\tcallID := req.Invoke(\u0026email.Changes{\n\t\tAccount: id,\n\t\tSinceState: \"some-known-state\",\n\t})\n\n\t// Invoke a result reference call\n\treq.Invoke(\u0026email.Get{\n\t\tAccount: id,\n\t\tReferenceIDs: \u0026jmap.ResultReference{\n\t\t\tResultOf: callID, // The CallID of the referenced method\n\t\t\tName: \"Email/changes\", // The name of the referenced method\n\t\t\tPath: \"/created\", // JSON pointer to the location of the reference\n\t\t},\n\t})\n\n\t// Make the request\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\t// Handle the error\n\t}\n\n\t// Loop through the responses to invidividual invocations\n\tfor _, inv := range resp.Responses {\n\t\t// Our result to individual calls is in the Args field of the\n\t\t// invocation\n\t\tswitch r := inv.Args.(type) {\n\t\tcase *mailbox.GetResponse:\n\t\t\t// A GetResponse contains a List of the objects\n\t\t\t// retrieved\n\t\t\tfor _, mbox := range r.List {\n\t\t\t\tfmt.Printf(\"Mailbox name: %s\", mbox.Name)\n\t\t\t\tfmt.Printf(\"Total email: %d\", mbox.TotalEmails)\n\t\t\t\tfmt.Printf(\"Unread email: %d\", mbox.UnreadEmails)\n\t\t\t}\n\t\tcase *email.GetResponse:\n\t\t\tfor _, eml := range r.List {\n\t\t\t\tfmt.Printf(\"Email subject: %s\", eml.Subject)\n\t\t\t}\n\t\t}\n\t\t// There is a response in here to the Email/changes call, but we\n\t\t// don't care about the results since we passed them to the\n\t\t// Email/get call\n\t}\n}\n```\n\n## Status\n\n### Core ([RFC 8620](https://tools.ietf.org/html/rfc8620))\n\nComplete\n\n### Mail ([RFC 8621](https://tools.ietf.org/html/rfc8621))\n\nComplete\n\n### MDN ([RFC 9007](https://tools.ietf.org/html/rfc9007))\n\nComplete\n\n### WebSocket ([RFC 8887](https://tools.ietf.org/html/rfc8887))\n\nNot started\n\n### S/MIME ([RFC 9219](https://tools.ietf.org/html/rfc9219))\n\nComplete\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockorager%2Fgo-jmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockorager%2Fgo-jmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockorager%2Fgo-jmap/lists"}