Still trying to fix the GH issues with MacOS' broken pipe

This commit is contained in:
Winni Neessen 2022-03-18 23:28:11 +01:00
parent 8f9fc61c1e
commit e379128c83
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D

3
msg.go
View file

@ -12,6 +12,7 @@ import (
"os"
"os/exec"
"path/filepath"
"syscall"
"time"
)
@ -532,8 +533,10 @@ func (m *Msg) WriteToSendmailWithContext(ctx context.Context, sp string, a ...st
}
_, err = m.Write(si)
if err != nil {
if !errors.Is(err, syscall.EPIPE) {
return fmt.Errorf("failed to write mail to buffer: %w", err)
}
}
// Read the stderr pipe for possible errors
var serr []byte