mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-22 18:50:37 +01:00
Address #5
For the WriteToSendmail* methods the STDIN pipe should be closed so that a forced EOF is sent to the sending program
This commit is contained in:
parent
82cb089a8b
commit
070eb39132
1 changed files with 4 additions and 1 deletions
5
msg.go
5
msg.go
|
@ -547,7 +547,10 @@ func (m *Msg) WriteToSendmailWithContext(ctx context.Context, sp string, a ...st
|
|||
return fmt.Errorf("sendmail command failed: %s", serr)
|
||||
}
|
||||
|
||||
// Wait for completion or cancellation of the sendmail executable
|
||||
// Close STDIN and wait for completion or cancellation of the sendmail executable
|
||||
if err := si.Close(); err != nil {
|
||||
return fmt.Errorf("failed to close STDIN pipe: %w", err)
|
||||
}
|
||||
if err := ec.Wait(); err != nil {
|
||||
return fmt.Errorf("sendmail command execution failed: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue