propagate error from sendmail v1 PROPOSED

y0ast: 1
 propagate error from sendmail

 1 files changed, 8 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/13920/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] propagate error from sendmail Export this patch

Currently whenever the sendmail command fails, aerc has no idea and will
happily say everything is fine and copy the email to the SENT folder.
This patch adds proper error propagation and shows an error in the ui
that something has gone wrong with the send.

 commands/compose/send.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/commands/compose/send.go b/commands/compose/send.go
index dd7ece9..1e0a3ce 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -232,9 +232,16 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
			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)
		err = cmd.Wait()
		if err != nil {
			return 0, errors.Wrap(err, "cmd.Wait")
		return int(ctr.Count()), nil

This sadly breaks sending, will send an updated patch.