mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-20 02:57:05 +00:00
* extension: add InboundMessage type * manager: fires BeforeMessageStored event * manager: Reacts to BeforeMessageStored event response * manager: Apply BeforeMessageStored response fields to message Signed-off-by: James Hillyerd <james@hillyerd.com>
34 lines
655 B
Go
34 lines
655 B
Go
package event
|
|
|
|
import (
|
|
"net/mail"
|
|
"time"
|
|
)
|
|
|
|
// AddressParts contains the local and domain parts of an email address.
|
|
type AddressParts struct {
|
|
Local string
|
|
Domain string
|
|
}
|
|
|
|
// InboundMessage contains the basic header and mailbox data for a message being received.
|
|
type InboundMessage struct {
|
|
Mailboxes []string
|
|
From mail.Address
|
|
To []mail.Address
|
|
Subject string
|
|
Size int64
|
|
}
|
|
|
|
// MessageMetadata contains the basic header data for a message event.
|
|
type MessageMetadata struct {
|
|
Mailbox string
|
|
ID string
|
|
From *mail.Address
|
|
To []*mail.Address
|
|
Date time.Time
|
|
Subject string
|
|
Size int64
|
|
Seen bool
|
|
}
|