~sircmpwn/aerc

42ce6b41ff7ff56f89de25e4807ab30c6eef4662 — y0ast 9 months ago 8bf100f
propagate error from sendmail
1 files changed, 9 insertions(+), 2 deletions(-)

M commands/compose/send.go
M commands/compose/send.go => commands/compose/send.go +9 -2
@@ 231,10 231,17 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
		if err != nil {
			return 0, errors.Wrap(err, "cmd.StdinPipe")
		}
		defer wc.Close()
		go cmd.Run()
		err = cmd.Start()
		if err != nil {
			return 0, errors.Wrap(err, "cmd.Start")
		}
		ctr := datacounter.NewWriterCounter(wc)
		composer.WriteMessage(header, ctr)
		wc.Close() // force close to make sendmail send
		err = cmd.Wait()
		if err != nil {
			return 0, errors.Wrap(err, "cmd.Wait")
		}
		return int(ctr.Count()), nil
	}