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

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



> > Sorry, regexp should be exactly "\\`[ \t\n]*\\(<[^>]+>\\)[ \t\n]*$\\'".
> > I don't know how strict that function should be, I feel that function
> > could be loose as below;
> >
> >  (defun elmo-msgdb-get-message-id-from-buffer ()
> >   (let ((msgid (elmo-field-body "message-id")))
> >     (if msgid
> >       (if (string-match "<.+>" msgid)
> >           (match-string 0 msgid)
> 
> I agree, but maybe that simpler regex could be "<[^>\n]+>" to guard
> against things like "<foo> <bar>" by only taking the first one.

I think that extracting "<foo>" from "<foo> <bar>" wouldn't be better.
Beacuse, there would be a problem when regexp extracts existing
Message-ID from invalid header.  If "<foo>" is existing Message-ID,
wl-summary-jump-to-msg-by-message-id may pick the wrong message.

I think "\\`[ \t\n]*\\(<.+>\\)[ \t\n]*$\\'" is the most safe to avoid
the above problem.  But I doubt whether the above problem actually
occurs, because I couldn't imagine recent programs create such insane
Message-ID: header.  So, I feel the most loose "<.+>" whould be
adequate.

-- 
Kazuhiro Ito