Documentation

Overview

    Package maillog implements a log specifically for email.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Auth

    func Auth(netAddr net.Addr, user string, successful bool)

      Auth logs an authentication request.

      func Listening

      func Listening(a string)

        Listening logs that the daemon is listening on the given address.

        func QueueLoop

        func QueueLoop(id, from string, nextDelay time.Duration)

          QueueLoop logs that we have completed a queue loop.

          func Queued

          func Queued(netAddr net.Addr, from string, to []string, id string)

            Queued logs that we have queued an email.

            func Rejected

            func Rejected(netAddr net.Addr, from string, to []string, err string)

              Rejected logs that we've rejected an email.

              func SendAttempt

              func SendAttempt(id, from, to string, err error, permanent bool)

                SendAttempt logs that we have attempted to send an email.

                Types

                type Logger

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

                  Logger contains a backend used to log data to, such as a file or syslog. It implements various user-friendly methods for logging mail information to it.

                  var Default *Logger = New(nopCloser{ioutil.Discard})

                    Default logger, used in the following top-level functions.

                    func New

                    func New(w io.WriteCloser) *Logger

                      New creates a new Logger which will write messages to the given writer.

                      func NewFile

                      func NewFile(path string) (*Logger, error)

                        NewFile creates a new Logger which will write messages to the file at the given path.

                        func NewSyslog

                        func NewSyslog() (*Logger, error)

                          NewSyslog creates a new Logger which will write messages to syslog.

                          func (*Logger) Auth

                          func (l *Logger) Auth(netAddr net.Addr, user string, successful bool)

                            Auth logs an authentication request.

                            func (*Logger) Listening

                            func (l *Logger) Listening(a string)

                              Listening logs that the daemon is listening on the given address.

                              func (*Logger) QueueLoop

                              func (l *Logger) QueueLoop(id, from string, nextDelay time.Duration)

                                QueueLoop logs that we have completed a queue loop.

                                func (*Logger) Queued

                                func (l *Logger) Queued(netAddr net.Addr, from string, to []string, id string)

                                  Queued logs that we have queued an email.

                                  func (*Logger) Rejected

                                  func (l *Logger) Rejected(netAddr net.Addr, from string, to []string, err string)

                                    Rejected logs that we've rejected an email.

                                    func (*Logger) Reopen

                                    func (l *Logger) Reopen() error

                                      Reopen the underlying logger.

                                      func (*Logger) SendAttempt

                                      func (l *Logger) SendAttempt(id, from, to string, err error, permanent bool)

                                        SendAttempt logs that we have attempted to send an email.

                                        Source Files