This patch implements "via" aliases, which let us explicitly select a server to use for delivery. This feature is useful in different scenarios, such as a secondary MX server that forwards all incoming email to a primary. For now, it is experimental and the syntax and semantics are subject to change.
17 lines
643 B
Go
17 lines
643 B
Go
// Package courier implements various couriers for delivering messages.
|
|
package courier
|
|
|
|
// Courier delivers mail to a single recipient.
|
|
// It is implemented by different couriers, for both local and remote
|
|
// recipients.
|
|
type Courier interface {
|
|
// Deliver mail to a recipient. Return the error (if any), and whether it
|
|
// is permanent (true) or transient (false).
|
|
Deliver(from string, to string, data []byte) (error, bool)
|
|
|
|
// Forward mail using the given servers.
|
|
// Return the error (if any), and whether it is permanent (true) or
|
|
// transient (false).
|
|
Forward(from string, to string, data []byte, servers []string) (error, bool)
|
|
}
|