storage

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConn

type DBConn struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func InitDatabase

func InitDatabase(config *StorageConfig) (*DBConn, error)

func (*DBConn) CheckAddressMode

func (db *DBConn) CheckAddressMode(username string) (int, error)

func (*DBConn) CheckUser

func (db *DBConn) CheckUser(authMethod, username, cramPassword, cramSecret string) (int, error)

func (*DBConn) CheckUserWithPass

func (db *DBConn) CheckUserWithPass(authMethod, username, cramPassword, cramSecret string) (int, string, error)

func (*DBConn) CleanupMessages

func (db *DBConn) CleanupMessages(mailboxId int, inboxSettings InboxSettings) error

cleanup messages

func (*DBConn) Close

func (db *DBConn) Close()

func (*DBConn) GeInboxSettings

func (db *DBConn) GeInboxSettings(mailboxId int) (InboxSettings, error)

func (*DBConn) IfUserExist

func (db *DBConn) IfUserExist(username string) bool

func (*DBConn) Pop3DeleteMessage

func (db *DBConn) Pop3DeleteMessage(mailboxId, messageId int) error

func (*DBConn) Pop3Message

func (db *DBConn) Pop3Message(mailboxId, messageId int) (int, string, error)

func (*DBConn) Pop3MessagesCountAndSum

func (db *DBConn) Pop3MessagesCountAndSum(mailboxId int) (int, int, error)

func (*DBConn) Pop3MessagesList

func (db *DBConn) Pop3MessagesList(mailboxId int) ([][2]int, error)

func (*DBConn) StoreAttachment

func (db *DBConn) StoreAttachment(mailboxId int, messageId int, filename, attachmentType, contentType, contentId, transferEncoding, strBody string) (int, error)

func (*DBConn) StoreMail

func (db *DBConn) StoreMail(mailboxId int, subject string, date time.Time, from, from_name, to, to_name, html, text string, rawEmail []byte) (int, error)

func (*DBConn) UpdateSpamReport

func (db *DBConn) UpdateSpamReport(mailboxId int, messageId int, spamReport string) (int, error)

func (*DBConn) UpdateVirusesReport

func (db *DBConn) UpdateVirusesReport(mailboxId int, messageId int, virusesReport string) (int, error)

type InboxSettings

type InboxSettings struct {
	MaxMessages, RateLimit int
}

type StorageConfig

type StorageConfig struct {
	Adapter   string
	Host      string
	Port      int
	Username  string
	Password  string
	Database  string
	Pool      int
	Pool_Idle int

	Auth_Sql string

	Settings_Sql string

	Messages_Sql    string
	Attachments_Sql string

	Max_Messages_Enabled        bool
	Max_Messages_Cleanup_Sql    string
	Max_Attachments_Cleanup_Sql string

	Spamassassin_Sql string

	Clamav_Sql string

	Pop3_Count_And_Size_Messages string
	Pop3_Messages_List           string
	Pop3_Message_One             string
	Pop3_Message_Delete          string

	Email_Address_Mode_Sql string
}

Jump to

Keyboard shortcuts

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