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

5
msg.go
View file

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