Documentation
¶
Overview ¶
An IMAP server
Index ¶
- Constants
- type Id
- type Mailbox
- type Mailstore
- type Message
- type MessageHeader
- type NotmuchMailstore
- func (nm *NotmuchMailstore) AppendMessage(mailbox string, flags []string, dateTime time.Time, message string) error
- func (nm *NotmuchMailstore) CountUnseen(mbox Id) (int64, error)
- func (nm *NotmuchMailstore) Fetch(mailbox Id, sequenceSet string, args []fetchArgument, useUids bool) ([]messageFetchResponse, error)
- func (nm *NotmuchMailstore) FirstUnseen(mbox Id) (int64, error)
- func (nm *NotmuchMailstore) Flag(mode flagMode, mbox Id, sequenceSet string, useUids bool, flags []string) ([]messageFetchResponse, error)
- func (nm *NotmuchMailstore) GetMailbox(path []string) (*Mailbox, error)
- func (nm *NotmuchMailstore) GetMailboxes(path []string) ([]*Mailbox, error)
- func (nm *NotmuchMailstore) NextUid(mbox Id) (int64, error)
- func (nm *NotmuchMailstore) RecentMessages(mbox Id) (int64, error)
- func (nm *NotmuchMailstore) Search(mailbox Id, args []searchArgument, returnUid, returnThreads bool) (threadMembers []threadMember, err error)
- func (nm *NotmuchMailstore) TotalMessages(mbox Id) (int64, error)
- type Option
- type Server
Constants ¶
View Source
const ( SET flagMode = iota ADD REMOVE )
View Source
const ( // Noinferiors indicates it is not possible for any child levels of hierarchy to exist // under this name; no child levels exist now and none can be // created in the future. Noinferiors = 1 << iota // Noselect indicates it is not possible to use this name as a selectable mailbox. Noselect // Marked indicates that the mailbox has been marked "interesting" by the server; // the mailbox probably contains messages that have been added since // the last time the mailbox was selected Marked // Unmarked indicates the mailbox does not contain any additional messages since the // last time the mailbox was selected. Unmarked )
Mailbox flags
View Source
const DefaultListener = "0.0.0.0:143"
DefaultListener is the listener that is used if no listener is specified
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailbox ¶
type Mailbox struct {
Name string // The name of the mailbox
Path []string // Full mailbox path
Id Id // Mailbox id
UidValidity uint32 // Mailbox uidvalidity
Flags uint8 // Mailbox flags
}
Mailbox represents an IMAP mailbox
type Mailstore ¶
type Mailstore interface {
// GetMailbox gets IMAP mailbox information
// Returns nil if the mailbox does not exist
GetMailbox(path []string) (*Mailbox, error)
// GetMailboxes gets a list of mailboxes at the given path
GetMailboxes(path []string) ([]*Mailbox, error)
// FirstUnseen gets the sequence number of the first unseen message in an IMAP mailbox
FirstUnseen(mbox Id) (int64, error)
// TotalMessages gets the total number of messages in an IMAP mailbox
TotalMessages(mbox Id) (int64, error)
// RecentMessages gets the total number of unread messages in an IMAP mailbox
RecentMessages(mbox Id) (int64, error)
// NextUid gets the next available uid in an IMAP mailbox
NextUid(mbox Id) (int64, error)
// CountUnseen counts the number of unseen messages in an IMAP mailbox
CountUnseen(mbox Id) (int64, error)
// AppendMessage appends the message to an IMAP mailbox
AppendMessage(mailbox string, flags []string, dateTime time.Time, message string) error
// Search searches messages in an IMAP mailbox
// The output ids are sorted by date
Search(mbox Id, args []searchArgument, returnUid, returnThreads bool) (ids []threadMember, err error)
// Fetch fetches information on the selected messages in the given
// mailbox.
// The output is a list of list. The first level has one element by
// message, the second level has one element per desired field in the message
Fetch(mailbox Id, sequenceSet string, args []fetchArgument, returnUid bool) ([]messageFetchResponse, error)
// Flag adds, sets or removes flags to the given set of messages.
// It returns a list of struct that each contain the message sequence
// id and its new set of flags for each message that was modified by
// the command
Flag(mode flagMode, mbox Id, sequenceSet string, useUids bool, flags []string) ([]messageFetchResponse, error)
}
Mailstore is a service responsible for I/O with the actual e-mails
type Message ¶
type Message struct {
Id string `json:"id"`
DateRelative string `json:"date_relative"`
Tags []string `json:"tags"`
Header MessageHeader `json:"headers"`
// This one is used internally, it doesn't exist as is in the notmuch
// data model
Children []Message
}
A message as retrieved from notmuch See the devel/schemata file in notmuch source http://git.notmuchmail.org/git/notmuch/blob/HEAD:/devel/schemata
type MessageHeader ¶
type NotmuchMailstore ¶
type NotmuchMailstore struct {
// contains filtered or unexported fields
}
func NewNotmuchMailstore ¶
func NewNotmuchMailstore() *NotmuchMailstore
func (*NotmuchMailstore) AppendMessage ¶
func (*NotmuchMailstore) CountUnseen ¶
func (nm *NotmuchMailstore) CountUnseen(mbox Id) (int64, error)
func (*NotmuchMailstore) Fetch ¶
func (nm *NotmuchMailstore) Fetch(mailbox Id, sequenceSet string, args []fetchArgument, useUids bool) ([]messageFetchResponse, error)
func (*NotmuchMailstore) FirstUnseen ¶
func (nm *NotmuchMailstore) FirstUnseen(mbox Id) (int64, error)
func (*NotmuchMailstore) GetMailbox ¶
func (nm *NotmuchMailstore) GetMailbox(path []string) (*Mailbox, error)
func (*NotmuchMailstore) GetMailboxes ¶
func (nm *NotmuchMailstore) GetMailboxes(path []string) ([]*Mailbox, error)
func (*NotmuchMailstore) RecentMessages ¶
func (nm *NotmuchMailstore) RecentMessages(mbox Id) (int64, error)
func (*NotmuchMailstore) Search ¶
func (nm *NotmuchMailstore) Search(mailbox Id, args []searchArgument, returnUid, returnThreads bool) (threadMembers []threadMember, err error)
func (*NotmuchMailstore) TotalMessages ¶
func (nm *NotmuchMailstore) TotalMessages(mbox Id) (int64, error)
type Option ¶
func AuthStoreOption ¶
AuthStoreOption adds an authenticaton backend
func ListenOption ¶
ListenOption adds an interface to listen to
func ListenSTARTTLSOption ¶
ListenSTARTTLSOption enables STARTTLS with the given certificate and keyfile
func MaxClientsOption ¶
MaxClientsOption sets the MaxClients config
func StoreOption ¶
Add a mailstore to the config StoreOption add a mailstore to the config
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
boltstore
Package boltstore holds an implementation of github.com/alienscience/imapsrv/auth - AuthStore, using github.com/boltdb/bolt - DB.
|
Package boltstore holds an implementation of github.com/alienscience/imapsrv/auth - AuthStore, using github.com/boltdb/bolt - DB. |
|
mysqlstore
Package mysqlstore holds an implementation of github.com/alienscience/imapsrv/auth - AuthStore, using MySQL
|
Package mysqlstore holds an implementation of github.com/alienscience/imapsrv/auth - AuthStore, using MySQL |
|
demo
|
|
|
auth
command
|
|
|
basic
command
|
|
|
customaddress
command
|
|
|
starttls
command
|
Click to show internal directories.
Click to hide internal directories.
