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

Re: Problems finding and storing Message-ID



Thanks!

The patch you sent works, but I've come up with a solution I think is
a little more general. It uses the already-existing unfolding function
in elmo utils, and it won't fail due to superfluous white space before
or after the "<xxx@xxx>".

-Don

--- elmo-util.el.old    2011-07-17 12:17:13.000000000 -0500
+++ elmo-util.el        2012-04-24 15:21:43.053090000 -0500
@@ -2243,10 +2243,10 @@
                   (buffer-substring beg (point)) "\n[ \t]*" ""))))))))

 (defun elmo-msgdb-get-message-id-from-buffer ()
-  (let ((msgid (elmo-field-body "message-id")))
+  (let ((msgid (elmo-unfold-field-body "message-id")))
     (if msgid
-       (if (string-match "<\\(.+\\)>$" msgid)
-           msgid
+       (if (string-match "^[ \\t]*\\(<.+>\\)[ \\t]*$" msgid)
+           (substring msgid (match-beginning 1) (match-end 1))
          (concat "<" msgid ">"))       ; Invaild message-id.
       ;; no message-id, so put dummy msgid.
       (concat "<"



At Tue, 24 Apr 2012 04:26:50 -0500,
Kazuhiro Ito wrote:
>
> [1  <text/plain; us-ascii (quoted-printable)>]
> Hi,
>
> > In some of the messages stored in the MH folder, the message ID field
> > has a "\n " just ahead of the message ID, and in some it does not, so
> > what's in the msgid database might or might not be the same as what
> > comes after "Message ID: " in the email header. For short message ID's
> > everything is okay, as far as I can tell.
>
> If Message-ID: header consists of multiple lines, the problem you
> described would occur.  For example, below header raises the problem,
>
> Message-ID:
>  <D456FE7EBDBD6047A4373F930BED54D44E68617C37@SJMEMXMBS10.stjude.sjcrh.local>
>
> And, below header doesn't.
>
> Message-ID: <D456FE7EBDBD6047A4373F930BED54D44E68617C37@SJMEMXMBS10.stjude.sjcrh.local>
>
> Please try attached patch and re-build message database (s all RET
> in summary buffer).
>
> --
> Kazuhiro Ito
> [2 wl.diff <application/octet-stream (base64)>]
>

Email Disclaimer:  www.stjude.org/emaildisclaimer