teguplugintypes

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserDBPluginType      = 1
	MailStoragePluginType = 2
	SmtpQueuePluginType   = 3
	SettingsDbPluginType  = 4
)
View Source
const (
	FlagDraft     = `\Draft`
	FlagFlagged   = `\Flagged`
	FlagForwarded = `$Forwarded`
	FlagAnswered  = `\Answered`
	FlagSeen      = `\Seen`
	FlagDeleted   = `\Deleted`
)

Variables

View Source
var ErrImapMailboxAlreadySubscribed = errors.New("mailbox already subscribed")
View Source
var ErrImapMailboxBusy = errors.New("mailbox busy")
View Source
var ErrImapMailboxHasSubfolder = errors.New("mailbox has subfolder")
View Source
var ErrImapMailboxInvalidName = errors.New("invalid name of mailbox")
View Source
var ErrImapMailboxNameDoesNotExists = errors.New("mailbox does not exists")
View Source
var ErrImapMailboxNameExists = errors.New("mailbox with same name exists")
View Source
var ErrImapMailboxNotEmpty = errors.New("mailbox not empty")
View Source
var ErrImapMailboxNotSubscribed = errors.New("mailbox not subscibed")
View Source
var ErrImapMailboxOk = errors.New("mailbox ok")
View Source
var ErrImapMailboxOsError = errors.New("mailbox. os error")
View Source
var ErrImapMailboxSameFolder = errors.New("same folder")
View Source
var ErrImapMailboxSystemFolder = errors.New("system folder")
View Source
var ErrImapSyntaxError = errors.New("syntax error")
View Source
var ErrImapUserQuotaExceeded = errors.New("user quota exceeded")

Functions

This section is empty.

Types

type DeliveryItem

type DeliveryItem struct {
	MID    string
	Helo   string
	IP     string
	TLS    bool
	Sender string
	Rcpt   string
	MsgRW  MessageReaderWriter
	Body   []byte
}

-----------------------------------------------------------------------------

type DeliveryState

type DeliveryState struct {
	DestDir     string
	Store       bool
	Redirected  bool
	StopProcess bool
}

type ImapFetchIter

type ImapFetchIter interface {
	ImapIterator
	Val() (uint64, string, error)
}

type ImapFolder

type ImapFolder interface {
	Close()
	GetSubscription() ImapSubscription
	GetParsedRules() []*RuleStruct
	SaveRules([]*RuleStruct)
	MsgInfos() []*ImapMsgInfo
	GetMsgTime(*ImapMsgInfo) time.Time
	GetMsgBodystructure(*ImapMsgInfo) (string, string)
	GetMsgEnvelopeFields(*ImapMsgInfo) string
	GetMsgFlagNames(info *ImapMsgInfo) []string
	AddFlagNamesToMsg(*ImapMsgInfo, []string) (int, []string)
	SetMsgFlagNames(*ImapMsgInfo, []string) (int, []string)
	DelFlagNamesFromMsg(*ImapMsgInfo, []string) (int, []string)
	GetName() string
	GetUsage() int
	GetUidValidity() uint64
	GetCurrentMsgCount() uint64
	GetUidNext() uint64
	GetFirstUnseenNum() uint64
	CheckRecent(keepRecent bool) uint64
	GetReaderWriterForNewMessage() (MessageReaderWriter, error)
	AddMsg(MessageReaderWriter, time.Time) (string, error)
	AddFolder(string)
	GetFolder(string) ImapFolder
	RemoveFolder(string) error
	RenameFolder(string, string) error
	ExpungeReturnNums() []uint64
	GetSystemFolders() []string
	GetIMAPDefaultFolders() map[string]string
	GetSearchIter(string, bool) ImapSearchIter
	GetFetchIter(string, string, bool) ImapFetchIter
	GetStoreIter(string, string, string, bool, bool) ImapStoreFlagsIter
	CopyTo(string, int, int, int, ImapFolder, bool) error
	ListFolders() []string
	ExistingFlags() []string
	SetReadOnly(bool)
	IsReadOnly() bool
}

type ImapIterator

type ImapIterator interface {
	Next() bool
	Close()
}

type ImapMboxInfo

type ImapMboxInfo struct {
	Recent, Unseen, Exists, Uidnext, Uidvalidity uint64
}

type ImapMessage

type ImapMessage interface {
	SetInfo(*ImapMsgInfo)
	GetInfo() *ImapMsgInfo
	GetPartBySectionNum(partN []int) ImapMessage
	GetAsBytes() []byte
	GetBody() ([]byte, error)
	GetHeader() ImapMessageHeader
	IsMultipart() bool
	MultipartReader() ImapMessageMultipartReader
	Close() error
}

type ImapMessageHeader

type ImapMessageHeader interface {
	ContentType() (string, map[string]string, error)
	Text(string) (string, error)
	GetFields() ImapMessageHeaderFields
	FieldsByKey(k string) ImapMessageHeaderFields
	Get(string) string
}

type ImapMessageHeaderFields

type ImapMessageHeaderFields interface {
	Next() bool
	Raw() ([]byte, error)
	Key() string
	Value() string
}

-----------------------------------------------------------------------------

type ImapMessageMultipartReader

