- Notifications
You must be signed in to change notification settings - Fork0
Disposable Email Domain validator library for Java
License
valarpirai/disposable-emails-validator-java
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Use it to validate email addresses on sign up, or just to see how many real email addresses you have in your system.
<repository> <id>github</id> <name>GitHub Packages</name> <url>https://<github_user>:<github_personal_access_token>@maven.pkg.github.com/valarpirai/disposable-emails-validator-java</url></repository>
<dependency> <groupId>org.valarpirai</groupId> <artifactId>disposable-email</artifactId> <version>{version}</version></dependency>
We are using an autogenerated list which is updated every 24 hours -https://github.com/disposable/disposable
This lib has a list of disposable email domains (encoded file) inside resources.The following method will download latest disposable email list fromhere and use itNote: In your application startup, you need to call this method to fetch updated domain list.
DisposableEmail.refreshDisposableDomains()
Get DNS and disposable details of a email domain. ResponseDomainDetails
domainDetails = DisposableEmail.getDomainDetails("gmail.com")domainDetails.disposableDomain -> falsedomainDetails.mxRecordPresent -> true
domainDetails = DisposableEmail.getDomainDetails("yopmail.com")domainDetails.disposableDomain -> truedomainDetails.mxRecordPresent -> true
domainDetails = DisposableEmail.getDomainDetails("nonexisting123.com")domainDetails.disposableDomain -> falsedomainDetails.mxRecordPresent -> false
Check whether a given email address is disposable address (local check)
DisposableEmail.isDisposable("hello@gmail.com") -> falseDisposableEmail.isDisposable("hello@mailsac.com") -> true
Disposable domain with valid DNS MX Record
DisposableEmail.hasValidMailDomain("hello@mailsac.com") -> true
Valid domain without DNS MX Record
DisposableEmail.hasValidMailDomain("god.com") -> false
Use different DNS resolver
DisposableEmail.hasValidMailDomain("hello@gmail.com", DnsResolverType.CLOUD_FLARE) -> trueDisposableEmail.hasValidMailDomain("hello@gmail.com", DnsResolverType.GOOGLE) -> true
Whitelist Domains
DisposableEmail.addDomainToWhitelist("mailsac.com")DisposableEmail.isDisposable("hello@mailsac.com") -> falseDisposableEmail.removeDomainFromWhitelist("mailsac.com")DisposableEmail.isDisposable("mailsac.com") -> true
Blacklist Domains
DisposableEmail.addDomainToBlacklist("gmail.com")DisposableEmail.isDisposable("hello@gmail.com") -> trueDisposableEmail.removeDomainFromBlacklist("gmail.com")DisposableEmail.isDisposable("gmail.com") -> true
- We are using BloomFilter a space-efficient probabilistic data structure to store list of Disposable email domains
- This will work in offline mode.
- We are using DNS over HTTPS (DoH) to verify the MX Records
- CloudFlare (1.1.1.1) and Google(dns.google) DNS resolvers are support
- This will work in online mode. requires internet connection
About
Disposable Email Domain validator library for Java
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.