This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH v2] propagate error from sendmail

Message ID
DKIM signature
Download raw message
Patch: +9 -2
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. It also fixes the problem
with sending of the previous patch by force closing the pipe and making
sendmail send.

 commands/compose/send.go | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/commands/compose/send.go b/commands/compose/send.go
index dd7ece9..abbcb54 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -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

Message ID
<20200920215344.8863-1-joost@joo.st> (view parent)
DKIM signature
Download raw message
Merged to master, thanks!

Reply to thread Export thread (mbox)