core

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: BSD-2-Clause Imports: 50 Imported by: 0

Documentation

Overview

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

Test using: http://sanesecurity.com/support/signature-testing/

Package main is a generated protocol buffer package.

It is generated from these files:
	cluegetter.proto

It has these top-level messages:
	Proto_Message
	Proto_Session
	Rpc

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

ClueGetter - Does things with mail

Copyright 2016 Dolf Schimmel, Freeaqingme.

This Source Code Form is subject to the terms of the two-clause BSD license. For its contents, please refer to the LICENSE file.

Index

Constants

View Source
const (
	MessagePermit = iota
	MessageTempFail
	MessageReject
	MessageError
)
View Source
const (
	QUOTA_FACTOR_SENDER           = "sender"
	QUOTA_FACTOR_SENDER_DOMAIN    = "sender_domain"
	QUOTA_FACTOR_RECIPIENT        = "recipient"
	QUOTA_FACTOR_RECIPIENT_DOMAIN = "recipient_domain"
	QUOTA_FACTOR_CLIENT_ADDRESS   = "client_address"
	QUOTA_FACTOR_SASL_USERNAME    = "sasl_username"
)

Variables

View Source
var (
	ErrInvalidLengthCluegetter = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCluegetter   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	Config = *new(config)

	Log *log.Logger
)
View Source
var (
	MessageStmtInsertMsg             = *new(*sql.Stmt)
	MessageStmtInsertMsgBody         = *new(*sql.Stmt)
	MessageStmtInsertRcpt            = *new(*sql.Stmt)
	MessageStmtInsertMsgRcpt         = *new(*sql.Stmt)
	MessageStmtInsertMsgHdr          = *new(*sql.Stmt)
	MessageStmtInsertModuleResult    = *new(*sql.Stmt)
	MessageStmtPruneBody             = *new(*sql.Stmt)
	MessageStmtPruneHeader           = *new(*sql.Stmt)
	MessageStmtPruneMessageResult    = *new(*sql.Stmt)
	MessageStmtPruneMessageQuota     = *new(*sql.Stmt)
	MessageStmtPruneMessage          = *new(*sql.Stmt)
	MessageStmtPruneMessageRecipient = *new(*sql.Stmt)
	MessageStmtPruneRecipient        = *new(*sql.Stmt)
	MessageStmtPruneSession          = *new(*sql.Stmt)
)
View Source
var BounceHandlerSaveBounceReportStmt = *new(*sql.Stmt)
View Source
var BounceHandlerSaveBounceStmt = *new(*sql.Stmt)
View Source
var MessageInsertHeaders = make([]MessageHeader, 0)
View Source
var MessageModuleGroups = make([]*MessageModuleGroup, 0)
View Source
var MilterDataIndex milterDataIndex
View Source
var Proto_Message_Verdict_name = map[int32]string{
	0: "PERMIT",
	1: "TEMPFAIL",
	2: "REJECT",
	3: "ERROR",
}
View Source
var Proto_Message_Verdict_value = map[string]int32{
	"PERMIT":   0,
	"TEMPFAIL": 1,
	"REJECT":   2,
	"ERROR":    3,
}
View Source
var QuotaGetAllQuotasStmt = *new(*sql.Stmt)
View Source
var QuotaGetAllRegexesStmt = *new(*sql.Stmt)
View Source
var Rdbms *sql.DB
View Source
var (
	RedisLPushChan chan *RedisKeyValue
)
View Source
var StatsControl = make(chan struct{})
View Source
var StatsCounters = make(map[string]*StatsCounter)
View Source
var StatsCountersMutex = &sync.Mutex{}

Functions

func CluegetterRecover

func CluegetterRecover(funcName string)

func DaemonReset

func DaemonReset()

func DefaultConfig

func DefaultConfig(cfg *config)

func GetNewConfig

func GetNewConfig() *config

func HttpParseFilterInstance

func HttpParseFilterInstance(r *http.Request) (out []string, err error)

func HttpRenderOutput

func HttpRenderOutput(w http.ResponseWriter, r *http.Request, templateFile string, data, jsonData interface{})

func LoadConfig

func LoadConfig(cfgFile string, cfg *config)

func LuaReset

func LuaReset()

func LuaStart

