maild

package
v0.0.0-...-a0c8ea0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2012 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Gomaild is a tiny mailserver which supports standard unencrypted (no TLS for instance) mail transfer and has no support for any mail extensions in existence. It has no relay capability and handles incoming mails only and forwards them to your very own mail handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	// The hostname from the HELO command
	Hostname string

	// Envelope Sender
	From string

	// Envelope To
	Recipients []string

	// Mailcontent, you might want parse this with
	// the net/mail package
	Data string
}

Your mail handler will get a Mail instance

func NewMail

func NewMail() *Mail

type Server

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

func NewMailServer

func NewMailServer(address string, hostname string) *Server

Creates a new mail server with given address and hostname

func (*Server) ListenAndReceive

func (s *Server) ListenAndReceive(handler func(*Mail)) error

Listens and receives forever; delivers incoming mails to your handler. ListenAndReceive handles each connection in a single Goroutine; therefore it might be a good idea to increase GOMAXPROCS for very busy servers.

Jump to

Keyboard shortcuts

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