reason

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reason normalises and classifies Postfix delivery failure texts (delay_reason in the queue, status=deferred/bounced text in the log).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(text string) string

Normalize turns a failure text into a stable key for grouping: addresses, IPs and long tokens (tracking IDs) are replaced, the "host X said:" prefix and "(in reply to ...)" suffix are removed.

func Remote

func Remote(text string) string

Remote extracts the remote host from "host mx.example.com[1.2.3.4] said:" or "connect to mx.example.com[1.2.3.4]:25:" style texts, if present.

Types

type Category

type Category struct {
	ID   string `json:"id"`
	Hint string `json:"hint"`
}

Category is a coarse cause of a delivery failure.

func Categories

func Categories() []Category

Categories lists every category id, for documentation and tests.

func Classify

func Classify(text string) Category

Classify returns the category of a failure text.

Jump to

Keyboard shortcuts

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