mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
feat: Add SMTPResponse type for extensions (#539)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -5,6 +5,15 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
// ActionDefer defers decision to built-in Inbucket logic.
|
||||
ActionDefer = iota
|
||||
// ActionAllow explicitly allows this event.
|
||||
ActionAllow
|
||||
// ActionDeny explicitly deny this event, typically with specified SMTP error.
|
||||
ActionDeny
|
||||
)
|
||||
|
||||
// AddressParts contains the local and domain parts of an email address.
|
||||
type AddressParts struct {
|
||||
Local string
|
||||
@@ -31,3 +40,10 @@ type MessageMetadata struct {
|
||||
Size int64
|
||||
Seen bool
|
||||
}
|
||||
|
||||
// SMTPResponse describes the response to an SMTP policy check.
|
||||
type SMTPResponse struct {
|
||||
Action int // ActionDefer, ActionAllow, etc.
|
||||
ErrorCode int // SMTP error code to respond with on deny.
|
||||
ErrorMsg string // SMTP error message to respond with on deny.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user