~sircmpwn/aerc

Fix in-reply-to with <> in the mailto: url. v1 PROPOSED

James Walmsley: 1
 Fix in-reply-to with <> in the mailto: url.

 1 files changed, 5 insertions(+), 0 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/16307/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Fix in-reply-to with <> in the mailto: url. Export this patch

My first experience writing to this list, I replied using the
'Reply to thread' button, and when I sent the mail it unexpectedly
created a new thread.

I found that the go-message library (SetMsgIDList()) assumes that the <>
tags are not present. So I ended up with a header like:

```
in-reply-to: <<message-id@lists...>>
```

(Perhaps this should be a patch to go-message?)

If Aerc should handle this situation then here is my proposed patch that
has solved the issue for me.

I've never used golang before, so there maybe a better way to do this
happy to be shown :)

Best

James
---
 widgets/aerc.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/widgets/aerc.go b/widgets/aerc.go
index 70bee7c..4ba7ef4 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -514,6 +514,11 @@ func (aerc *Aerc) Mailto(addr *url.URL) error {
			}
			h.SetAddressList("Cc", list)
		case "in-reply-to":
			for  i, val:= range vals {
				if(strings.HasPrefix(val, "<") && strings.HasSuffix(val, ">")) {
					vals[i] = val[1:len(val)-1]
				}
			}
			h.SetMsgIDList("In-Reply-To", vals)
		case "subject":
			subject = strings.Join(vals, ",")
--
2.25.1




Hi,
Thanks for the patch, some comments:

On Fri, Jan 01, 2021 at 06:40:40PM +0000, James Walmsley wrote: