https://github.com/cwinters8/gomap
Go module for interfacing with JMAP servers
https://github.com/cwinters8/gomap
fastmail go jmap jmap-client
Last synced: 5 months ago
JSON representation
Go module for interfacing with JMAP servers
- Host: GitHub
- URL: https://github.com/cwinters8/gomap
- Owner: cwinters8
- License: bsd-3-clause
- Created: 2022-12-22T00:32:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-18T02:19:58.000Z (over 2 years ago)
- Last Synced: 2025-11-23T16:03:18.570Z (6 months ago)
- Topics: fastmail, go, jmap, jmap-client
- Language: Go
- Homepage:
- Size: 165 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-opensource-email - Gomap - Go module for interfacing with JMAP servers (Sending / JMAP Server & others)
README
[](https://pkg.go.dev/github.com/cwinters8/gomap) [](https://goreportcard.com/report/github.com/cwinters8/gomap) [](https://github.com/cwinters8/gomap/blob/main/LICENSE)
# gomap
Go module for interfacing with [JMAP](https://jmap.io) mail servers, such as [Fastmail](https://www.fastmail.com/).
## Usage
To add the module to your project:
```sh
go get -u github.com/cwinters8/gomap
```
First, create a new mail client. You will need a session URL and a bearer token from your JMAP mail server. For Fastmail, the session URL is `https://api.fastmail.com/jmap/session`, and you can create an API token in [Settings > Privacy & Security > Integrations > API tokens](https://www.fastmail.com/settings/security/tokens). You will most likely need to give access to `Email` (for querying and reading email contents) and `Email submission` (for sending emails) when you create the token.
```go
mail, err := gomap.NewClient(
"https://api.fastmail.com/jmap/session",
os.Getenv("BEARER_TOKEN"),
gomap.DefaultDrafts,
gomap.DefaultSent,
)
if err != nil {
log.Fatal(err)
}
```
Then you can use the client for your chosen operations. Check out the [examples](https://pkg.go.dev/github.com/cwinters8/gomap#pkg-examples) for full details on how to send and find emails.