func LuaStart()

func MilterAddRcpt

func MilterAddRcpt(sess *MilterSession, rcpt string) int

func MilterChangeFrom

func MilterChangeFrom(sess *MilterSession, from string)

func MilterDelRcpt

func MilterDelRcpt(sess *MilterSession, rcpt string) int

func ModuleRegister

func ModuleRegister(module Module)

func RdbmsRowsInTable

func RdbmsRowsInTable(table string) (count int)

TODO: Make method of RdbmsClient

func SetConfig

func SetConfig(config *config)

Types

type BaseModule

type BaseModule struct{}

BaseModule

You'll need to implement yourself at least the following methods:

Name() string Enable() bool SetCluegetter(cg *Cluegetter)

func (*BaseModule) HttpHandlers

func (m *BaseModule) HttpHandlers() map[string]HttpCallback

func (*BaseModule) Init

func (m *BaseModule) Init()

func (*BaseModule) Ipc

func (m *BaseModule) Ipc() map[string]func(string)

func (*BaseModule) MessageCheck

func (m *BaseModule) MessageCheck(msg *Message, done chan bool) *MessageCheckResult

func (*BaseModule) RecipientCheck

func (m *BaseModule) RecipientCheck(rcpt *address.Address) (verdict int, msg string)

func (*BaseModule) Rpc

func (m *BaseModule) Rpc() map[string]chan string

func (*BaseModule) SessionDisconnect

func (m *BaseModule) SessionDisconnect(s *MilterSession)

func (*BaseModule) Stop

func (m *BaseModule) Stop()

type Cluegetter

type Cluegetter struct {
	Config config
	Log    *log.Logger
	Redis  RedisClient
	// contains filtered or unexported fields
}

func InitCg

func InitCg() *Cluegetter

func (*Cluegetter) Instance

func (cg *Cluegetter) Instance() uint

func (*Cluegetter) Module

func (cg *Cluegetter) Module(name, caller string) *Module

func (*Cluegetter) Modules

func (cg *Cluegetter) Modules() []Module

func (*Cluegetter) Rdbms

func (cg *Cluegetter) Rdbms() *sql.DB

type ConfigHttpFrontend

type ConfigHttpFrontend struct {
	Enabled               bool
	Listen_Port           string
	Listen_Host           string
	Enable_Proxy_Protocol bool
}

type ConfigLuaModule

type ConfigLuaModule struct {
	Enabled        bool
	Script         string
	ScriptContents string
}

type ConfigModuleGroup

type ConfigModuleGroup struct {
	Module []string
}

type HttpCallback

type HttpCallback func(w http.ResponseWriter, r *http.Request)

type HttpMessage

type HttpMessage struct {
	Recipients   []*HttpMessageRecipient
	Headers      []*HttpMessageHeader
	CheckResults []*HttpMessageCheckResult

	Ip           string
	ReverseDns   string
	Helo         string
	SaslUsername string
	SaslMethod   string
	CertIssuer   string
	CertSubject  string
	CipherBits   string
	Cipher       string
	TlsVersion   string

	MtaHostname   string
	MtaDaemonName string

	Id                     string
	SessionId              string
	Date                   *time.Time
	BodySize               uint32
	BodySizeStr            string
	Sender                 string
	RcptCount              int
	Verdict                string
	VerdictMsg             string
	RejectScore            float64
	RejectScoreThreshold   float64
	TempfailScore          float64
	TempfailScoreThreshold float64
	ScoreCombined          float64
}

type HttpMessageCheckResult

type HttpMessageCheckResult struct {
	Module        string
	Verdict       string
	Score         float64
	WeightedScore float64
	Duration      float64
	Determinants  string
}

type HttpMessageHeader

type HttpMessageHeader struct {
	Name string
	Body string
}

type HttpMessageRecipient

type HttpMessageRecipient struct {
	Id     int
	Local  string
	Domain string
	Email  string
}

type HttpViewData

type HttpViewData struct {
	Config *config
}

func HttpGetViewData

func HttpGetViewData() *HttpViewData

type Message

