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 16:38:06 +0530 Return-path: Envelope-to: arunisaac@systemreboot.net Delivery-date: Thu, 23 Apr 2020 12:05:16 +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 1jRVS7-0001Yi-9B; Thu, 23 Apr 2020 12:05:16 +0530 ARC-Seal: i=1; a=rsa-sha256; t=1587623708; cv=none; d=zohomail.com; s=zohoarc; b=ktSJL239Nt8tpjL6juSplhb73JDeayvXUx3jnq6qRuq1zIMHidBnEXrrGgw1C+nez0IVd2CvMzaWUnkgIyXtjz2AsQ1wukMbADIF0exIIhxsUkTx2+Z0X0JCggqaMGsPxBBoHM6SMCFIu8uCHTB0Y7Fix2rfh1fumnqLdcKRK48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587623708; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=lsTOabHnZ5lcY8GeFOowPlFv4PdHURmZipriaijkosU=; b=nv0wGl0UZOZyHKS2UYhN0LgR6q15dyaexGFn9jeUmT+5Mc/FG2NHab+cxXXzDSX8JG6C1QZNXq2yfFnb8mJxbC2p0u2OlRRkOLfG6dERHxNaSQlneRK+jW19tCWG5Tu/cYvq762DjJTdC3Q3BBTi3m51ncRJBtGfC+WgpXntj1A= 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=1587623708; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=lsTOabHnZ5lcY8GeFOowPlFv4PdHURmZipriaijkosU=; b=TQ9gt4Q+4OIOjRqJXqh7RW1nlUzUA2daPayPDs0OU/M5D02uxoOnqpfV6G3JiyrH TJwe5FZkru9wGGI7zSQe1KlVzvnGnfcAtcS7pIp7kR6jUwnftOXEuq2DWDfHy57kgZz Kj07pwB4zCcWhdiW3k5C8wi+n7/6AvF72Va+PIb8= Received: from localhost (p54AD4E51.dip0.t-ipconnect.de [84.173.78.81]) by mx.zohomail.com with SMTPS id 1587623706441434.1220267713726; Wed, 22 Apr 2020 23:35:06 -0700 (PDT) References: <87k129kowf.fsf@elephly.net> User-agent: mu4e 1.2.0; emacs 26.3 From: Ricardo Wurmus To: Arun Isaac Cc: guile-email@systemreboot.net Subject: Re: [guile-email] parse-email-headers returns just =?utf-8?B?4oCc?= =?utf-8?B?ZmllbGRz4oCd?= In-reply-to: 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: Thu, 23 Apr 2020 08:35:03 +0200 Message-ID: <875zdqlnfs.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External List-Id: Arun Isaac writes: >> In some cases the emails don=E2=80=99t seem to have a >> content-transfer-encoding header, > > This is not a problem. RFC2045 specifies that > "Content-Transfer-Encoding: 7BIT" should be assumed if the > Content-Transfer-Encoding header is not present. guile-email implements > this recommendation. Hmm, I still get this error when the first line of an email to be parsed is something like From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 11:26:37 2020 The error message is Body decoding failed. Unknown encoding #f So it fails to parse the headers correctly, ends up not finding the header specifying the encoding, and then aborts body decoding. >> * I sometimes need to discard the first two lines of the raw email to >> get the headers to be fully parsed > > Your attachment is an mbox, not a raw email. Perhaps you are treating it > as a raw email and that's why you have to chop off the first line? And, > I'm guessing your other problems are also related to this. Oh, this may be. However, I still get the same problem when I don=E2=80=99t manually discard the first line if it looks like this: From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 11:26:37 2020 I=E2=80=99m splitting the debbugs log file containing the messages and coll= ect all lines between the delimiters. I then do (parse-email (and=3D> (call-with-input-string contents mbox->emails) first)) But this will only work if I drop the first line from =E2=80=9Ccontents=E2= =80=9D. --=20 Ricardo