From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Isaac To: Christopher Baines Cc: guile-email@systemreboot.net Subject: Re: [guile-email] decoding-error crash In-Reply-To: <87woe91zv4.fsf@cbaines.net> References: <87woe91zv4.fsf@cbaines.net> Date: Mon, 16 Sep 2019 15:20:33 +0530 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > I've attached a file which should reproduce the issue. > From: ludo@gnu.org (Ludovic Court=C3=A8s) There is an encoding error in the email, specifically in the From header above. Notice the =C3=A8 in Court=C3=A8s. It should have been encoded as a "MIME-encoded word" using Quoted-Printable encoding or some other scheme. See https://en.wikipedia.org/wiki/MIME#Encoded-Word . Only ASCII characters are allowed in email headers. utf-8 characters are not allowed. guile-email sees this character whose encoding it does not understand and crashes with a decoding error. I should probably make it raise a more meaningful error. Could you provide more context for your code snippet? How does your program come by this email string? Ideally, you should handle emails only as bytevectors (or binary ports), not as strings. An email can have characters encoded using different schemes, whereas a string is constrained to have all characters encoded using the same scheme. Regards, Arun. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl1/Wu8ACgkQLiXui2GA K7PRJQf+I99s1DpeflkMCpCTIQzqCJ/3AaJzh283iWem73w/OMAziD4Vs9CN1AMM oLGxZihqYUFViQutFYcEJBon+baEUfzsUQF3Bf1MWMAYQSQD/bAkEzSJbctZBozT BV+puBmKZz861I10xfv2vluLAMD2TkXmhJj0te7Zgbn5w8/8sFL0jKYlDejHhreC JF6XxNXj5x9zlJ0g65Yc6IfHcJFH1xPTuOSNxwmnUoZ8IHBbRm2tbYn2zdWIWzBO JOdkfVRTfanGXEXEtVrU4RQ9HDnW0xO2yrg7EpCXRm9EwDRjDn3De+FmKQWwearC eC1edb9ca4DE9s6lf/zYmxPvJE39lg== =/VM3 -----END PGP SIGNATURE----- --=-=-=-- 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.5) with POP3 for ; Mon, 16 Sep 2019 15:20:53 +0530 Return-path: Envelope-to: arunisaac@systemreboot.net Delivery-date: Mon, 16 Sep 2019 15:20:42 +0530 Received: from localhost.localdomain ([127.0.0.1] helo=[192.168.2.12]) by systemreboot.net with esmtp (Exim 4.92.1) (envelope-from ) id 1i9neb-0003S2-SZ for arunisaac@systemreboot.net; Mon, 16 Sep 2019 15:20:41 +0530 Received: from [14.139.128.10] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.1) (envelope-from ) id 1i9neZ-0003Ru-NM; Mon, 16 Sep 2019 15:20:39 +0530 From: Arun Isaac To: Christopher Baines In-Reply-To: <87woe91zv4.fsf@cbaines.net> References: <87woe91zv4.fsf@cbaines.net> Date: Mon, 16 Sep 2019 15:20:33 +0530 Message-ID: MIME-Version: 1.0 Subject: Re: [guile-email] decoding-error crash 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: , Cc: guile-email@systemreboot.net Content-Type: multipart/mixed; boundary="===============3075354137986592088==" Errors-To: guile-email-bounces@systemreboot.net Message-ID: <20190916095033.qT9igDqhplKjJB6oGDkXS2ZILstcaTu7KIwJ7YmFlM0@z> --===============3075354137986592088== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > I've attached a file which should reproduce the issue. > From: ludo@gnu.org (Ludovic Court=C3=A8s) There is an encoding error in the email, specifically in the From header above. Notice the =C3=A8 in Court=C3=A8s. It should have been encoded as a "MIME-encoded word" using Quoted-Printable encoding or some other scheme. See https://en.wikipedia.org/wiki/MIME#Encoded-Word . Only ASCII characters are allowed in email headers. utf-8 characters are not allowed. guile-email sees this character whose encoding it does not understand and crashes with a decoding error. I should probably make it raise a more meaningful error. Could you provide more context for your code snippet? How does your program come by this email string? Ideally, you should handle emails only as bytevectors (or binary ports), not as strings. An email can have characters encoded using different schemes, whereas a string is constrained to have all characters encoded using the same scheme. Regards, Arun. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl1/WukACgkQLiXui2GA K7OcQgf8DVZkz5B21I4DWq4qbyhaGCigClurZw/MS3OwqKwxt19NLBJmKoqu4/1R vKokVxhjagMkPk6CBekGJ0EAsHx+Z9joCE82aM7KRo62mLcVR1z3Rbb5Fh+O3hux O2nnOvr9hGxBBpEmy+f7kGO0KtnKZkAlxkknc3IvRJgxROGK4IJAvSvS4fdLnblu GH+/peBQoLe8KbEXn2BkuMW2OhaIEVn0vHGdQAhGQmraTivvnoLaYxuFrZdcATPt 0D3fpJEConNQ8FrLxr5fgl+BiQiZmA9rW7qlYYQkzO0LWPP6u75XdrKP/XkTwl3X jq+a9DEgDjzhXjN0KP7HipoMHE+vsw== =diK+ -----END PGP SIGNATURE----- --=-=-=-- --===============3075354137986592088== 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 --===============3075354137986592088==--