Documentation ¶
Index ¶
- Constants
- Variables
- 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 MailstoragePlugin
- type MessageReaderWriter
- type Plugin
- type QueueItem
- type QueueMessage
- type RuleActionStruct
- type RuleConditionStruct
- type RuleStruct
- type SettingsDbPlugin
- type SmartHost
- type SmtpQueuePlugin
- type UserDBPlugin
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 ImapFetchIter ¶
type ImapFetchIter interface { ImapIterator Val() (uint64, string, error) }
type ImapFolder ¶
type ImapFolder interface { Close() MsgInfos() []*ImapMsgInfo GetValidUidsByCondition([]uint64, [][]uint64) map[uint64]bool GetSearchImapMessage(*ImapMsgInfo) ImapMessage GetFetchImapMessage(*ImapMsgInfo) ImapMessage GetMsgTime(*ImapMsgInfo) time.Time GetMsgReaderWriter(*ImapMsgInfo) MessageReaderWriter 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 GetTempReaderWriter() (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 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 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 ImapStoreFlagsIter ¶
type ImapStoreFlagsIter interface { ImapIterator Val() (uint64, string, error) }
type ImapSubscription ¶
type MailstoragePlugin ¶
type MailstoragePlugin interface { Plugin GetInbox(string, string) ImapFolder GetSubscription(string, string) ImapSubscription GetDefaultQuota(string) int GetTrashAdditionalQuota(string) int GetSmartHost(string) *SmartHost GetParsedRules(string) []*RuleStruct SaveRules(string, []*RuleStruct) }
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) }
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
type Plugin ¶
type Plugin interface { 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 RuleActionStruct ¶
type RuleActionStruct struct {
Actions [][]string
}
type RuleConditionStruct ¶
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 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() }
Click to show internal directories.
Click to hide internal directories.