Alos.Email.Validation
1.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Alos.Email.Validation --version 1.1.0
NuGet\Install-Package Alos.Email.Validation -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alos.Email.Validation" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alos.Email.Validation" Version="1.1.0" />
<PackageReference Include="Alos.Email.Validation" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alos.Email.Validation --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Alos.Email.Validation, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alos.Email.Validation@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alos.Email.Validation&version=1.1.0
#tool nuget:?package=Alos.Email.Validation&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Alos.Email.Validation
Email validation library for anti-abuse protection in SaaS applications.
Features
- Provider-Specific Normalization - Gmail dots/plus, Outlook plus, ProtonMail plus, etc.
- Relay Service Blocking - Apple Hide My Email, Firefox Relay, DuckDuckGo, SimpleLogin, etc.
- Disposable Domain Detection - 38,000+ known disposable email providers
- MX Record Verification - DNS-based domain validation with fail-open strategy
- Custom Blocklist/Allowlist - Override built-in lists with your own domains
- Hot-Reload - Runtime blocklist updates without redeployment
- Auto-Update - Background service for periodic blocklist updates from GitHub
- Thread-Safe - All operations are safe for concurrent access
Installation
dotnet add package Alos.Email.Validation
Quick Start
// Register services
builder.Services.AddEmailValidation(builder.Configuration);
// Or with auto-update
builder.Services.AddEmailValidationWithAutoUpdate(builder.Configuration);
{
"EmailValidation": {
"BlocklistDirectory": "/var/lib/alos/email-blocklists",
"EnableAutoUpdate": true,
"UpdateInterval": "1.00:00:00",
"InitialUpdateDelay": "00:00:30",
"CustomBlocklist": ["spammer.com"],
"CustomAllowlist": ["legitimate-service.com"],
"CustomBlocklistUrls": ["https://example.com/my-blocklist.txt"],
"CustomAllowlistUrls": ["https://example.com/my-allowlist.txt"]
}
}
Usage
public class RegistrationService(IEmailValidationService emailValidator)
{
public async Task<bool> RegisterAsync(string email, CancellationToken ct)
{
// Full async validation (includes MX check)
var result = await emailValidator.ValidateAsync(email, ct);
if (!result.IsValid)
{
// result.Error: InvalidFormat, RelayService, Disposable, InvalidDomain
return false;
}
// Or use individual checks
if (emailValidator.IsRelayService(email))
return false; // Relay services not allowed
if (emailValidator.IsDisposable(email))
return false; // Disposable emails not allowed
// Get normalized email for uniqueness checks
var normalized = emailValidator.Normalize(email);
// Continue with registration...
return true;
}
}
Components
| Component | Description |
|---|---|
IEmailValidationService |
Orchestrates all validation checks |
IDisposableEmailDomainChecker |
Disposable domain detection with hot-reload |
IMxRecordValidator |
DNS MX record verification |
EmailNormalizer |
Static class for provider-specific email normalization |
RelayServiceBlocklist |
Static class blocking 21+ relay/forwarding services |
Framework Support
- .NET 8.0
- .NET 9.0
- .NET 10.0
License
Apache-2.0 License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
-
net8.0
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
-
net9.0
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.