mirror of
https://github.com/axllent/mailpit.git
synced 2025-07-17 01:32:33 +02:00
Feature: Add Message-Id to MessageSummary (#116)
This commit is contained in:
@ -321,7 +321,7 @@ func List(start, limit int) ([]MessageSummary, error) {
|
|||||||
results := []MessageSummary{}
|
results := []MessageSummary{}
|
||||||
|
|
||||||
q := sqlf.From("mailbox").
|
q := sqlf.From("mailbox").
|
||||||
Select(`Created, ID, Subject, Metadata, Size, Attachments, Read, Tags`).
|
Select(`Created, ID, MessageID, Subject, Metadata, Size, Attachments, Read, Tags`).
|
||||||
OrderBy("Created DESC").
|
OrderBy("Created DESC").
|
||||||
Limit(limit).
|
Limit(limit).
|
||||||
Offset(start)
|
Offset(start)
|
||||||
@ -329,6 +329,7 @@ func List(start, limit int) ([]MessageSummary, error) {
|
|||||||
if err := q.QueryAndClose(nil, db, func(row *sql.Rows) {
|
if err := q.QueryAndClose(nil, db, func(row *sql.Rows) {
|
||||||
var created int64
|
var created int64
|
||||||
var id string
|
var id string
|
||||||
|
var messageID string
|
||||||
var subject string
|
var subject string
|
||||||
var metadata string
|
var metadata string
|
||||||
var size int
|
var size int
|
||||||
@ -354,6 +355,7 @@ func List(start, limit int) ([]MessageSummary, error) {
|
|||||||
|
|
||||||
em.Created = time.UnixMilli(created)
|
em.Created = time.UnixMilli(created)
|
||||||
em.ID = id
|
em.ID = id
|
||||||
|
em.MessageID = messageID
|
||||||
em.Subject = subject
|
em.Subject = subject
|
||||||
em.Size = size
|
em.Size = size
|
||||||
em.Attachments = attachments
|
em.Attachments = attachments
|
||||||
|
@ -69,6 +69,8 @@ type Attachment struct {
|
|||||||
type MessageSummary struct {
|
type MessageSummary struct {
|
||||||
// Database ID
|
// Database ID
|
||||||
ID string
|
ID string
|
||||||
|
// Message ID
|
||||||
|
MessageID string
|
||||||
// Read status
|
// Read status
|
||||||
Read bool
|
Read bool
|
||||||
// From address
|
// From address
|
||||||
|
Reference in New Issue
Block a user