type Message struct {
	QueueId  string
	From     *address.Address
	Rcpt     []*address.Address
	Headers  []MessageHeader
	Body     []byte `json:"-"`
	Date     time.Time
	BodySize int
	BodyHash string

	Verdict                int
	VerdictMsg             string
	RejectScore            float64
	RejectScoreThreshold   float64
	TempfailScore          float64
	TempfailScoreThreshold float64

	CheckResults []*MessageCheckResult
	// contains filtered or unexported fields
}

func (*Message) GetHeader

func (msg *Message) GetHeader(key string, includeDeleted bool) []MessageHeader

func (*Message) Session

func (msg *Message) Session() *MilterSession

func (*Message) SetSession

func (msg *Message) SetSession(s *MilterSession)

func (*Message) String

func (msg *Message) String() []byte

type MessageCheckResult

type MessageCheckResult struct {
	Module          string
	SuggestedAction int
	Message         string
	Score           float64
	Determinants    map[string]interface{}
	Duration        time.Duration
	WeightedScore   float64
	Callbacks       []*func(*Message, int)
}

func LuaMilterCheck

func LuaMilterCheck(luaModuleName string, msg *Message, done chan bool) *MessageCheckResult

func (*MessageCheckResult) MarshalJSON

func (cr *MessageCheckResult) MarshalJSON() ([]byte, error)

type MessageHeader

type MessageHeader struct {
	Key   string
	Value string
	// contains filtered or unexported fields
}

type MessageModuleGroup

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

type MessageModuleGroupMember

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

type MilterSession

type MilterSession struct {
	DateConnect    time.Time
	DateDisconnect time.Time
	Messages       []*Message
	Instance       uint

	SaslUsername  string
	SaslSender    string
	SaslMethod    string
	CertIssuer    string
	CertSubject   string
	CipherBits    uint32
	Cipher        string
	TlsVersion    string
	Ip            string
	ReverseDns    string
	Hostname      string
	Helo          string
	MtaHostName   string
	MtaDaemonName string
	// contains filtered or unexported fields
}

func (*MilterSession) Id

func (s *MilterSession) Id() []byte

func (*MilterSession) IdArray

func (s *MilterSession) IdArray() [16]byte

func (*MilterSession) SetId

func (s *MilterSession) SetId(id [16]byte)

type Module

type Module interface {
	SetCluegetter(*Cluegetter)
	Name() string
	Enable() bool
	Init()
	Stop()
	MessageCheck(msg *Message, done chan bool) *MessageCheckResult
	RecipientCheck(rcpt *address.Address) (verdict int, msg string)
	SessionDisconnect(s *MilterSession)
	Ipc() map[string]func(string)
	Rpc() map[string]chan string
	HttpHandlers() map[string]HttpCallback
}

type ModuleOld

type ModuleOld struct {
	*BaseModule
	// contains filtered or unexported fields
}

func (*ModuleOld) Enable

func (m *ModuleOld) Enable() bool

func (*ModuleOld) HttpHandlers

func (m *ModuleOld) HttpHandlers() map[string]HttpCallback

func (*ModuleOld) Init

func (m *ModuleOld) Init()

func (*ModuleOld) Ipc

func (m *ModuleOld) Ipc() map[string]func(string)

func (*ModuleOld) MessageCheck

func (m *ModuleOld) MessageCheck(msg *Message, done chan bool) *MessageCheckResult

func (*ModuleOld) Name

func (m *ModuleOld) Name() string

func (*ModuleOld) RecipientCheck

func (m *ModuleOld) RecipientCheck(rcpt *address.Address) (verdict int, msg string)

func (*ModuleOld) Rpc

func (m *ModuleOld) Rpc() map[string]chan string

func (*ModuleOld) SetCluegetter

func (m *ModuleOld) SetCluegetter(cg *Cluegetter)

func (*ModuleOld) Stop

func (m *ModuleOld) Stop()

type NullTime

type NullTime struct {
	time.Time
	Valid bool // Valid is true if Time is not NULL
}

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTime) Value

