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

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



At Sat, 21 Jul 2012 17:15:19 +0900,
Kazuhiro Ito wrote:
> 
> > > 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.

Good point.

> 
> 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.

I would take the opposite perspective: We should expect the weirdest
and craziest mail headers of past, current, and future mail
clients. There is not reason for me to take standard compliance for
granted or to trust mail client providers that they will do the right
thing™ and/or don't abuse mail headers for power struggles or
whatever. Be as strict as possible and only relax strictness if there
is an important reason to do so.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

Attachment: pgp50dFJoK7fM.pgp
Description: OpenPGP Digital Signature