mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 18:17:03 +00:00
Track enmime API changes
- Part accessors:196b2ad725- IsTextFromHTML:2bd44ac6cc
This commit is contained in:
@@ -67,10 +67,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if .isTextFromHTML}}
|
{{with .mimeErrors}}
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
<strong>Notice:</strong> Message did not contain a plain text portion;
|
<strong>Notice:</strong> MIME parsing <u>W</u>arnings and/or <u>E</u>rrors were encountered
|
||||||
the text below was converted from HTML automatically.
|
<ul>
|
||||||
|
{{range $i, $err := .}}
|
||||||
|
<li>{{$err}}</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|||||||
@@ -180,13 +180,13 @@ func MailboxShow(w http.ResponseWriter, req *http.Request, ctx *httpd.Context) (
|
|||||||
htmlAvailable := mime.HTML != ""
|
htmlAvailable := mime.HTML != ""
|
||||||
|
|
||||||
return httpd.RenderPartial("mailbox/_show.html", w, map[string]interface{}{
|
return httpd.RenderPartial("mailbox/_show.html", w, map[string]interface{}{
|
||||||
"ctx": ctx,
|
"ctx": ctx,
|
||||||
"name": name,
|
"name": name,
|
||||||
"message": msg,
|
"message": msg,
|
||||||
"body": body,
|
"body": body,
|
||||||
"htmlAvailable": htmlAvailable,
|
"htmlAvailable": htmlAvailable,
|
||||||
"isTextFromHTML": mime.IsTextFromHTML,
|
"mimeErrors": mime.Errors,
|
||||||
"attachments": mime.Attachments,
|
"attachments": mime.Attachments,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ func MailboxViewAttach(w http.ResponseWriter, req *http.Request, ctx *httpd.Cont
|
|||||||
}
|
}
|
||||||
part := body.Attachments[num]
|
part := body.Attachments[num]
|
||||||
|
|
||||||
w.Header().Set("Content-Type", part.ContentType())
|
w.Header().Set("Content-Type", part.ContentType)
|
||||||
if _, err := io.Copy(w, part); err != nil {
|
if _, err := io.Copy(w, part); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user