[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate In-Reply-To entries in reply buffer



> > > If I use "a" in the Summary buffer it sets up a draft buffer with the
> > > In-Reply-To field already correctly set. But if I then do "C-c C-y" in
> > > the draft buffer, an extry copy of the same message id gets appended
> > > onto the In-Reply-To field.
> > > 
> > > It's possible that this has something to do with line wrapping and the
> > > unusual length of message-id's that our email system often
> > > generates.
> > 
> > The attached patch would fix handling of folded Message-ID: header.
> > But the patch is little tested (and not at all in some part).
> 
> I pushed a modified version of this patch to master @
> wanderlust/wanderlust that also implements a modified version of the
> fix for unfolding message-id suggested in
> <mid:rfwmx62teq6.wl%Don.Bashford@stjude.org>.

I think we can't simply use elmo-msgdb-get-message-id-from-buffer
instead of (std11-field-body "message-id").  Because,

1. elmo-msgdb-get-message-id-from-buffer uses elmo-unfold-field-body
(or elmo-unfold-field-body, previously), which assumes buffer is
narrrowed to the message header.

2. elmo-msgdb-get-message-id-from-buffer makes false message-id for
internal use if the message does not have Message-ID: header.  If we
reply to such message, we get false message-id in our draft.


About new elmo-msgdb-get-message-id-from-buffer;

> (defun elmo-msgdb-get-message-id-from-buffer ()
>   (let ((msgid (elmo-unfold-field-body "message-id")))
>     (if msgid
> 	(if (string-match "^[ \\t]*\\(<[^>]+>\\)[ \\t]*$" msgid)
> ...

1. regexp is wrong. "\\t" should be "\t".

2. I think we don't need to call elmo-unfold-field-body, because we
can strip '\n' in next string-match function.  I think it would be
better not using elmo-unfold-field-body for the sake of speed.

So, I think the above code can be modified equivalently as below.

(defun elmo-msgdb-get-message-id-from-buffer ()
  (let ((msgid (elmo-field-body "message-id")))
    (if msgid
	(if (string-match "^[ \t\n]*\\(<[^>]+>\\)[ \t\n]*$" msgid)
...

-- 
Kazuhiro Ito