aboutsummaryrefslogtreecommitdiffstats
path: root/worker/lib
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-11-08 13:39:51 +0100
committerReto Brunner <reto@labrat.space>2020-11-14 15:40:13 +0100
commit18b0ea571aa1d76af5f250583285a072d2b64c4a (patch)
tree5176e4e2737d51cebb971baf2a606f4d52f8ef2b /worker/lib
parent256af6322b1c219b56997b37a0c69070b53bcc86 (diff)
downloadaerc-18b0ea571aa1d76af5f250583285a072d2b64c4a.tar.gz
lib/parse: use go-message msgid parsing if it succeeds
Diffstat (limited to 'worker/lib')
-rw-r--r--worker/lib/parse.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index 9fa539f7..78525d04 100644
--- a/worker/lib/parse.go
+++ b/worker/lib/parse.go
@@ -129,9 +129,13 @@ func parseEnvelope(h *mail.Header) (*models.Envelope, error) {
if err != nil {
return nil, fmt.Errorf("could not read subject: %v", err)
}
- msgID, err := h.Text("message-id")
+ msgID, err := h.MessageID()
if err != nil {
- return nil, fmt.Errorf("could not read message id: %v", err)
+ //proper parsing failed, so fall back to whatever is there
+ msgID, err = h.Text("message-id")
+ if err != nil {
+ return nil, err
+ }
}
date, err := parseDate(h)
if err != nil {