Documentation ¶
Index ¶
- Constants
- Variables
- func LoadSpec(s *Script, spec *Spec, position lexer.Position, args []parser.Arg, ...) error
- type AddressPart
- type AddressTest
- type AllOfTest
- type AnyOfTest
- type Cmd
- type CmdAddFlag
- type CmdDiscard
- type CmdDovecotConfigSet
- type CmdDovecotTest
- type CmdDovecotTestFail
- type CmdDovecotTestSet
- type CmdElse
- type CmdElsif
- type CmdFileInto
- type CmdIf
- type CmdKeep
- type CmdNoop
- type CmdRedirect
- type CmdRemoveFlag
- type CmdSet
- type CmdSetFlag
- type CmdStop
- type Comparator
- type CompiledMatcher
- type DummyPolicy
- type Envelope
- type EnvelopeStatic
- type EnvelopeTest
- type ExistsTest
- type FalseTest
- type Flags
- type HeaderTest
- type Match
- type Message
- type MessageHeader
- type MessageStatic
- type NotTest
- type Options
- type PolicyReader
- type Relational
- type RuntimeData
- type Script
- type SizeTest
- type Spec
- type SpecPosArg
- type SpecTag
- type Test
- type TestDovecotCompile
- type TestDovecotRun
- type TestDovecotTestError
- type TestString
- type TrueTest
Constants ¶
View Source
const DovecotTestExtension = "vnd.dovecot.testsuite"
Variables ¶
View Source
var ErrComparatorMatchUnsupported = fmt.Errorf("match-comparator combination not supported")
View Source
var ErrStop = errors.New("interpreter: stop called")
Functions ¶
Types ¶
type AddressPart ¶
type AddressPart string
const ( LocalPart AddressPart = "localpart" Domain AddressPart = "domain" All AddressPart = "all" )
type AddressTest ¶
type AddressTest struct { AddressPart AddressPart Header []string // contains filtered or unexported fields }
func (AddressTest) Check ¶
func (a AddressTest) Check(_ context.Context, d *RuntimeData) (bool, error)
type CmdAddFlag ¶
type CmdAddFlag struct {
Flags Flags
}
func (CmdAddFlag) Execute ¶
func (c CmdAddFlag) Execute(_ context.Context, d *RuntimeData) error
type CmdDiscard ¶
type CmdDiscard struct{}
func (CmdDiscard) Execute ¶
func (c CmdDiscard) Execute(_ context.Context, d *RuntimeData) error
type CmdDovecotConfigSet ¶
func (CmdDovecotConfigSet) Execute ¶
func (c CmdDovecotConfigSet) Execute(_ context.Context, d *RuntimeData) error
type CmdDovecotTest ¶
func (CmdDovecotTest) Execute ¶
func (c CmdDovecotTest) Execute(ctx context.Context, d *RuntimeData) error
type CmdDovecotTestFail ¶
func (CmdDovecotTestFail) Execute ¶
func (c CmdDovecotTestFail) Execute(_ context.Context, d *RuntimeData) error
type CmdDovecotTestSet ¶
func (CmdDovecotTestSet) Execute ¶
func (c CmdDovecotTestSet) Execute(_ context.Context, d *RuntimeData) error
type CmdFileInto ¶
func (CmdFileInto) Execute ¶
func (c CmdFileInto) Execute(_ context.Context, d *RuntimeData) error
type CmdRedirect ¶
type CmdRedirect struct {
Addr string
}
func (CmdRedirect) Execute ¶
func (c CmdRedirect) Execute(ctx context.Context, d *RuntimeData) error
type CmdRemoveFlag ¶
type CmdRemoveFlag struct {
Flags Flags
}
func (CmdRemoveFlag) Execute ¶
func (c CmdRemoveFlag) Execute(_ context.Context, d *RuntimeData) error
type CmdSetFlag ¶
type CmdSetFlag struct {
Flags Flags
}
func (CmdSetFlag) Execute ¶
func (c CmdSetFlag) Execute(_ context.Context, d *RuntimeData) error
type Comparator ¶
type Comparator string
const ( ComparatorOctet Comparator = "i;octet" ComparatorASCIICaseMap Comparator = "i;ascii-casemap" ComparatorASCIINumeric Comparator = "i;ascii-numeric" ComparatorUnicodeCaseMap Comparator = "i;unicode-casemap" DefaultComparator = ComparatorASCIICaseMap )
type DummyPolicy ¶
type DummyPolicy struct { }
func (DummyPolicy) RedirectAllowed ¶
func (d DummyPolicy) RedirectAllowed(_ context.Context, _ *RuntimeData, _ string) (bool, error)
type EnvelopeStatic ¶
func (EnvelopeStatic) AuthUsername ¶
func (m EnvelopeStatic) AuthUsername() string
func (EnvelopeStatic) EnvelopeFrom ¶
func (m EnvelopeStatic) EnvelopeFrom() string
func (EnvelopeStatic) EnvelopeTo ¶
func (m EnvelopeStatic) EnvelopeTo() string
type EnvelopeTest ¶
type EnvelopeTest struct { AddressPart AddressPart Field []string // contains filtered or unexported fields }
func (EnvelopeTest) Check ¶
func (e EnvelopeTest) Check(_ context.Context, d *RuntimeData) (bool, error)
type ExistsTest ¶
type ExistsTest struct {
Fields []string
}
func (ExistsTest) Check ¶
func (e ExistsTest) Check(_ context.Context, d *RuntimeData) (bool, error)
type HeaderTest ¶
type HeaderTest struct { Header []string // contains filtered or unexported fields }
func (HeaderTest) Check ¶
func (h HeaderTest) Check(_ context.Context, d *RuntimeData) (bool, error)
type Message ¶
type Message interface { /* HeaderGet returns the header field value. RFC requires the following handling for encoded fields: Comparisons are performed on octets. Implementations convert text from header fields in all charsets [MIME3] to Unicode, encoded as UTF-8, as input to the comparator (see section 2.7.3). Implementations MUST be capable of converting US-ASCII, ISO-8859- 1, the US-ASCII subset of ISO-8859-* character sets, and UTF-8. Text that the implementation cannot convert to Unicode for any reason MAY be treated as plain US-ASCII (including any [MIME3] syntax) or processed according to local conventions. An encoded NUL octet (character zero) SHOULD NOT cause early termination of the header content being compared against. */ HeaderGet(key string) ([]string, error) MessageSize() int }
type MessageHeader ¶
type MessageStatic ¶
type MessageStatic struct { Size int Header MessageHeader }
MessageStatic is a simple Message interface implementation that just keeps all data in memory in a Go struct.
func (MessageStatic) MessageSize ¶
func (m MessageStatic) MessageSize() int
type PolicyReader ¶
type Relational ¶
type Relational string
const ( RelGreaterThan Relational = "gt" RelGreaterOrEqual Relational = "ge" RelLessThan Relational = "lt" RelLessOrEqual Relational = "le" RelEqual Relational = "eq" RelNotEqual Relational = "ne" )
func (Relational) CompareNumericValue ¶
func (r Relational) CompareNumericValue(lhs, rhs *uint64) bool
func (Relational) CompareString ¶
func (r Relational) CompareString(lhs, rhs string) bool
func (Relational) CompareUint64 ¶
func (r Relational) CompareUint64(lhs, rhs uint64) bool
type RuntimeData ¶
type RuntimeData struct { Policy PolicyReader Envelope Envelope Msg Message Script *Script // For files accessible vis "include", "test_script_compile", etc. Namespace fs.FS RedirectAddr []string Mailboxes []string Flags []string Keep bool ImplicitKeep bool FlagAliases map[string]string MatchVariables []string Variables map[string]string // contains filtered or unexported fields }
func NewRuntimeData ¶
func NewRuntimeData(s *Script, p PolicyReader, e Envelope, m Message) *RuntimeData
func (*RuntimeData) Copy ¶
func (d *RuntimeData) Copy() *RuntimeData
func (*RuntimeData) MatchVariable ¶
func (d *RuntimeData) MatchVariable(i int) string
func (*RuntimeData) SetVar ¶
func (d *RuntimeData) SetVar(name, value string) error
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
func (Script) Extensions ¶
func (*Script) IsVarUsable ¶
func (Script) RequiresExtension ¶
type SpecPosArg ¶
type TestDovecotCompile ¶
type TestDovecotCompile struct {
ScriptPath string
}
func (TestDovecotCompile) Check ¶
func (t TestDovecotCompile) Check(_ context.Context, d *RuntimeData) (bool, error)
type TestDovecotRun ¶
type TestDovecotRun struct { }
func (TestDovecotRun) Check ¶
func (t TestDovecotRun) Check(ctx context.Context, d *RuntimeData) (bool, error)
type TestDovecotTestError ¶
type TestDovecotTestError struct {
// contains filtered or unexported fields
}
func (TestDovecotTestError) Check ¶
func (t TestDovecotTestError) Check(_ context.Context, _ *RuntimeData) (bool, error)
type TestString ¶
type TestString struct { Source []string // contains filtered or unexported fields }
func (TestString) Check ¶
func (t TestString) Check(_ context.Context, d *RuntimeData) (bool, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.