{"id":17145960,"url":"https://github.com/foxcpp/go-dovecot-sasl","last_synced_at":"2025-04-13T11:21:21.500Z","repository":{"id":98733007,"uuid":"261252372","full_name":"foxcpp/go-dovecot-sasl","owner":"foxcpp","description":"Go library implementing client and server side of Dovecot authentication protocol 1.1","archived":false,"fork":false,"pushed_at":"2020-05-22T22:37:46.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T02:38:23.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/foxcpp.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}},"created_at":"2020-05-04T17:32:29.000Z","updated_at":"2023-11-29T02:18:22.000Z","dependencies_parsed_at":"2023-07-26T21:15:46.828Z","dependency_job_id":null,"html_url":"https://github.com/foxcpp/go-dovecot-sasl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxcpp%2Fgo-dovecot-sasl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxcpp%2Fgo-dovecot-sasl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxcpp%2Fgo-dovecot-sasl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxcpp%2Fgo-dovecot-sasl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxcpp","download_url":"https://codeload.github.com/foxcpp/go-dovecot-sasl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703736,"owners_count":21148219,"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-10-14T21:07:22.491Z","updated_at":"2025-04-13T11:21:21.477Z","avatar_url":"https://github.com/foxcpp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-dovecot-sasl\n\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?style=flat-square)](https://pkg.go.dev/github.com/foxcpp/go-dovecot-sasl)\n\nGo library implementing Dovecot authentication protocol 1.1.\nThe library is based on\n[emersion/go-sasl](https://github.com/emersion/go-sasl).\n\n* Specification: https://wiki.dovecot.org/Design/AuthProtocol \n\n## Examples\n\n### Client\n\n```go\ns, err := net.Dial(\"unix\", \"/var/lib/dovecot/sasl.sock\")\nif err != nil {\n    // Handle error.\n}\n\ncl := dovecotsasl.NewClient(s)\nerr := cl.Do(\"SMTP\", \n    sasl.NewPlainClient(\"\", \"foxcpp\", \"1234\"), \n\n    dovecotsasl.RemoteIP(net.IPv4(1,2,3,4)),\n    dovecotsasl.Secured,\n)\nif err != nil {\n    // Nope!\n}\n\n// Authenticated!\n```\n\n### Server\n\n```go\nl, err := net.Listen(\"unix\", \"/var/lib/maddy/sasl.sock\")\nif err != nil {\n    // Handle error.\n}\n\nvar authenticator sasl.PlainAuthenticator = func(_, user, pass string) error {\n    if user == \"foxcpp\" \u0026\u0026 pass == \"1234\" {\n        return nil\n    }\n    return errors.New(\"nope!\")\n}\n\ns := NewServer()\ns.AddMechanism(\"PLAIN\", dovecotsasl.Mechanism{}, \n    func(*dovecotsasl.AuthReq) sasl.Server {\n        return sasl.NewPlainServer(authenticator)\n    })\n\ngo s.Serve(l)\n```\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcpp%2Fgo-dovecot-sasl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcpp%2Fgo-dovecot-sasl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcpp%2Fgo-dovecot-sasl/lists"}