subjectpass

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 14 Imported by: 2

Documentation

Overview

Package subjectpass implements a mechanism for reject an incoming message with a challenge to include a token in a next delivery attempt.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMessage = errors.New("subjectpass: malformed message")
	ErrAbsent  = errors.New("subjectpass: no token found")
	ErrFrom    = errors.New("subjectpass: bad From")
	ErrInvalid = errors.New("subjectpass: malformed token")
	ErrVerify  = errors.New("subjectpass: verification failed")
	ErrExpired = errors.New("subjectpass: token expired")
)
View Source
var Explanation = "" /* 134-byte string literal not displayed */

Functions

func Generate

func Generate(mailFrom smtp.Address, key []byte, tm time.Time) string

Generate generates a token that is valid for "mailFrom", starting from "tm" and signed with "key". The token is of the form: (pass:<signeddata>)

func Verify

func Verify(r io.ReaderAt, key []byte, period time.Duration) (rerr error)

Verify parses "message" and checks if it includes a subjectpass token in its Subject header that is still valid (within "period") and signed with "key".

Types

This section is empty.

Jump to

Keyboard shortcuts

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