mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Added "To:" header
This commit is contained in:
committed by
James Hillyerd
parent
1856deae46
commit
124f830478
@@ -36,6 +36,7 @@ type Mailbox interface {
|
||||
type Message interface {
|
||||
ID() string
|
||||
From() string
|
||||
To() string
|
||||
Date() time.Time
|
||||
Subject() string
|
||||
RawReader() (reader io.ReadCloser, err error)
|
||||
|
||||
@@ -295,6 +295,7 @@ type FileMessage struct {
|
||||
Fid string
|
||||
Fdate time.Time
|
||||
Ffrom string
|
||||
Fto string
|
||||
Fsubject string
|
||||
Fsize int64
|
||||
// These are for creating new messages only
|
||||
@@ -343,6 +344,13 @@ func (m *FileMessage) From() string {
|
||||
return m.Ffrom
|
||||
}
|
||||
|
||||
|
||||
// From returns the value of the Message From header
|
||||
func (m *FileMessage) To() string {
|
||||
return m.Fto
|
||||
}
|
||||
|
||||
|
||||
// Subject returns the value of the Message Subject header
|
||||
func (m *FileMessage) Subject() string {
|
||||
return m.Fsubject
|
||||
@@ -486,6 +494,7 @@ func (m *FileMessage) Close() error {
|
||||
|
||||
// Only public fields are stored in gob
|
||||
m.Ffrom = body.GetHeader("From")
|
||||
m.Fto = body.GetHeader("To")
|
||||
m.Fsubject = body.GetHeader("Subject")
|
||||
|
||||
// Refresh the index before adding our message
|
||||
|
||||
Reference in New Issue
Block a user