func (nt NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Proto_Message

type Proto_Message struct {
	Session                *Proto_Session               `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
	Id                     string                       `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	From                   string                       `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
	Rcpt                   []string                     `protobuf:"bytes,4,rep,name=rcpt" json:"rcpt,omitempty"`
	Headers                []*Proto_Message_Header      `protobuf:"bytes,5,rep,name=headers" json:"headers,omitempty"`
	Body                   []byte                       `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"`
	Verdict                Proto_Message_Verdict        `protobuf:"varint,7,opt,name=verdict,proto3,enum=main.Proto_Message_Verdict" json:"verdict,omitempty"`
	VerdictMsg             string                       `protobuf:"bytes,8,opt,name=verdictMsg,proto3" json:"verdictMsg,omitempty"`
	RejectScore            float64                      `protobuf:"fixed64,9,opt,name=rejectScore,proto3" json:"rejectScore,omitempty"`
	RejectScoreThreshold   float64                      `protobuf:"fixed64,10,opt,name=rejectScoreThreshold,proto3" json:"rejectScoreThreshold,omitempty"`
	TempfailScore          float64                      `protobuf:"fixed64,11,opt,name=tempfailScore,proto3" json:"tempfailScore,omitempty"`
	TempfailScoreThreshold float64                      `protobuf:"fixed64,12,opt,name=tempfailScoreThreshold,proto3" json:"tempfailScoreThreshold,omitempty"`
	CheckResults           []*Proto_Message_CheckResult `protobuf:"bytes,13,rep,name=checkResults" json:"checkResults,omitempty"`
}

func (*Proto_Message) Descriptor

func (*Proto_Message) Descriptor() ([]byte, []int)

func (*Proto_Message) GetCheckResults

func (m *Proto_Message) GetCheckResults() []*Proto_Message_CheckResult

func (*Proto_Message) GetHeaders

func (m *Proto_Message) GetHeaders() []*Proto_Message_Header

func (*Proto_Message) GetSession

func (m *Proto_Message) GetSession() *Proto_Session

func (*Proto_Message) Marshal

func (m *Proto_Message) Marshal() (data []byte, err error)

func (*Proto_Message) MarshalTo

func (m *Proto_Message) MarshalTo(data []byte) (int, error)

func (*Proto_Message) ProtoMessage

func (*Proto_Message) ProtoMessage()

func (*Proto_Message) Reset

func (m *Proto_Message) Reset()

func (*Proto_Message) Size

func (m *Proto_Message) Size() (n int)

func (*Proto_Message) String

func (m *Proto_Message) String() string

func (*Proto_Message) Unmarshal

func (m *Proto_Message) Unmarshal(data []byte) error

type Proto_Message_CheckResult

type Proto_Message_CheckResult struct {
	MessageId     string                `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	Module        string                `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"`
	Verdict       Proto_Message_Verdict `protobuf:"varint,3,opt,name=verdict,proto3,enum=main.Proto_Message_Verdict" json:"verdict,omitempty"`
	Score         float64               `protobuf:"fixed64,4,opt,name=score,proto3" json:"score,omitempty"`
	WeightedScore float64               `protobuf:"fixed64,5,opt,name=weightedScore,proto3" json:"weightedScore,omitempty"`
	Duration      float64               `protobuf:"fixed64,6,opt,name=duration,proto3" json:"duration,omitempty"`
	Determinants  []byte                `protobuf:"bytes,7,opt,name=determinants,proto3" json:"determinants,omitempty"`
}

func (*Proto_Message_CheckResult) Descriptor

func (*Proto_Message_CheckResult) Descriptor() ([]byte, []int)

func (*Proto_Message_CheckResult) Marshal

func (m *Proto_Message_CheckResult) Marshal() (data []byte, err error)

func (*Proto_Message_CheckResult) MarshalTo

func (m *Proto_Message_CheckResult) MarshalTo(data []byte) (int, error)

func (*Proto_Message_CheckResult) ProtoMessage

func (*Proto_Message_CheckResult) ProtoMessage()

func (*Proto_Message_CheckResult) Reset

func (m *Proto_Message_CheckResult) Reset()

func (*Proto_Message_CheckResult) Size

func (m *Proto_Message_CheckResult) Size() (n int)

func (*Proto_Message_CheckResult) String

func (m *Proto_Message_CheckResult) String() string

func (*Proto_Message_CheckResult) Unmarshal

func (m *Proto_Message_CheckResult) Unmarshal(data []byte) error

type Proto_Message_Header

type Proto_Message_Header struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Proto_Message_Header) Descriptor

func (*Proto_Message_Header) Descriptor() ([]byte, []int)

