~sircmpwn/aerc

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

[PATCH] Fix notmuch "mail: no address" message list

Tamás Gulácsi
Details
Message ID
<20200902122534.1953413-1-tamas@gulacsi.eu>
DKIM signature
missing
Download raw message
Patch: +6 -2
lib/format#ParseAddress needs the same empty address handling as ParseAddressList.
Also, provide more verbose error message in the UI.

Signed-off-by: Tamás Gulácsi <tamas@gulacsi.eu>
---
 lib/format/format.go | 6 +++++-
 widgets/msglist.go   | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/format/format.go b/lib/format/format.go
index 0eda7ae..ae9b411 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -2,6 +2,7 @@ package format

import (
	"errors"
	"fmt"
	"mime"
	gomail "net/mail"
	"strings"
@@ -13,9 +14,12 @@ import (
)

func ParseAddress(address string) (*models.Address, error) {
	if address == "" {
		return nil, nil
	}
	addrs, err := gomail.ParseAddress(address)
	if err != nil {
		return nil, err
		return nil, fmt.Errorf("parse %q: %w", address, err)
	}
	return (*models.Address)(addrs), nil
}
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 09b0868..6eb0c4d 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -154,7 +154,7 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
			uiConfig.IndexFormat,
			uiConfig.TimestampFormat, "", i, msg, store.IsMarked(uid))
		if err != nil {
			ctx.Printf(0, row, style, "%v", err)
			ctx.Printf(0, row, style, "ERROR: %+v", err)
		} else {
			line := fmt.Sprintf(fmtStr, args...)
			line = runewidth.Truncate(line, textWidth, "…")
-- 
2.28.0
Details
Message ID
<cat75ahMfa33C_61lcGtEFkYtogUxlYYoaKZgloOFiRb4AamC--niLQYaXJByS-1Be1Rq9PjC894FNuopQL_B9mp_rT5KwOr474gQh04fD0=@emersion.fr>
In-Reply-To
<20200902122534.1953413-1-tamas@gulacsi.eu> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
I'm not sure about this. Returning nil, nil is a little misleading.

An empty address list is fine, but when the RFC says a field contains a
single address, I don't think it's valid to put an empty string?

Also this doesn't account for CFWS (comments and white-space).
Review patch Export thread (mbox)