Documentation ¶
Index ¶
- type CtxValuesStruct
- type DeliveryItem
- type DeliveryState
- type ImapFetchIter
- type ImapFolder
- type ImapIterator
- type ImapMboxInfo
- type ImapMessage
- type ImapMessageHeader
- type ImapMessageHeaderFields
- type ImapMessageMultipartReader
- type ImapMsgInfo
- type ImapMsgInfoIter
- type ImapNumSetIter
- type ImapSearchIter
- type ImapSetRange
- type ImapStoreFlagsIter
- type ImapSubscription
- type MailStorage
- type MailstoragePlugin
- type MessageReaderWriter
- type MiscPlugin
- type Plugin
- type PluginEngine
- type QueueItem
- type QueueMessage
- type RuleActionStruct
- type RuleConditionStruct
- type RuleStruct
- type SettingsDbPlugin
- type SmartHost
- type SmtpQueue
- type SmtpQueuePlugin
- type UserDBPlugin
- type UserDBProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CtxValuesStruct ¶
type CtxValuesStruct struct { Debug bool NodeID string DataDir string PluginDir string Settings SettingsDbPlugin Plugins PluginEngine Queue SmtpQueuePlugin }
type DeliveryItem ¶
type DeliveryItem struct { MID string Helo string IP string TLS bool Sender string Rcpt string MsgRW MessageReaderWriter Body []byte }
-----------------------------------------------------------------------------
type DeliveryState ¶
type ImapFetchIter ¶
type ImapFolder ¶
type ImapFolder interface { Close(context.Context) error GetSubscription(context.Context) (ImapSubscription, error) GetParsedRules(context.Context) ([]*RuleStruct, error) SaveRules(context.Context, []*RuleStruct) error GetMsgTime(context.Context, *ImapMsgInfo) (time.Time, error) GetMsgBodystructure(context.Context, *ImapMsgInfo) (string, string, error) GetMsgEnvelopeFields(context.Context, *ImapMsgInfo) (string, error) GetMsgFlagNames(context.Context, *ImapMsgInfo) ([]string, error) AddFlagNamesToMsg(context.Context, *ImapMsgInfo, []string) (int, []string, error) SetMsgFlagNames(context.Context, *ImapMsgInfo, []string) (int, []string, error) DelFlagNamesFromMsg(context.Context, *ImapMsgInfo, []string) (int, []string, error) GetName(context.Context) string GetUsage(context.Context) (int, error) GetUidValidity(context.Context) (uint64, error) GetCurrentMsgCount(context.Context) (uint64, error) GetUidNext(context.Context) (uint64, error) GetFirstUnseenNum(context.Context) (uint64, error) CheckRecent(context.Context, bool) (uint64, error) GetReaderWriterForNewMessage(context.Context) (MessageReaderWriter, error) AddMsg(context.Context, MessageReaderWriter, time.Time) (string, error) AddFolder(context.Context, string) error GetFolder(context.Context, string) (ImapFolder, error) RemoveFolder(context.Context, string) error RenameFolder(context.Context, string, string) error ExpungeReturnNums(context.Context) ([]uint64, error) GetSystemFolders(context.Context) ([]string, error) GetIMAPDefaultFolders(context.Context) (map[string]string, error) GetSearchIter(context.Context, string, bool) (ImapSearchIter, error) GetFetchIter(context.Context, string, string, bool) (ImapFetchIter, error) GetStoreIter(context.Context, string, string, string, bool, bool) (ImapStoreFlagsIter, error) CopyTo(context.Context, string, int, int, int, ImapFolder, bool) error ListFolders(context.Context) ([]string, error) ExistingFlags(context.Context) ([]string, error) SetReadOnly(context.Context, bool) error IsReadOnly(context.Context) bool }
type ImapIterator ¶
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) GetDecodedText() ([]byte, error) GetHeader() ImapMessageHeader IsMultipart() bool MultipartReader() ImapMessageMultipartReader Close() error }
type ImapMessageHeader ¶
type ImapMessageHeaderFields ¶
type ImapMessageHeaderFields interface { Next() bool Raw() ([]byte, error) Key() string Value() string Text() (string, error) }
-----------------------------------------------------------------------------
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(context.Context) (*ImapMsgInfo, error) }
type ImapNumSetIter ¶
type ImapSearchIter ¶
type ImapSearchIter interface { ImapIterator Val(context.Context) (uint64, error) }
type ImapSetRange ¶
type ImapStoreFlagsIter ¶
type ImapSubscription ¶
type MailStorage ¶ added in v1.1.2
type MailstoragePlugin ¶
type MailstoragePlugin interface { Plugin GetInbox(context.Context, string, string) (ImapFolder, error) GetDefaultQuota(context.Context, string) (int, error) GetTrashAdditionalQuota(context.Context, string) (int, error) GetSmartHost(context.Context, string) (*SmartHost, error) GetMboxCount(context.Context, string) (uint64, error) }
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 MiscPlugin ¶ added in v1.1.20
type MiscPlugin interface { Plugin }
type Plugin ¶
type Plugin interface { Init(context.Context) bool GetName(context.Context) (string, error) GetPType(context.Context) (int, error) GetDesc(context.Context) (string, error) GetVersion(context.Context) (string, error) GetEmptySettings(context.Context) ([]interface{}, error) GetSettings(context.Context, string) ([]interface{}, error) SetSettings(context.Context, string, map[string]string) error DelSettings(context.Context, string) error WebExists(context.Context) bool Web(context.Context, string, string, map[string]string) (interface{}, error) Do(context.Context, string, map[string]interface{}) (interface{}, error) }
type PluginEngine ¶ added in v1.1.2
type PluginEngine interface { Get(context.Context, string, int) (interface{}, error) GetAll(context.Context, int) ([]interface{}, error) Set(context.Context, string, int, *plugin.Plugin) error Init(context.Context) UserDBPluginCount(context.Context) int MailstoragePluginCount(context.Context) int SmtpQueuePluginCount(context.Context) int SettingsDbPluginCount(context.Context) int MiscPluginCount(context.Context) int GetPluginNamesDesc(context.Context, int) ([][]string, 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 RuleActionStruct ¶
type RuleActionStruct struct {
Actions [][]string
}
type RuleConditionStruct ¶
type RuleStruct ¶
type RuleStruct struct { Name string Condition *RuleConditionStruct Action *RuleActionStruct }
type SettingsDbPlugin ¶
type SettingsDbPlugin interface { Plugin Open(context.Context, map[string]string) error SetString(context.Context, string, string) error SetStringList(context.Context, string, []string) error SetInt(context.Context, string, int64) error SetIntList(context.Context, string, []int64) error SetFloat(context.Context, string, float64) error SetFloatList(context.Context, string, []float64) error SetBool(context.Context, string, bool) error GetString(context.Context, string) (string, error) GetStringList(context.Context, string) ([]string, error) GetInt(context.Context, string) (int64, error) GetIntList(context.Context, string) ([]int64, error) GetFloat(context.Context, string) (float64, error) GetFloatList(context.Context, string) ([]float64, error) GetBool(context.Context, string) (bool, error) Del(context.Context, string) error StrListAppend(context.Context, string, string) error StrListExclude(context.Context, string, string) error StrListContains(context.Context, string, string) bool IntListAppend(context.Context, string, int64) error IntListExclude(context.Context, string, int64) error IntListContains(context.Context, string, int64) bool FloatListAppend(context.Context, string, float64) error FloatListExclude(context.Context, string, float64) error FloatListContains(context.Context, string, float64) bool Close(context.Context) error }
type SmtpQueuePlugin ¶
type SmtpQueuePlugin interface { Plugin Open(context.Context) error GetTempReaderWriter(context.Context) (MessageReaderWriter, error) GetNewMsgReaderWriter(context.Context) (MessageReaderWriter, error) GetQueueItems(context.Context) ([]*QueueItem, error) GetQueueItemReaderWriter(context.Context, string) (MessageReaderWriter, error) DeleteQueueItem(context.Context, string) error UpdateQueueRetry(context.Context, string, int, int64) error GetAsImapMessage(context.Context, io.Reader) (ImapMessage, error) IsSeen(context.Context, string, string) (bool, error) MarkAsSeen(context.Context, string, string) error Close(context.Context) error }
type UserDBPlugin ¶
type UserDBPlugin interface { Plugin Auth(context.Context, string, string, string, bool) (bool, error) UserByEmail(context.Context, string, string) (string, error) ExpandAlias(context.Context, string, string) ([]string, error) NormalEmail(context.Context, string, string) (string, error) UserQuotaMB(context.Context, string, string) (int, error) }
Click to show internal directories.
Click to hide internal directories.