diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-05-25 14:24:05 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-05-25 22:22:26 +0200 |
commit | a253e89bdae6ecc101eae190a2766a7eb1e9eb33 (patch) | |
tree | 4e7ed99fa029702213352cc751e450da494b8e19 /widgets | |
parent | 57bd9e318b7073692627bd72f067633609e26883 (diff) | |
download | aerc-a253e89bdae6ecc101eae190a2766a7eb1e9eb33.tar.gz |
compose: prevent sending empty address list headers
Aerc was sending empty address list header fields (specifically CC by
default). This was causing DKIM failures in lists.sr.ht. RFC 5322 states
that an address field should consist of the field name and one or more
addresses, implying empty fields are not allowed.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/compose.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/widgets/compose.go b/widgets/compose.go index 8830d9d6..6a342d41 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -952,6 +952,10 @@ func (he *headerEditor) storeValue() { val := he.input.String() switch strings.ToLower(he.name) { case "to", "from", "cc", "bcc": + if strings.TrimSpace(val) == "" { + // Don't set empty address list headers + return + } list, err := mail.ParseAddressList(val) if err == nil { he.header.SetAddressList(he.name, list) |