Skip to content

Commit

Permalink
Merge pull request #64 from omniboost/master
Browse files Browse the repository at this point in the history
fix: parse inbound message using `mail.ParseDate`
  • Loading branch information
mrz1836 authored Dec 2, 2024
2 parents 3882c09 + c14f09a commit c83f001
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions messages_inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package postmark
import (
"context"
"fmt"
"net/mail"
"net/url"
"time"
)
Expand Down Expand Up @@ -52,9 +53,8 @@ type InboundMessage struct {
}

// Time returns a parsed time.Time struct
// Inbound messages return as RFC1123Z strangely
func (x InboundMessage) Time() (time.Time, error) {
return time.Parse(time.RFC1123Z, x.Date)
return mail.ParseDate(x.Date)
}

// GetInboundMessage fetches a specific inbound message via serverID
Expand Down

0 comments on commit c83f001

Please sign in to comment.