Skip to content

Commit

Permalink
SMTP: Adding isMultipart to message basic metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Hinderberger committed Jun 25, 2024
1 parent 7634e45 commit 1a8d9f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,7 @@ available as JSON in the following schema:
"testsender@programmfabrik.de"
],
"idx": 0,
"isMultipart": false,
"receivedAt": "2024-06-25T14:40:11.711406798+02:00",
"to": [
"testreceiver@programmfabrik.de"
Expand All @@ -2640,6 +2641,7 @@ available as JSON in the following schema:
"testsender2@programmfabrik.de"
],
"idx": 1,
"isMultipart": true,
"receivedAt": "2024-06-25T14:40:11.711764465+02:00",
"subject": "Example Message",
"to": [
Expand All @@ -2651,6 +2653,7 @@ available as JSON in the following schema:
"testsender3@programmfabrik.de"
],
"idx": 2,
"isMultipart": false,
"receivedAt": "2024-06-25T14:40:11.711931701+02:00",
"to": [
"testreceiver3@programmfabrik.de"
Expand Down Expand Up @@ -2693,6 +2696,7 @@ the corresponding index is made available as JSON:
]
},
"idx": 1,
"isMultipart": true,
"receivedAt": "2024-06-25T14:40:11.711764465+02:00",
"subject": "Example Message",
"to": [
Expand Down
5 changes: 3 additions & 2 deletions internal/smtp/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ func retrievePart(w http.ResponseWriter, msg *ReceivedMessage, partIdx int) *Rec

func buildMessageBasicMeta(msg *ReceivedMessage) map[string]any {
out := map[string]any{
"idx": msg.Index(),
"receivedAt": msg.ReceivedAt(),
"idx": msg.Index(),
"isMultipart": msg.IsMultipart(),
"receivedAt": msg.ReceivedAt(),
}

from, ok := msg.Headers()["From"]
Expand Down

0 comments on commit 1a8d9f5

Please sign in to comment.