func (*Proto_Message_Header) Marshal

func (m *Proto_Message_Header) Marshal() (data []byte, err error)

func (*Proto_Message_Header) MarshalTo

func (m *Proto_Message_Header) MarshalTo(data []byte) (int, error)

func (*Proto_Message_Header) ProtoMessage

func (*Proto_Message_Header) ProtoMessage()

func (*Proto_Message_Header) Reset

func (m *Proto_Message_Header) Reset()

func (*Proto_Message_Header) Size

func (m *Proto_Message_Header) Size() (n int)

func (*Proto_Message_Header) String

func (m *Proto_Message_Header) String() string

func (*Proto_Message_Header) Unmarshal

func (m *Proto_Message_Header) Unmarshal(data []byte) error

type Proto_Message_Verdict

type Proto_Message_Verdict int32
const (
	Proto_Message_PERMIT   Proto_Message_Verdict = 0
	Proto_Message_TEMPFAIL Proto_Message_Verdict = 1
	Proto_Message_REJECT   Proto_Message_Verdict = 2
	Proto_Message_ERROR    Proto_Message_Verdict = 3
)

func (Proto_Message_Verdict) EnumDescriptor

func (Proto_Message_Verdict) EnumDescriptor() ([]byte, []int)

func (Proto_Message_Verdict) String

func (x Proto_Message_Verdict) String() string

type Proto_Session

type Proto_Session struct {
	InstanceId    uint64 `protobuf:"varint,1,opt,name=instanceId,proto3" json:"instanceId,omitempty"`
	Id            []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	TimeStart     uint64 `protobuf:"varint,3,opt,name=timeStart,proto3" json:"timeStart,omitempty"`
	TimeEnd       uint64 `protobuf:"varint,4,opt,name=timeEnd,proto3" json:"timeEnd,omitempty"`
	SaslUsername  string `protobuf:"bytes,5,opt,name=saslUsername,proto3" json:"saslUsername,omitempty"`
	SaslSender    string `protobuf:"bytes,6,opt,name=saslSender,proto3" json:"saslSender,omitempty"`
	SaslMethod    string `protobuf:"bytes,7,opt,name=saslMethod,proto3" json:"saslMethod,omitempty"`
	CertIssuer    string `protobuf:"bytes,8,opt,name=certIssuer,proto3" json:"certIssuer,omitempty"`
	CertSubject   string `protobuf:"bytes,9,opt,name=certSubject,proto3" json:"certSubject,omitempty"`
	CipherBits    uint32 `protobuf:"varint,10,opt,name=cipherBits,proto3" json:"cipherBits,omitempty"`
	Cipher        string `protobuf:"bytes,11,opt,name=cipher,proto3" json:"cipher,omitempty"`
	TlsVersion    string `protobuf:"bytes,12,opt,name=tlsVersion,proto3" json:"tlsVersion,omitempty"`
	Ip            string `protobuf:"bytes,13,opt,name=ip,proto3" json:"ip,omitempty"`
	ReverseDns    string `protobuf:"bytes,14,opt,name=reverseDns,proto3" json:"reverseDns,omitempty"`
	Hostname      string `protobuf:"bytes,15,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Helo          string `protobuf:"bytes,16,opt,name=helo,proto3" json:"helo,omitempty"`
	MtaHostName   string `protobuf:"bytes,17,opt,name=mtaHostName,proto3" json:"mtaHostName,omitempty"`
	MtaDaemonName string `protobuf:"bytes,18,opt,name=mtaDaemonName,proto3" json:"mtaDaemonName,omitempty"`
}

func (*Proto_Session) Descriptor

func (*Proto_Session) Descriptor() ([]byte, []int)

func (*Proto_Session) Marshal

func (m *Proto_Session) Marshal() (data []byte, err error)

func (*Proto_Session) MarshalTo

func (m *Proto_Session) MarshalTo(data []byte) (int, error)

func (*Proto_Session) ProtoMessage

func (*Proto_Session) ProtoMessage()

func (*Proto_Session) Reset

func (m *Proto_Session) Reset()

func (*Proto_Session) Size

func (m *Proto_Session) Size() (n int)

func (*Proto_Session) String

func (m *Proto_Session) String() string

func (*Proto_Session) Unmarshal

func (m *Proto_Session) Unmarshal(data []byte) error

type RedisClient

type RedisClient interface {
	RedisClientBase

	PSubscribe(patterns ...string) (*redis.PubSub, error)
	Publish(channel, message string) *redis.IntCmd
}

type RedisClientBase

type RedisClientBase interface {
	Del(keys ...string) *redis.IntCmd
	Exists(key string) *redis.BoolCmd
	Expire(key string, expiration time.Duration) *redis.BoolCmd
	Get(key string) *redis.StringCmd
	HSet(key, field, value string) *redis.BoolCmd
	HGetAllMap(key string) *redis.StringStringMapCmd
	LPush(key string, values ...string) *redis.IntCmd
	LPushX(key, value interface{}) *redis.IntCmd
	LRange(key string, start, stop int64) *redis.StringSliceCmd
	LSet(key string, index int64, value interface{}) *redis.StatusCmd
	Ping() *redis.StatusCmd
	RPop(key string) *redis.StringCmd
	SAdd(key string, members ...string) *redis.IntCmd
	SMembers(key string) *redis.StringSliceCmd
	Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	SetNX(key string, value interface{}, expiration time.Duration) *redis.BoolCmd
	ZAdd(key string, members ...redis.Z) *redis.IntCmd
	ZCount(key, min, max string) *redis.IntCmd
	ZRemRangeByScore(key, min, max string) *redis.IntCmd

	Eval(string, []string, []string) *redis.Cmd
	EvalSha(sha1 string, keys []string, args []string) *redis.Cmd
	ScriptExists(scripts ...string) *redis.BoolSliceCmd
	ScriptLoad(script string) *redis.StringCmd
}

type RedisClientMulti

type RedisClientMulti interface {
	RedisClientBase
	Exec(f func() error) ([]redis.Cmder, error)
}

type RedisKeyValue

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

type Rpc

type Rpc struct {
	// For all intents and purposes this field should be
	// considered required. But we may change that in a
	// far away feature, and we like to be forward
	// compatible with our proto buffers.
	Name                   string                       `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Bayes_Learn_Message    *Rpc__Bayes_Learn_Message    `protobuf:"bytes,1024,opt,name=Bayes_Learn_Message,json=bayesLearnMessage" json:"Bayes_Learn_Message,omitempty"`
	Bayes_Learn_Message_Id *Rpc__Bayes_Learn_Message_Id `protobuf:"bytes,1025,opt,name=Bayes_Learn_Message_Id,json=bayesLearnMessageId" json:"Bayes_Learn_Message_Id,omitempty"`
}

