mailbottle

package
v0.0.0-...-0b5f50f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2015 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

MailBottle is a both, a Format and a Protocol designed, to store mails in Mail-Queue and to transfer it from the SMTP daemon to the Queue daemon.

Other than LMTP, the MailBottle Protocol is designed, to have a Queue. Other than LMTP and SMTP, MailBottle is both Protocol and (on disk) Format. Other than LMTP and SMTP, MailBottle is designed to use TCP/IP efficiently by bundling more information into a single Request and by enabling Streaming transfers.

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("Not-Found")
View Source
var PollEmpty = errors.New("Poll-Empty")
View Source
var TryAgain = errors.New("Try-Again-Later")

Functions

This section is empty.

Types

type BottleInfo

type BottleInfo struct {
	From   []string
	RcptTo []string
	MIME8B bool // BODY=8BITMIME
}

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) HandleBottle

func (c *Client) HandleBottle(src io.Reader) (string, error)

func (*Client) Init

func (c *Client) Init(conn io.ReadWriteCloser)

func (*Client) PollBottle

func (c *Client) PollBottle() (bid string, f func(dst io.Writer), e error)

func (*Client) PurgeBottle

func (c *Client) PurgeBottle(bid string) error

type Handler

type Handler interface {
	HandleBottle(src io.Reader) (string, error)
	PollBottle() (bid string, f func(dst io.Writer), e error)
	PurgeBottle(bid string) error
}

type Reader

type Reader struct {
	*bufio.Reader
}

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) ReadData

func (r *Reader) ReadData(b *BottleInfo) (io.Reader, error)

type Server

type Server struct {
	H Handler
	// contains filtered or unexported fields
}

func (*Server) Init

func (s *Server) Init(c io.ReadWriteCloser)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) ServeOneRequest

func (s *Server) ServeOneRequest() (err error)

type Writer

type Writer struct {
	*bufio.Writer
	io.Closer
}

func NewPipe

func NewPipe() (*Writer, io.Reader)

func (*Writer) Close

func (w *Writer) Close() error

This function should not be used directly. See .Data().

func (*Writer) Data

func (w *Writer) Data() io.WriteCloser

Begins the Data part of the Bottle.

func (*Writer) From

func (w *Writer) From(s string)

FROM equivalent

func (*Writer) RcptTo

func (w *Writer) RcptTo(s string)

RCPT TO equivalent

func (*Writer) WriteData

func (w *Writer) WriteData(b *BottleInfo) io.WriteCloser

Sends From and RcptTo pieces of a BottleInfo object. In Follow-up it starts the data section.

Jump to

Keyboard shortcuts

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