check

package
v0.1.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package check contains the internal validation levels for emailkit. Each type implements the checker interface defined in validator.go. These types can be used directly, but the recommended approach is to use the fluent builder API from the github.com/optimode/emailkit package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSChecker

type DNSChecker struct {
	// contains filtered or unexported fields
}

DNSChecker verifies the existence of MX records.

func NewDNSChecker

func NewDNSChecker(cfg DNSConfig) *DNSChecker

func NewDNSCheckerWithLookup

func NewDNSCheckerWithLookup(cfg DNSConfig, fn func(string) ([]*net.MX, error)) *DNSChecker

NewDNSCheckerWithLookup is a test-oriented constructor that overrides the MX lookup function.

func (*DNSChecker) Check

func (c *DNSChecker) Check(ctx context.Context, email parse.Email) types.CheckResult

type DNSConfig

type DNSConfig struct {
	Timeout     time.Duration
	FallbackToA bool
}

DNSConfig is the DNS checker configuration.

type DomainChecker

type DomainChecker struct {
	// contains filtered or unexported fields
}

DomainChecker detects disposable domains and typos.

func NewDomainChecker

func NewDomainChecker(cfg DomainConfig) *DomainChecker

func (*DomainChecker) Check

type DomainConfig

type DomainConfig struct {
	CheckDisposable bool
	CheckTypos      bool
	TypoThreshold   int
}

DomainConfig is the domain checker configuration.

type SMTPChecker

type SMTPChecker struct {
	// contains filtered or unexported fields
}

SMTPChecker performs SMTP RCPT TO probes to verify email existence. It uses a shared DNS cache for MX lookups and an SMTP connection pool for efficient connection reuse via the RSET command.

func NewSMTPChecker

func NewSMTPChecker(cfg SMTPConfig, cache *dnscache.Cache, pool *smtppool.Pool) *SMTPChecker

NewSMTPChecker creates an SMTP checker with a shared DNS cache and connection pool.

func (*SMTPChecker) Check

func (c *SMTPChecker) Check(ctx context.Context, email parse.Email) types.CheckResult

type SMTPConfig

type SMTPConfig struct {
	HeloDomain string
	MailFrom   string
	MaxMXHosts int
}

SMTPConfig is the SMTP checker configuration.

type SyntaxChecker

type SyntaxChecker struct{}

SyntaxChecker validates email syntax according to RFC 5321/5322 with RFC 6531 (SMTPUTF8) and IDNA2008 internationalization support.

func NewSyntaxChecker

func NewSyntaxChecker() *SyntaxChecker

func (*SyntaxChecker) Check

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL