mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
fix parsing dmarc reports that come with content-type application/octet-stream
by fixing a typo in the content-type... and by recognizing the application/x-zip that is detected as content-type. discovered when a dmarc report from aws ses wasn't processed. it seems aws ses was sending a dmarc report because it received a dmarc report.
This commit is contained in:
parent
3a7ed9738a
commit
c955fadb6d
1 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ func parseReport(p message.Part) (*Feedback, error) {
|
|||
r := p.Reader()
|
||||
|
||||
// If no (useful) content-type is set, try to detect it.
|
||||
if ct == "" || ct == "application/octect-stream" {
|
||||
if ct == "" || ct == "application/octet-stream" {
|
||||
data := make([]byte, 512)
|
||||
n, err := io.ReadFull(r, data)
|
||||
if err == io.EOF {
|
||||
|
@ -92,7 +92,7 @@ func parseReport(p message.Part) (*Feedback, error) {
|
|||
case "application/zip":
|
||||
// Google sends messages with direct application/zip content-type.
|
||||
return parseZip(r)
|
||||
case "application/gzip":
|
||||
case "application/gzip", "application/x-gzip":
|
||||
gzr, err := gzip.NewReader(r)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decoding gzip xml report: %s", err)
|
||||
|
|
Loading…
Reference in a new issue