From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55373 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: Trailing whitespace and PGP/MIME Date: Tue, 30 Dec 2003 12:05:51 +0100 Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1072782369 26950 80.91.224.253 (30 Dec 2003 11:06:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2003 11:06:09 +0000 (UTC) Original-X-From: ding-owner+M3913@lists.math.uh.edu Tue Dec 30 12:06:06 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AbHhO-0002YX-00 for ; Tue, 30 Dec 2003 12:06:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AbHhI-000654-00; Tue, 30 Dec 2003 05:06:00 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AbHhE-00064z-00 for ding@lists.math.uh.edu; Tue, 30 Dec 2003 05:05:56 -0600 Original-Received: from yxa.extundo.com (178.230.13.217.in-addr.dgcsystems.net [217.13.230.178]) by justine.libertine.org (Postfix) with ESMTP id A5D593A0036 for ; Tue, 30 Dec 2003 05:05:53 -0600 (CST) Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.10/8.12.10) with ESMTP id hBUB5qAU020796 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 30 Dec 2003 12:05:52 +0100 Original-To: ding@gnus.org Mail-Copies-To: nobody X-Hashcash: 0:031230:ding@gnus.org:7093a3d37af3d581 In-Reply-To: (Jesper Harder's message of "Tue, 30 Dec 2003 03:15:43 +0100") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55373 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55373 Jesper Harder writes: > Currently Gnus violates this requirement in RFC 3156 (MIME Security > with OpenPGP): > > implementations MUST make sure that no trailing whitespace is > present after the MIME encoding has been applied. > > Fixing it the obvious way would, however, break the intention of this > change: > > 2003-10-27 Simon Josefsson > > * mm-bodies.el (mm-body-encoding): Don't use QP when message body > only consists of short lines and ASCII, when > mm-use-ultra-safe-encoding. Refer to 'About foo' thread in > gnus-bug, e.g. , for more discussion. > This make it possible to pipe the raw RFC 822 message into 'gpg' > and have the signature work. Potential problem: what if message > contain data that would be dash-escaped by OpenPGP > implementations? Then PGP 2.x might not be able to parse the raw > RFC 822 message correctly. If that problem is worth fixing, it > should be fixed by detecting the situation, instead of applying QP > to everything. Based on discussion with "John A. Martin" > . I think detecting if there are trailing SPC, and using QP in that case is reasonable. Does this work? --- mm-bodies.el.~6.29.~ 2003-12-26 06:32:11.000000000 +0100 +++ mm-bodies.el 2003-12-30 12:05:33.000000000 +0100 @@ -132,7 +132,8 @@ (cond ((and (not longp) (not (and mm-use-ultra-safe-encoding - (save-excursion (re-search-forward "^From " nil t)))) + (save-excursion (or (re-search-forward "^From " nil t) + (re-search-forward " $" nil t))))) (eq bits '7bit)) bits) ((and (not mm-use-ultra-safe-encoding)