From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.systemreboot.net (mugam.systemreboot.net [139.59.75.54]) by localhost (mpop-1.4.7) with POP3 for ; Thu, 23 Apr 2020 05:56:59 +0530 Return-path: Envelope-to: arunisaac@systemreboot.net Delivery-date: Thu, 23 Apr 2020 05:50:08 +0530 Received: from localhost.localdomain ([127.0.0.1] helo=[192.168.2.12]) by systemreboot.net with esmtp (Exim 4.93) (envelope-from ) id 1jRPb3-0000An-Hi for arunisaac@systemreboot.net; Thu, 23 Apr 2020 05:50:06 +0530 Received: from [192.168.2.1] (helo=sender4-of-o53.zoho.com) by systemreboot.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.93) (envelope-from ) id 1jQsBe-0002MI-Lf for guile-email@systemreboot.net; Tue, 21 Apr 2020 18:09:39 +0530 ARC-Seal: i=1; a=rsa-sha256; t=1587471862; cv=none; d=zohomail.com; s=zohoarc; b=IjKdX7x/EJUNn6x7B9Y9CqkrcM5EvOdkPsHML+1ugxA3DVNCr6jFbrq9uSWdyp34cad8H9MOkHYtC2i8SBvPbXGUs7Y3RBtQfvIfqv2uqYdbkF3yyhoBnZmTJIBx0djpWM6jctxFRT4kkB8ubAGmPeTPLK+XhBc9rnG/M7GiyCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587471862; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=zzUaiLfhAz7f3bhmsvKNAfPK/akQS10sRJkXCl1E+pM=; b=DegR4LbmUm7Nly4O9HdKSllRCAmXIufibFRiyL3h/k+/W8bBsfVkEE24ybV0RXvroQNJ9gEeDHmQdUhvOgF3Sl2umiUh/dApbdW1Sq0X5dpuWt7cR1nZ9TqCLHWR59zRohXo6oZ/lzjjjvIASgkta1TK3fIDpxpniVd8mqTHRzY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1587471862; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=zzUaiLfhAz7f3bhmsvKNAfPK/akQS10sRJkXCl1E+pM=; b=fEDLRfJ1gp9ujTiN1Wplq7N/OkdC2HHwSBBSC5OO15jE5V/1Sg+wP2nKD0ImfRnh RczPJpCEuWLuTrnzjTFoQ/7D5LIkYhJklWhOfvR4CTt5aZIEjW8/6KezX5zVuGNoBlE HkGebH7lV71nnmsnrWUFt53v85ATBEFtlnXzFKPk= Received: from localhost (p54AD4DCC.dip0.t-ipconnect.de [84.173.77.204]) by mx.zohomail.com with SMTPS id 1587471859880837.5280196375036; Tue, 21 Apr 2020 05:24:19 -0700 (PDT) User-agent: mu4e 1.2.0; emacs 26.3 From: Ricardo Wurmus To: guile-email@systemreboot.net X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Tue, 21 Apr 2020 14:24:16 +0200 Message-ID: <87k129kowf.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Zoho-Virus-Status: 2 X-ZohoMailClient: External Subject: [guile-email] =?utf-8?q?parse-email-headers_returns_just_?= =?utf-8?b?4oCcZmllbGRz4oCd?= X-BeenThere: guile-email@systemreboot.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: guile-email discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-email-bounces@systemreboot.net --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I=E2=80=99m currently trying to parse the debbugs bug log files directly. = They contain emails (and other information), so I cut out the email text and feed it to parse-email. In some cases the emails don=E2=80=99t seem to hav= e a content-transfer-encoding header, which leads to an error when trying to decode the body. So instead of using parse-email directly I use (email->headers+body (string->bytevector content "utf-8")) and run parse-email-headers over the first value, add a dummy content-transfer-encoding header with value 'binary if it=E2=80=99s missing= and then parse the body. Now I noticed two odd things: * I sometimes need to discard the first two lines of the raw email to get the headers to be fully parsed * in some cases the result of parse-email-headers is a literal =E2=80=9Cfie= lds=E2=80=9D, not an alist. Attached is one of these emails. --=20 Ricardo --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=mail.txt >From drew.adams@oracle.com Sat Sep 13 09:41:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 13 Sep 2008 16:41:10 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8DGf5S7011950 for ; Sat, 13 Sep 2008 09:41:07 -0700 Received: from mail.gnu.org ([199.232.76.166]:57008 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KeY9S-0000Yg-Bg for emacs-pretest-bug@gnu.org; Sat, 13 Sep 2008 12:39:14 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KeYBB-0004EU-3I for emacs-pretest-bug@gnu.org; Sat, 13 Sep 2008 12:41:04 -0400 Received: from agminet01.oracle.com ([141.146.126.228]:17202) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeYBA-0004Cs-4Y for emacs-pretest-bug@gnu.org; Sat, 13 Sep 2008 12:41:00 -0400 Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m8DGeoWf024917 for ; Sat, 13 Sep 2008 11:40:50 -0500 Received: from acsmt701.oracle.com (acsmt701.oracle.com [141.146.40.71]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m8DGensx018593 for ; Sat, 13 Sep 2008 10:40:50 -0600 Received: from dradamslap1 (/24.23.165.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 13 Sep 2008 09:40:49 -0700 From: "Drew Adams" To: Subject: 23.0.60; incorrect code for filesets-get-filelist Date: Sat, 13 Sep 2008 09:40:59 -0700 Message-ID: <002901c915bf$811df210$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWgg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 The part that treats a :tree of the code defining `filesets-get-filelist' is not correct and never could have been correct. And it does not correspond to the (correct) code from the filesets author. One wonders if the GNU Emacs code was ever tested. This is the `case' clause that treats :tree in the definition of `filesets-get-filelist': ((:tree) (let ((dir (nth 0 entry)) (patt (nth 1 entry))) (filesets-directory-files dir patt ':files t))) But `entry' here is a complete fileset, which is of the form ("my-fs" (:tree "/some/directory" "^.+\.suffix$")) The above code thus tries to use "my-fs" as the directory, whereas it should use "/some/directory". This is the (correct) code in the latest version from the author (http://members.a1.net/t.link/CompEmacsFilesets.html). (The comment is from the author.) ((:tree) ;;well, the way trees are handled is a mess +++ (let* ((dirpatt (if (consp (nth 1 entry)) (filesets-entry-get-tree entry) entry)) (dir (nth 0 dirpatt)) (patt (nth 1 dirpatt))) (filesets-list-dir dir patt ':files t))) However, I think the following would be sufficient: ((:tree) (let* ((dirpatt (filesets-entry-get-tree entry)) (dir (nth 0 dirpatt)) (patt (nth 1 dirpatt))) (filesets-directory-files dir patt ':files t))) I don't see why the author's more complex treatment would ever be needed, since in order for the :tree clause of the `case' to be reached (consp (nth 1 entry)) must be a cons, AFAICT. At any rate, either the author's code or what I suggest immediately above is needed. There is no way that the current GNU Emacs code can work with a :tree fileset. In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-09-03 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- guile-email mailing list guile-email@systemreboot.net https://lists.systemreboot.net/listinfo/guile-email --=-=-=--