Fix sending attachments with less than 512 bytes

This commit is contained in:
Ben Burwell 2019-07-31 14:21:13 -04:00 committed by Drew DeVault
parent bb620e0900
commit c9a909fee3
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ func writeAttachment(path string, writer *mail.Writer) error {
// determine the MIME type
// http.DetectContentType only cares about the first 512 bytes
head, err := reader.Peek(512)
if err != nil {
if err != nil && err != io.EOF {
return errors.Wrap(err, "Peek")
}