summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-05-25 14:24:05 -0500
committerRobin Jarry <robin@jarry.cc>2022-05-25 22:22:26 +0200
commita253e89bdae6ecc101eae190a2766a7eb1e9eb33 (patch)
tree4e7ed99fa029702213352cc751e450da494b8e19
parent57bd9e318b7073692627bd72f067633609e26883 (diff)
downloadaerc-a253e89bdae6ecc101eae190a2766a7eb1e9eb33.zip
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>
-rw-r--r--widgets/compose.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 8830d9d..6a342d4 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)