type ImapMessageMultipartReader interface {
	NextPart() (ImapMessage, error)
}

type ImapMsgInfo

type ImapMsgInfo struct {
	Uid    uint64
	Num    uint64
	Mid    string
	Date   int64
	Size   int64
	Params map[string]string
}

-----------------------------------------------------------------------------

type ImapMsgInfoIter

type ImapMsgInfoIter interface {
	ImapIterator
	Val() *ImapMsgInfo
}

type ImapNumSetIter

type ImapNumSetIter interface {
	Next() bool
	Val() *ImapMsgInfo
	Valid() bool
	Close()
}

type ImapSearchIter

type ImapSearchIter interface {
	ImapIterator
	Val() uint64
}

type ImapSetRange

type ImapSetRange struct {
	Start uint64
	End   uint64
}

type ImapStoreFlagsIter

type ImapStoreFlagsIter interface {
	ImapIterator
	Val() (uint64, string, error)
}

type ImapSubscription

type ImapSubscription interface {
	Subscribe(string)
	Unsubscribe(string)
	Subscribed() []string
	Close()
}

type MailstoragePlugin

type MailstoragePlugin interface {
	Plugin
	GetInbox(string, string) ImapFolder
	GetDefaultQuota(string) int
	GetTrashAdditionalQuota(string) int
	GetSmartHost(string) *SmartHost
}

type MessageReaderWriter

type MessageReaderWriter interface {
	FileName() string
	Name() string // путь до файла, как был передан при открытии
	Read(p []byte) (n int, err error)
	ReadAll() ([]byte, error)
	Seek(offset int64, whence int) (int64, error)
	Write([]byte) (int, error)
	Sync() error
	Close() error
	ReOpen() error
	Destroy() error
	GetFlags() []string
	SetFlags([]string)
	Params() map[string]interface{}
}

----------------------------------------------------------------------------- -----------------------------------------------------------------------------

type Plugin

type Plugin interface {
	IsShared() bool
	Init(context.Context) bool
	SetSettingsDb(SettingsDbPlugin)
	GetName() string
	GetPType() int
	GetDesc() string
	GetVersion() string
	GetEmptySettings() []interface{}
	GetSettings(string) []interface{}
	SetSettings(string, map[string]string)
	DelSettings(string) error
	WebExists() bool
	Web(string, string, map[string]string) (interface{}, error)
}

type QueueItem

type QueueItem struct {
	QId              string
	RetryCount       int
	LastTryTimestamp int64
	MessageId        string
	Helo             string
	Ip               string
	Tls              bool
	RecvTimestamp    int64
	SenderEmail      string
	RcptEmail        string
}

-----------------------------------------------------------------------------

type QueueMessage

type QueueMessage struct {
	ReaderWriter MessageReaderWriter
	IP           string
	Helo         string
	SenderEmail  string
	Recipients   []string
	TLS          bool
	ID           string
	ListedAt     []string
}

type RuleActionStruct

type RuleActionStruct struct {
	Actions [][]string
}

type RuleConditionStruct

type RuleConditionStruct struct {
	Op         string
	Conditions [][]string
}

type RuleStruct

type RuleStruct struct {
	Name      string
	Condition *RuleConditionStruct
	Action    *RuleActionStruct
}

type SettingsDbPlugin added in v1.0.1

type SettingsDbPlugin interface {
	Plugin
	Open(map[string]string) error
	SetString(string, string) error
	SetStringList(string, []string) error
	SetInt(string, int64) error
	SetIntList(string, []int64) error
	SetFloat(string, float64) error
	SetFloatList(string, []float64) error
	SetBool(string, bool) error
	GetString(string) string
	GetStringList(string) []string
	GetInt(string) int64
	GetIntList(string) []int64
	GetFloat(string) float64
	GetFloatList(string) []float64
	GetBool(string) bool
	Del(string) error
	StrListAppend(string, string) error
	StrListExclude(string, string) error
	StrListContains(string, string) bool
	IntListAppend(string, int64) error
	IntListExclude(string, int64) error
	IntListContains(string, int64) bool
	FloatListAppend(string, float64) error
	FloatListExclude(string, float64) error
	FloatListContains(string, float64) bool
	Close()
}

type SmartHost

type SmartHost struct {
	Host string
	Port int
	User string
	Pass string
}

-----------------------------------------------------------------------------

type SmtpQueuePlugin

type SmtpQueuePlugin interface {
	Plugin
	Open() error
	GetTempReaderWriter() MessageReaderWriter
	GetNewMsgReaderWriter() MessageReaderWriter
	AddMessageForRcpt(string, []byte, *QueueMessage) error
	GetQueueItems() []*QueueItem
	GetQueueItemReaderWriter(string) MessageReaderWriter
	DeleteQueueItem(string)
	UpdateQueueRetry(string, int, int64)
	GetAsImapMessage(io.Reader) ImapMessage
	Close()
}

type UserDBPlugin

type UserDBPlugin interface {
	Plugin
	Auth(string, string, string, bool) bool
	UserByEmail(string, string) string
	ExpandAlias(string, string) []string
	NormalEmail(string, string) string
	UserQuotaMB(string, string) int
}

Jump to

Keyboard shortcuts

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