Documentation
¶
Index ¶
Constants ¶
const DefaultAddr = "0.0.0.0"
DefaultAddr is the default address the server is listening on
const DefaultPort = "10005"
DefaultPort is the default port the server is listening on
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents an incoming policy server connection
type CtxKey ¶
type CtxKey int
CtxKey represents the different key ids for values added to contexts
const ( // CtxNoLog lets the user control wether the server should log to // STDERR or not CtxNoLog CtxKey )
type Handler ¶
type Handler interface {
Handle(*PolicySet) PostfixResp
}
Handler interface for handling incoming policy requests and returning the corresponding action
type PolicySet ¶
type PolicySet struct {
// Postfix version 2.1 and later
Request string
ProtocolState string
ProtocolName string
HELOName string
QueueId string
Sender string
Recipient string
RecipientCount uint64
ClientAddress net.IP
ClientName string
ReverseClientName string
Instance string
// Postfix version 2.2 and later
SASLMethod string
SASLUsername string
SASLSender string
Size uint64
CCertSubject string
CCertIssuer string
CCertFingerprint string
// Postfix version 2.3 and later
EncryptionProtocol string
EncryptionCipher string
EncryptionKeysize uint64
ETRNDomain string
// Postfix version 2.5 and later
Stress bool
// Postfix version 2.9 and later
CCertPubkeyFingerprint string
// Postfix version 3.0 and later
ClientPort uint64
// Postfix version 3.1 and later
PolicyContext string
// Postfix version 3.2 and later
ServerAddress net.IP
ServerPort uint64
// postfix-policy-server specific values
PPSConnId string
}
PolicySet is a set information provided by the postfix policyd request
type PostfixResp ¶
type PostfixResp string
PostfixResp is a possible response value for the policy request
const ( RespOk PostfixResp = "OK" RespReject PostfixResp = "REJECT" RespDefer PostfixResp = "DEFER" RespDeferIfReject PostfixResp = "DEFER_IF_REJECT" RespDeferIfPermit PostfixResp = "DEFER_IF_PERMIT" RespDiscard PostfixResp = "DISCARD" RespDunno PostfixResp = "DUNNO" RespHold PostfixResp = "HOLD" RespInfo PostfixResp = "INFO" RespWarn PostfixResp = "WARN" )
Possible responses to the postfix server See: http://www.postfix.org/access.5.html
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines a new policy server with corresponding settings
func (*Server) RunWithListener ¶ added in v0.1.2
RunWithListener starts a server based on the Server object with a given network listener