From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46937 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.gnus.general Subject: Format=flowed & QP Date: Thu, 03 Oct 2002 04:28:25 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1033612307 21526 127.0.0.1 (3 Oct 2002 02:31:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 3 Oct 2002 02:31:47 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17wvmC-0005au-00 for ; Thu, 03 Oct 2002 04:31:44 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17wvlo-0003Jq-00; Wed, 02 Oct 2002 21:31:20 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 02 Oct 2002 21:32:01 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id VAA01613 for ; Wed, 2 Oct 2002 21:31:49 -0500 (CDT) Original-Received: (qmail 8955 invoked by alias); 3 Oct 2002 02:31:04 -0000 Original-Received: (qmail 8950 invoked from network); 3 Oct 2002 02:31:03 -0000 Original-Received: from pfepb.post.tele.dk (193.162.153.3) by gnus.org with SMTP; 3 Oct 2002 02:31:03 -0000 Original-Received: from defun.localdomain (0xc3f9528d.esnxr1.ras.tele.dk [195.249.82.141]) by pfepb.post.tele.dk (Postfix) with ESMTP id 75FE95EEF45 for ; Thu, 3 Oct 2002 04:30:52 +0200 (CEST) Original-To: ding@gnus.org Original-Lines: 40 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-redhat-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46937 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46937 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable There's a bug when you enable format=3Dflowed in QP-encoded messages. With soft newlines this message: ------------------------------------------------------------ Subject: test Gcc: nnml+archive:misc-mail From: Jesper Harder --text follows this line-- 1234567890 1234567890 123456789 01234567890 0123456789 =C3=A6lsdkfj =C3=A6a= sdlfkj =CE=B1 ------------------------------------------------------------ Gets encoded like this: ------------------------------------------------------------ MIME-Version: 1.0 Content-Type: text/plain; charset=3Dutf-8; format=3Dflowed Content-Transfer-Encoding: quoted-printable 1234567890 1234567890 123456789 01234567890 0123456789=20 =3DC3=3DA6lsdkfj =3DC3=3DA6a=3D sdlfkj =3DCE=3DB1 ------------------------------------------------------------ Note the "a=3D ", which is malformed QP. I think the problem is that `fill-flowed-encode' is applied *after* QP-encoding (which I don't think is the right order). Reversing that order seems to fix it=C2=B9. But maybe we shouldn't flow te= xt at all unless the CTE is 8bit or 7bit? (because QP supports soft linebreaks without f=3Df). =C2=B9 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=mml.el.diff --- /home/harder/gnus/lisp/mml.el Wed Sep 4 03:55:14 2002 +++ mml.el Thu Oct 3 04:23:49 2002 @@ -431,26 +431,26 @@ ;; ignore 0x1b, it is part of iso-2022-jp (setq encoding (mm-body-7-or-8)))) (t + ;; Only perform format=flowed filling on text/plain + ;; parts where there either isn't a format parameter + ;; in the mml tag or it says "flowed" and there + ;; actually are hard newlines in the text. + (let (use-hard-newlines) + (when (and (string= type "text/plain") + (or (null (assq 'format cont)) + (string= (cdr (assq 'format cont)) + "flowed")) + (setq use-hard-newlines + (text-property-any + (point-min) (point-max) 'hard 't))) + (fill-flowed-encode) + ;; Indicate that `mml-insert-mime-headers' should + ;; insert a "; format=flowed" string unless the + ;; user has already specified it. + (setq flowed (null (assq 'format cont))))) (setq charset (mm-encode-body charset)) (setq encoding (mm-body-encoding charset (cdr (assq 'encoding cont)))))) - ;; Only perform format=flowed filling on text/plain - ;; parts where there either isn't a format parameter - ;; in the mml tag or it says "flowed" and there - ;; actually are hard newlines in the text. - (let (use-hard-newlines) - (when (and (string= type "text/plain") - (or (null (assq 'format cont)) - (string= (cdr (assq 'format cont)) - "flowed")) - (setq use-hard-newlines - (text-property-any - (point-min) (point-max) 'hard 't))) - (fill-flowed-encode) - ;; Indicate that `mml-insert-mime-headers' should - ;; insert a "; format=flowed" string unless the - ;; user has already specified it. - (setq flowed (null (assq 'format cont))))) (setq coded (buffer-string))) (mml-insert-mime-headers cont type charset encoding flowed) (insert "\n") --=-=-=--