Documentation
¶
Overview ¶
Package maildir implements access to DJB's maildir format.
The type Maildir is a string of the path to the maildir. The type Unique is a string of a unique maildir message identifier. The type CurMail is a handle on a message that has been delivered.
Index ¶
- type CurMail
- type Maildir
- func (md Maildir) Acknowledge(u Unique) (mail *CurMail, err error)
- func (md Maildir) Clean() error
- func (md Maildir) ListCur() (mails []*CurMail, err error)
- func (md Maildir) ListNew() (mails []Unique, err error)
- func (md Maildir) NewMail() Writer
- func (md Maildir) Open(u Unique) (mail *CurMail, err error)
- type Reader
- type Unique
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurMail ¶
type CurMail struct {
// contains filtered or unexported fields
}
CurMail is a handle on an Acknowledge()ed (not newly-delivered) message in the maildir.
func (*CurMail) GetInfo ¶
GetInfo returns the info string for the message, which "is morally equivalent to the Status field used by mbox readers."
This package treats info as an opaque string, but obviously it would be good for it to have a common format between implementations. See <http://cr.yp.to/proto/maildir.html> for a recomendation for common semantics.
func (*CurMail) Reader ¶
Reader returns an io.{Reader,Seeker,Closer} for the message, so that you can read its contents.
func (*CurMail) SetInfo ¶
SetInfo sets the info string for the message, which "is morally equivalent to the Status field used by mbox readers."
This package treats info as an opaque string, but obviously it would be good for it to have a common format between implementations. See <http://cr.yp.to/proto/maildir.html> for a recomendation for common semantics.
type Maildir ¶
type Maildir string
A Maildir is simply a string pathname to where the maildir is.
func (Maildir) Acknowledge ¶
Acknowledge a newly delivered message (marking it as no longer newly delivered), and return a handle on it.
type Unique ¶
type Unique string
A Unique is a string that uniquely identifies a message in the maildir. The format of the string is opaque.
"Unless you're writing messages to a maildir, the format of a unique name is none of your business. A unique name can be anything that doesn't contain a colon (or slash) and doesn't start with a dot. Do not try to extract information from unique names." -- http://cr.yp.to/proto/maildir.html
Fortunatley for you, even if you are writing messages to a maildir, this package takes care of it, so the format of the unique name is still none of your business.