From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Lillibridge Newsgroups: gmane.emacs.bugs Subject: bug#7746: SERIOUS BUG: mail-strip-quoted-names bug causing unrmail to lose mail Date: Mon, 27 Dec 2010 16:17:20 -0800 Message-ID: Reply-To: mark.lillibridge@hp.com NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1293495816 10548 80.91.229.12 (28 Dec 2010 00:23:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Dec 2010 00:23:36 +0000 (UTC) To: 7746@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 28 01:23:31 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PXNLd-0004uQ-1n for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Dec 2010 01:23:29 +0100 Original-Received: from localhost ([127.0.0.1]:58906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXNLc-0004ET-A2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Dec 2010 19:23:28 -0500 Original-Received: from [140.186.70.92] (port=58389 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXNLV-0004DB-6d for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:23:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXNLU-0003Hq-9u for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:23:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXNLU-0003Hm-3Y for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:23:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PXN9a-0007Ki-7x; Mon, 27 Dec 2010 19:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Lillibridge Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Dec 2010 00:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7746 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.129349504328151 (code B ref -1); Tue, 28 Dec 2010 00:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2010 00:10:43 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXN9G-0007K0-9Z for submit@debbugs.gnu.org; Mon, 27 Dec 2010 19:10:42 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PXN9E-0007Jm-Ny for submit@debbugs.gnu.org; Mon, 27 Dec 2010 19:10:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXNFo-0002Zl-NR for submit@debbugs.gnu.org; Mon, 27 Dec 2010 19:17:29 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:38286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXNFo-0002Zh-LH for submit@debbugs.gnu.org; Mon, 27 Dec 2010 19:17:28 -0500 Original-Received: from [140.186.70.92] (port=34882 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXNFn-0003Dn-J7 for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:17:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXNFm-0002ZQ-Hv for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:17:27 -0500 Original-Received: from gundega.hpl.hp.com ([192.6.19.190]:32823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXNFm-0002ZL-8K for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2010 19:17:26 -0500 Original-Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by gundega.hpl.hp.com (8.14.3/8.14.3/HPL-PA Relay) with ESMTP id oBS0HMDG010294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Dec 2010 16:17:22 -0800 Original-Received: from ts-rhel5 (ts-rhel5.hpl.hp.com [15.25.118.27]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id oBS0HKSJ006087; Mon, 27 Dec 2010 16:17:20 -0800 X-Scanned-By: MIMEDefang 2.69 on 15.0.48.190 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 27 Dec 2010 19:11:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42882 Archived-At: mail-strip-quoted-names in mail/mail-utils.el (at least version 23.1 onwards) contains the following code: mail-utils.el:187: (with-current-buffer (get-buffer-create " *temp*") (erase-buffer) ... (erase-buffer)) This code erases the buffer " *temp*" even if it is being used by another piece of code! This is particularly bad because this is the first buffer used by with-temp-buffer. A simple fix is to switch to using with-temp-buffer, which always creates and destroys a new buffer (patch at end): (with-temp-buffer ... ) This bug breaks unrmail badly, causing it to discard all messages after one containing a from line that causes that block of code to be executed (roughly, from lines that contain nested comments). This is because unrmail loads the file to be converted into a buffer created with with-temp-buffer, which is in turn erased prematurely by mail-strip-quoted-names. [There is a longer discussion about this on the developers mailing list.] As this bug causes the permanent loss of e-mail, it should probably be fixed posthaste, including in version 23. - Mark ts-rhel5 [158]% diff mail-utils.el new-mail-utils.el 187,188c187 < (with-current-buffer (get-buffer-create " *temp*") < (erase-buffer) --- > (with-temp-buffer 201,202c200 < (setq address (buffer-string)) < (erase-buffer)) --- > (setq address (buffer-string)))