{"id":13795812,"url":"https://github.com/badoux/checkmail","last_synced_at":"2025-05-12T23:32:42.164Z","repository":{"id":50246772,"uuid":"80099294","full_name":"badoux/checkmail","owner":"badoux","description":"Golang package for email validation","archived":false,"fork":false,"pushed_at":"2024-01-15T14:53:04.000Z","size":27,"stargazers_count":680,"open_issues_count":9,"forks_count":90,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-02-14T21:35:57.824Z","etag":null,"topics":["format","go","golang","host","mail","mailbox","user","validation"],"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/badoux.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":"2017-01-26T09:02:00.000Z","updated_at":"2024-06-18T12:18:35.233Z","dependencies_parsed_at":"2024-06-18T12:18:34.361Z","dependency_job_id":"213d797e-3032-4166-9d73-a1c6b73d6fdd","html_url":"https://github.com/badoux/checkmail","commit_stats":{"total_commits":29,"total_committers":15,"mean_commits":"1.9333333333333333","dds":0.7931034482758621,"last_synced_commit":"dfb1781de188b79602f336983620f4b2eb1cf27d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoux%2Fcheckmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoux%2Fcheckmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoux%2Fcheckmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoux%2Fcheckmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badoux","download_url":"https://codeload.github.com/badoux/checkmail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253841195,"owners_count":21972611,"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":["format","go","golang","host","mail","mailbox","user","validation"],"created_at":"2024-08-03T23:01:02.636Z","updated_at":"2025-05-12T23:32:40.486Z","avatar_url":"https://github.com/badoux.png","language":"Go","readme":"# checkmail\n[Golang](http://golang.org/) package for email validation.\n\n - Format (simple regexp, see: https://www.w3.org/TR/html5/forms.html#valid-e-mail-address and https://davidcel.is/posts/stop-validating-email-addresses-with-regex/)\n - Valid domain\n - Valid user: verify if the user and mailbox really exist\n\n[![GoDoc](https://godoc.org/github.com/badoux/checkmail?status.png)](https://godoc.org/github.com/badoux/checkmail)\n\n## Usage\n\nInstall the Checkmail package \n\n```\ngo get github.com/badoux/checkmail\n\n```    \n\n\n### 1. Format\n```go\nfunc main() {\n    err := checkmail.ValidateFormat(\"ç$€§/az@gmail.com\")\n    if err != nil {\n        fmt.Println(err)\n    }\n}\n```\noutput: `invalid format`\n\n### 2. Domain\n```go\nfunc main() {\n    err := checkmail.ValidateHost(\"email@x-unkown-domain.com\")\n    if err != nil {\n        fmt.Println(err)\n    }\n}\n```\noutput: `unresolvable host`\n\n### 3. Host and User\n\nIf host is valid, requires valid SMTP `serverHostName` (see to [online validator](https://mxtoolbox.com/SuperTool.aspx)) and `serverMailAddress` to reverse validation \nfor prevent SPAN and BOTS.\n\n```go\nfunc main() {\n    var (\n        serverHostName    = \"smtp.myserver.com\" // set your SMTP server here\n        serverMailAddress = \"validuser@myserver.com\"  // set your valid mail address here\n    )\n    err := checkmail.ValidateHostAndUser(serverHostName, serverMailAddress, \"unknown-user-129083726@gmail.com\")\n    if smtpErr, ok := err.(checkmail.SmtpError); ok \u0026\u0026 err != nil {\n        fmt.Printf(\"Code: %s, Msg: %s\", smtpErr.Code(), smtpErr)\n    }\n}\n```\noutput: `Code: 550, Msg: 550 5.1.1 The email account that you tried to reach does not exist.`\n\n## License\n\nCheckmail is licensed under the [MIT License](./LICENSE).\n","funding_links":[],"categories":["DevOps Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoux%2Fcheckmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadoux%2Fcheckmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoux%2Fcheckmail/lists"}