func (*Rpc) Descriptor

func (*Rpc) Descriptor() ([]byte, []int)

func (*Rpc) GetBayes_Learn_Message

func (m *Rpc) GetBayes_Learn_Message() *Rpc__Bayes_Learn_Message

func (*Rpc) GetBayes_Learn_Message_Id

func (m *Rpc) GetBayes_Learn_Message_Id() *Rpc__Bayes_Learn_Message_Id

func (*Rpc) Marshal

func (m *Rpc) Marshal() (data []byte, err error)

func (*Rpc) MarshalTo

func (m *Rpc) MarshalTo(data []byte) (int, error)

func (*Rpc) ProtoMessage

func (*Rpc) ProtoMessage()

func (*Rpc) Reset

func (m *Rpc) Reset()

func (*Rpc) Size

func (m *Rpc) Size() (n int)

func (*Rpc) String

func (m *Rpc) String() string

func (*Rpc) Unmarshal

func (m *Rpc) Unmarshal(data []byte) error

type Rpc__Bayes_Learn_Message

type Rpc__Bayes_Learn_Message struct {
	IsSpam   bool           `protobuf:"varint,1,opt,name=is_spam,json=isSpam,proto3" json:"is_spam,omitempty"`
	Message  *Proto_Message `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
	Host     string         `protobuf:"bytes,17,opt,name=host,proto3" json:"host,omitempty"`
	Reporter string         `protobuf:"bytes,18,opt,name=reporter,proto3" json:"reporter,omitempty"`
	Reason   string         `protobuf:"bytes,19,opt,name=reason,proto3" json:"reason,omitempty"`
}

func (*Rpc__Bayes_Learn_Message) Descriptor

func (*Rpc__Bayes_Learn_Message) Descriptor() ([]byte, []int)

func (*Rpc__Bayes_Learn_Message) GetMessage

func (m *Rpc__Bayes_Learn_Message) GetMessage() *Proto_Message

func (*Rpc__Bayes_Learn_Message) Marshal

func (m *Rpc__Bayes_Learn_Message) Marshal() (data []byte, err error)

func (*Rpc__Bayes_Learn_Message) MarshalTo

func (m *Rpc__Bayes_Learn_Message) MarshalTo(data []byte) (int, error)

func (*Rpc__Bayes_Learn_Message) ProtoMessage

func (*Rpc__Bayes_Learn_Message) ProtoMessage()

func (*Rpc__Bayes_Learn_Message) Reset

func (m *Rpc__Bayes_Learn_Message) Reset()

func (*Rpc__Bayes_Learn_Message) Size

func (m *Rpc__Bayes_Learn_Message) Size() (n int)

func (*Rpc__Bayes_Learn_Message) String

func (m *Rpc__Bayes_Learn_Message) String() string

func (*Rpc__Bayes_Learn_Message) Unmarshal

func (m *Rpc__Bayes_Learn_Message) Unmarshal(data []byte) error

type Rpc__Bayes_Learn_Message_Id

type Rpc__Bayes_Learn_Message_Id struct {
	IsSpam    bool   `protobuf:"varint,1,opt,name=is_spam,json=isSpam,proto3" json:"is_spam,omitempty"`
	MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	Host      string `protobuf:"bytes,17,opt,name=host,proto3" json:"host,omitempty"`
	Reporter  string `protobuf:"bytes,18,opt,name=reporter,proto3" json:"reporter,omitempty"`
	Reason    string `protobuf:"bytes,19,opt,name=reason,proto3" json:"reason,omitempty"`
}

func (*Rpc__Bayes_Learn_Message_Id) Descriptor

func (*Rpc__Bayes_Learn_Message_Id) Descriptor() ([]byte, []int)

func (*Rpc__Bayes_Learn_Message_Id) Marshal

func (m *Rpc__Bayes_Learn_Message_Id) Marshal() (data []byte, err error)

func (*Rpc__Bayes_Learn_Message_Id) MarshalTo

func (m *Rpc__Bayes_Learn_Message_Id) MarshalTo(data []byte) (int, error)

func (*Rpc__Bayes_Learn_Message_Id) ProtoMessage

func (*Rpc__Bayes_Learn_Message_Id) ProtoMessage()

func (*Rpc__Bayes_Learn_Message_Id) Reset

func (m *Rpc__Bayes_Learn_Message_Id) Reset()

func (*Rpc__Bayes_Learn_Message_Id) Size

func (m *Rpc__Bayes_Learn_Message_Id) Size() (n int)

func (*Rpc__Bayes_Learn_Message_Id) String

func (m *Rpc__Bayes_Learn_Message_Id) String() string

func (*Rpc__Bayes_Learn_Message_Id) Unmarshal

func (m *Rpc__Bayes_Learn_Message_Id) Unmarshal(data []byte) error

type SessionConfig

type SessionConfig struct {
	ClueGetter struct {
		Message_Reject_Score      float64
		Message_Tempfail_Score    float64
		Message_Spamflag_Score    float64
		Breaker_Score             float64
		Insert_Missing_Message_Id bool
	}
	Clamav struct {
		Enabled       bool
		Default_Score float64
		Max_Size      int
	}
	Contacts struct {
		Enabled                 bool
		Whitelist_Address_Score float64
		Whitelist_Domain_Score  float64
		Blacklist_Address_Score float64
		Blacklist_Domain_Score  float64
	}
	Greylisting struct {
		Enabled        bool
		Initial_Score  float64
		Initial_Period uint16
		Whitelist_Spf  []string
	}
	Quotas struct {
		Enabled bool
	}
	Rspamd struct {
		Enabled    bool
		Multiplier float64
	}
	SpamAssassin struct {
		Enabled         bool
		Timeout         float64
		Connect_Timeout float64
		Max_Size        int
	}
}

type StatsCounter

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

Jump to

Keyboard shortcuts

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