{"id":20741214,"url":"https://github.com/bbottema/email-rfc2822-validator","last_synced_at":"2025-04-24T03:08:36.893Z","repository":{"id":47173579,"uuid":"52442161","full_name":"bbottema/email-rfc2822-validator","owner":"bbottema","description":"The world's only Java-based rfc2822-compliant email address validator and parser","archived":false,"fork":false,"pushed_at":"2023-01-13T13:58:26.000Z","size":117,"stargazers_count":64,"open_issues_count":3,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-24T03:08:31.156Z","etag":null,"topics":["email-address-validator","extraction-api","regex-pattern","rfc2822"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbottema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-24T12:55:05.000Z","updated_at":"2024-07-03T11:34:05.000Z","dependencies_parsed_at":"2023-02-09T15:45:16.165Z","dependency_job_id":null,"html_url":"https://github.com/bbottema/email-rfc2822-validator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Femail-rfc2822-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Femail-rfc2822-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Femail-rfc2822-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Femail-rfc2822-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbottema","download_url":"https://codeload.github.com/bbottema/email-rfc2822-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552074,"owners_count":21449164,"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":["email-address-validator","extraction-api","regex-pattern","rfc2822"],"created_at":"2024-11-17T06:35:14.245Z","updated_at":"2025-04-24T03:08:36.877Z","avatar_url":"https://github.com/bbottema.png","language":"Java","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"[![APACHE v2 License](https://img.shields.io/badge/license-apachev2-blue.svg?style=flat)](LICENSE-2.0.txt) \n[![Latest Release](https://img.shields.io/maven-central/v/com.github.bbottema/emailaddress-rfc2822.svg?style=flat)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.bbottema%22%20AND%20a%3A%22emailaddress-rfc2822%22) \n[![Build Status](https://img.shields.io/badge/CircleCI-build-brightgreen.svg?style=flat)](https://circleci.com/gh/bbottema/email-rfc2822-validator) \n[![Codacy](https://img.shields.io/codacy/grade/7cf43e32227f443780e7b16018542e24.svg?style=flat)](https://www.codacy.com/app/b-bottema/email-rfc2822-validator)\n\n# email-rfc2822-validator #\n\nThe world's only more-or-less-2822-compliant Java-based email address extractor / verifier\n\n* Author: http://stackoverflow.com/a/13133880/441662\n  * Based on: [Les Hazlewood's java regex version](http://leshazlewood.com/2006/11/06/emailaddress-java-class/comment-page-1/#comment_count), code: https://github.com/lhazlewood/jeav\n* Origin: http://lacinato.com/cm/software/emailrelated/emailaddress\n* Used in: https://github.com/bbottema/simple-java-mail\n\nemail-rfc2822-validator is available in Maven Central:\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.bbottema\u003c/groupId\u003e\n    \u003cartifactId\u003eemailaddress-rfc2822\u003c/artifactId\u003e\n    \u003cversion\u003e2.3.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAnd just to show you that this stuff is hard, here's JavaMail's [official parser's](https://searchcode.com/codesearch/view/63668224/) javadoc on the subject (line 669):\n\n```\n    /*\n     * RFC822 Address parser.\n     *\n     * XXX - This is complex enough that it ought to be a real parser,\n     *       not this ad-hoc mess, and because of that, this is not perfect.\n     *\n     * XXX - Deal with encoded Headers too.\n     */\n    @SuppressWarnings(\"fallthrough\")\n    private static InternetAddress[] parse(String s, boolean strict,\n\t\t\t\t    boolean parseHdr) throws AddressException {\n```\n\n## Usage\n\nThere are two classes available, EmailaddressValidator and EmailAddressParser. The second is used to extract data from (complex / mangled) email strings.\n\nFor both of these, you use the EmailAddressCriteria enumeration to control RFC strictness.\n\nHere's an example for validating an email address:\n\n```java\nboolean isValid = EmailAddressValidator.isValid(emailaddress);\nboolean isValid = EmailAddressValidator.isValid(emailaddress, EmailAddressCriteria.RECOMMENDED);\nboolean isValid = EmailAddressValidator.isValid(emailaddress, EmailAddressCriteria.RFC_COMPLIANT);\nboolean isValid = EmailAddressValidator.isValid(emailaddress, EnumSet.of(ALLOW_DOT_IN_A_TEXT, ALLOW_SQUARE_BRACKETS_IN_A_TEXT));\n```\n\n\n---\n\n\n### Latest Progress ###\n\nv2.3.1\n\n- [#24](https://github.com/bbottema/email-rfc2822-validator/issues/24): Bug: Published JARs for versions 2.2.0 and 2.3.0 have an invalid module name in MANIFEST.MF\n\n\nv2.3.0\n\n- [#21](https://github.com/bbottema/email-rfc2822-validator/issues/21): Make Jakarta Mail dependency used for parsing (not validation) optional\n\nNOTE: Jakarta Mail is now an optional dependency, which you need to add yourself, but only if you use the parsing facilities of this library (rather than only the validation function)\n\n\nv2.2.0\n\n- [#19](https://github.com/bbottema/email-rfc2822-validator/issues/19): Parens not parsed properly and API documentation / usage needs improvement\n\n\nv2.1.4\n\n- [#17](https://github.com/bbottema/email-rfc2822-validator/issues/17): IllegalArgumentException when passing null to EmailAddressValidator.isValid(String)\n\n\nv2.1.3\n\n- [#14](https://github.com/bbottema/email-rfc2822-validator/issues/14): Update project to Java 1.7 and Jakarta Mail\n\n\nv1.1.3\n\n- [#13](https://github.com/bbottema/email-rfc2822-validator/issues/13): Fixed TLD limitation for domains longer than six\n\n\nv1.1.2\n\n- Fixed regression bug where name and address were switched around\n\n\nv1.1.1\n\n- This library can now be used with any javax.mail dependency from 1.5.5 and upwards.\n\n\nv1.1.0\n\n- [#7](https://github.com/bbottema/email-rfc2822-validator/issues/7): Clarified validation modes (default vs strictly rfc compliant)\n\n**NOTE**: EmailAddressValidator.isValid() now validates using EmailAddressCriteria.DEFAULT rather than EmailAddressCriteria.RFC_COMPLIANT. Use\nEmailAddressValidator.isValidStrict() for RFC compliant validation.\n\n\nv1.0.1\n\nInitial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbottema%2Femail-rfc2822-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbottema%2Femail-rfc2822-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbottema%2Femail-rfc2822-validator/lists"}