maildir

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package maildir provide a library to manage email using maildir format.

References

[1] http://www.qmail.org/qmail-manual-html/man5/maildir.html

[2] https://cr.yp.to/proto/maildir.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manage email in a directory.

func New

func New(dir string) (mg *Manager, err error)

New create new maildir Manager in directory and initialize the hostname, pid, and counter for generating unique name.

func (*Manager) Delete

func (mg *Manager) Delete(fname string) (err error)

Delete email file in "cur".

func (*Manager) DeleteOutQueue

func (mg *Manager) DeleteOutQueue(fname string) (err error)

DeleteOutQueue delete temporary file in send queue.

func (*Manager) Get

func (mg *Manager) Get(fname string) (err error)

Get will move email from "new" to "cur".

func (*Manager) Incoming

func (mg *Manager) Incoming(email []byte) (err error)

Incoming save incoming message, from external MTA, in directory "${dir}/tmp/${unique}". Upon success, hard link it to "${dir}/new/${unique}" and delete the temporary file.

func (*Manager) OutQueue

func (mg *Manager) OutQueue(email []byte) (err error)

OutQueue save the email in temporary queue directory before sending it to external MTA or processed.

When mail is coming from MUA and received by server, the mail need to be successfully stored into disk by server, before replying with "250 OK" to client.

func (*Manager) RemoveAll

func (mg *Manager) RemoveAll(dir string)

RemoveAll remove all files inside a directory.

Jump to

Keyboard shortcuts

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