mxdns

package
v0.0.0-...-bf75c1d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package mxdns provides DNS utilities for SMTP servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocked

type Blocked struct {
	Blocklist string
	IsBlocked bool
	Err       error
}

Blocked holds the result of checking a single blocklist.

type MxDNS

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

MxDNS provides utilities for checking DNS blocklists.

func NewMxDNS

func NewMxDNS(ipBlocklists []string, domainBlocklists []string) *MxDNS

NewMxDNS creates an MxDNS instance that will check the given blocklists.

func (*MxDNS) CheckDomain

func (m *MxDNS) CheckDomain(domain string) []Blocked

CheckDomain checks if the given domain is on the configured blocklists

func (*MxDNS) CheckIP

func (m *MxDNS) CheckIP(ip net.IP) []Blocked

CheckIP checks if the given IP address is on the configured blocklists and returns a result for each blocklist.

func (*MxDNS) CheckReverse

func (m *MxDNS) CheckReverse(ip net.IP, expectHost string) (fcrdns bool, expectedHost bool)

CheckReverse does both a reverse lookup and a FCRDNS check. The reverse lookup should match expectHost. The reverse lookup should resolve back to the given ip.

func (*MxDNS) IsDomainBlocked

func (m *MxDNS) IsDomainBlocked(domain string) bool

IsDomainBlocked checks if the given domain is on any of the configured blocklists.

func (*MxDNS) IsIPBlocked

func (m *MxDNS) IsIPBlocked(ip net.IP) bool

IsIPBlocked checks if the given IP address is on any of the configured blocklists.

Jump to

Keyboard shortcuts

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