Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2369C431FC0 for ; Tue, 30 Jul 2013 08:16:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id os4WGzhm1RbQ for ; Tue, 30 Jul 2013 08:16:44 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 07A92431FBF for ; Tue, 30 Jul 2013 08:16:44 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1V4BfB-0007Z5-E3; Tue, 30 Jul 2013 16:16:42 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1V4BfB-0000QB-38; Tue, 30 Jul 2013 16:16:37 +0100 From: Mark Walters To: notmuch@notmuchmail.org Subject: Re: bug in attachment handling In-Reply-To: <87ppu0t7yf.fsf@qmul.ac.uk> References: <87ppu0t7yf.fsf@qmul.ac.uk> User-Agent: Notmuch/0.15.2+192~g8222af3 (http://notmuchmail.org) Emacs/24.2.1 (x86_64-pc-linux-gnu) Date: Tue, 30 Jul 2013 16:16:36 +0100 Message-ID: <87li4om623.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: ebe7b1d742724dfbe7e6d8e51dc3a129 (of first 20000 bytes) X-SpamAssassin-Score: 0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored 0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 15:16:50 -0000 Hi On Tue, 30 Jul 2013, Mark Walters wrote: > Hi > > I have been seeing a bug in attachment handling in recent notmuch. If a > pdf part is sent as application/octet-stream then notmuch says > [[file.pdf: application/octet-stream (as application/pdf) ] but when > viewing it with . v or the default button action (when customised to > view) it treats it as application/octet-stream. > > I think this is a regression but haven't checked yet: it probably has a > simple fix so we may want to fix it before 0.16 (users may be grumpy > about the key binding changes etc as it is!) > > I attach a pdf with this message (just a mozilla print-to-file of the > notmuch webpage) which should demonstrate the problem. I have now checked that it is a regression: 0.15 is fine and git bisect gives the first bad commit as 1546387d723ec47cd281f3c2bf6da2fddf18c045. The problem comes because we used to store the content-type with the button: it was called content-type but in the function notmuch-show-insert-part-header this was the "calculated content-type" (with declared-type being the originally declared type). Elsewhere though content-type is used for the original declared-type including where the version post 1546 above picks it up (in notmuch-show-current-part-handle). So somehow we need to get the calculated content-type into that function. I am not sure what the cleanest way to do that is so will just post this for now. Best wishes Mark