Documentation ¶
Index ¶
Constants ¶
const MTABINARY = "sendmail"
MTABINARY sets the default MTA binary to exec when sending mail locally. sendmail is supported by sendmail and postfix
Variables ¶
This section is empty.
Functions ¶
func CreateMailFromItem ¶
CreateMailFromItem returns a Message containing the given item.
func FormatMessageBody ¶
FormatMessageBody formats the Story for better reading in a mail client.
Types ¶
type CommandRunner ¶
type CommandRunner interface { // Run([]byte) ([]byte, error) Run(from string, to []string, msg []byte) error }
CommandRunner is the interface for running an external command (to send mail).
type Dispatcher ¶
Dispatcher listens for mail Requests and sends them to the configured Sender
func CreateAndStartMailer ¶
func CreateAndStartMailer(config *config.Config) *Dispatcher
CreateAndStartMailer returns a New Dispatcher with a sender cofigured from the config file.
func CreateAndStartStubMailer ¶
func CreateAndStartStubMailer() *Dispatcher
CreateAndStartStubMailer returns a Dispatcher that will send all mail to null. For testing.
func NewDispatcher ¶
func NewDispatcher(fromAddress string, sender Sender) *Dispatcher
NewDispatcher returns a newly created Dispatcher with defaults set.
func (*Dispatcher) DispatchLoop ¶
func (d *Dispatcher) DispatchLoop()
DispatchLoop start an infinite loop listening for MailRequests and handling them.
type LocalMTASender ¶
type LocalMTASender struct {
Runner CommandRunner
}
LocalMTASender can send mail using a local binary (rather than over SMTP)
func NewLocalMTASender ¶
func NewLocalMTASender(mtaPath string) *LocalMTASender
NewLocalMTASender returns a pointer to a new LocalMTASender instance with defaults set.
type NullMailSender ¶
type NullMailSender struct {
Count int
}
NullMailSender doesn't send mail. It does record the number of times it has been called which is useful for testing.
type SMTPSender ¶
type SMTPSender struct { Hostname string Port int Username string Password string // contains filtered or unexported fields }
SMTPSender encapsualtes functionality to send mail to a SMTP server
type Sender ¶
Sender is the interface for something that can send mail. The argument is a two dimensional array of messages grouped by Feed Item. This is to allow reporting back of which items were successfully sent.
type SendmailRunner ¶
type SendmailRunner struct {
SendmailPath string
}
SendmailRunner sends email through the sendmail binary