1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2026-01-08 12:11:55 +00:00

More basic POP3 implementation

Filestore/Datastore now supports a Size() method.
This commit is contained in:
James Hillyerd
2013-09-10 17:56:04 -07:00
parent 338698d461
commit 983b4f745a
4 changed files with 118 additions and 45 deletions

View File

@@ -217,6 +217,14 @@ func (m *FileMessage) String() string {
return fmt.Sprintf("\"%v\" from %v", m.Fsubject, m.Ffrom)
}
func (m *FileMessage) Size() int64 {
fi, err := os.Stat(m.rawPath())
if err != nil {
return 0
}
return fi.Size()
}
func (m *FileMessage) gobPath() string {
return filepath.Join(m.mailbox.path, m.Fid+".gob")
}