util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDomainOrFallback

func GetDomainOrFallback(address string, fallback string) string

Detmine the domain of an email sender or fallback. While technically an address could have multiple '@' signs, we will fallback if there isn't exactly one!

func GetMXDomains

func GetMXDomains(domain string) []*net.MX

Lookup MX records for `domain`, sorted by preference

func GetRawFromHeaderAddress

func GetRawFromHeaderAddress(fromHeader string) (string, error)

Get raw from address from RFC 5322 address

Types

type ZapLogWrapper

type ZapLogWrapper struct{}

Used to pipe normal log.Logger output into the zap logger

func (ZapLogWrapper) Write

func (_ ZapLogWrapper) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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