kazu-yamamoto / Mew

Messaging in the Emacs World
http://www.mew.org/
Other
190 stars 51 forks source link

getting only one Subject: on reply #163

Closed kazu-yamamoto closed 1 year ago

kazu-yamamoto commented 1 year ago

@lemzwerg @svenha This should fix #161.

lemzwerg commented 1 year ago

This works, thanks, but it isn't complete yet: If I press 'R' instead of 'r', the 'Subject:' line in the mail body still doubles the string.

tats commented 1 year ago

Also, forwarding is still problematic. Adding workaround in mew-header-get-value may be enough.

kazu-yamamoto commented 1 year ago

mew-header-get-value is designed to correct multiple values. I think it is caller's response to select one of them. @tats What do you think?

tats commented 1 year ago

You are right, but it's just a workaround, and I think workaround in mew-header-get-value should not be problematic. I cannot imagine handling doubled subject needed.

Instead, you may add workaround to mew-summary-forward() in mew-summary3.el and mew-cite-get-value() in mew-draft.el, thouth a little complicated.

Both OK for me.

tats commented 1 year ago

Hmm, I found a similar issue when "Message-ID:" is in mew-cite-fields.

Should mew-header-get-value() collect multiple values if allowed?

kazu-yamamoto commented 1 year ago

According to RFC 5322, the following field should be one at most: orig-date, from, sender, reply-to, to, cc, bcc, message-id, in-reply-to, references, subject.

I would propose the following algorithm:

@tats What do you think?

tats commented 1 year ago

Looks fine. Please go ahead.

kazu-yamamoto commented 1 year ago

I implemented this idea and did push -f. Please check.

tats commented 1 year ago

When "Message-ID:" is in mew-cite-fields, the value is doubled.

It should be checked with case insensitive.

kazu-yamamoto commented 1 year ago

That's caller's responsibility, again. If a caller use, for example, mew-subj:, it's fine.

tats commented 1 year ago

Agreed, examples in dot.mew and mew.texi should be updated.

(setq mew-cite-fields '("From:" "Subject:" "Date:" "Message-ID:"))
kazu-yamamoto commented 1 year ago

@tats Nice catch! Done.

kazu-yamamoto commented 1 year ago

@tats May I merge this PR?

tats commented 1 year ago

Yes, let's merge this. Thank you.

kazu-yamamoto commented 1 year ago

Merged. Thank you for reviewing!

lemzwerg commented 1 year ago

Thanks for fixing this!