From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Abdul-Lateef Haji-Ali via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61041: 28.1; recipient-filename not set correctly in mml-insert-mime-headers Date: Tue, 24 Jan 2023 16:42:12 +0000 Organization: Heriot-Watt University Message-ID: Reply-To: Abdul-Lateef Haji-Ali Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22565"; mail-complaints-to="usenet@ciao.gmane.io" To: 61041@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 24 19:27:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKO10-0005eU-RD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Jan 2023 19:27:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKO0e-00012d-84; Tue, 24 Jan 2023 13:27:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKO0d-00012Q-3U for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 13:27:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKO0c-0003jS-NO for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 13:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKO0c-000456-Iu for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 13:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Abdul-Lateef Haji-Ali Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Jan 2023 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61041 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167458479815652 (code B ref -1); Tue, 24 Jan 2023 18:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jan 2023 18:26:38 +0000 Original-Received: from localhost ([127.0.0.1]:57542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKO0D-00044N-DB for submit@debbugs.gnu.org; Tue, 24 Jan 2023 13:26:38 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKMZk-0001lb-BI for submit@debbugs.gnu.org; Tue, 24 Jan 2023 11:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKMZi-0003qE-Tt for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 11:55:10 -0500 Original-Received: from mail-cwlgbr01on072c.outbound.protection.outlook.com ([2a01:111:f400:fe14::72c] helo=GBR01-CWL-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKMZg-0001yS-BY for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 11:55:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E+mQwnoCt7lWxARnDej6FDdYGN8WKw74pF2fpBBQUDIMOAPYh4a8914v2qy52YagYox7ClHjPoCnfxvqzYwGxbsODk6W5z2yPlt0K0LWny/UmI6IforjUoKj9lk913yHVmLtyZm0ff6jlGbn+OamXXfpE4Yfr6NhVcCbw/5msCdMy3EExdRy6Dmc2nDf3m/w7MPIgz66hXOmZkAVCQq5Ohck7FVJ3wox2p/lmVWpdYN0J3EL/nPCx9jq+uNDBNxJDPdATk2AkLQeifT85tQEoli60JbgGXTYrmqiR4c5aPJVU0xsvGEPRF5tapR+BvWZIagPxRio3rZTT1uDGh6Uig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rjMQfPAjqC6E3n3d7DTnZ/Yfocj8ECPEsB1K/mjccwc=; b=W4dgIhZNPPJJZlXuCVZNqNOACzjPgbnuzMceO5xfHRR4dPAeiDyQqIls3+XwVD0jfCd+n31WX8wDmFlUcTGPDTIkKNrt+ZpFl6qxgOr/0bOgPOBw5NwbbZqSfO0hr844V8n2bUwkQPDNKzy+y1JmdBM87gOUejcHC9xnDamnxaMKzdJqLwKwqafj3/YHa4/vftFcPSGk4XE670+sebHW4hTZMsgPglfi4Hij8JoUrw2fTO+6omoglsL8ILRl0KRvvqZ124l/dk2W2wTOxAqOvYhHFvZIT6NOCpWOfAMkH/QadKTo/WKjaBBT3JqWsvy1bkxLpIxpoLcOT8UzzQN3kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hw.ac.uk; dmarc=pass action=none header.from=hw.ac.uk; dkim=pass header.d=hw.ac.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heriotwatt.onmicrosoft.com; s=selector2-heriotwatt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rjMQfPAjqC6E3n3d7DTnZ/Yfocj8ECPEsB1K/mjccwc=; b=YuW1zvHHLSGpVWOu4yPmpzEZB+Cgnf3AZfX7p5Ic01Lwh707Nm9+o4G/qooEg6pbHay2ZWsLxMsck1Lek3ye+n1Gyi/eVDUFc3I7xlaB8sCAI5n2hC/so7t28gQ4ZgR47u0YboZWmD67KTQR45+RKYADp8dTrsQz29QP+3L7p5Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=hw.ac.uk; Original-Received: from LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:37e::12) by CWLP302MB0148.GBRP302.PROD.OUTLOOK.COM (2603:10a6:400:225::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 16:50:02 +0000 Original-Received: from LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM ([fe80::d95:9b8e:e399:691e]) by LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM ([fe80::d95:9b8e:e399:691e%3]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 16:50:02 +0000 X-ClientProxiedBy: LNXP265CA0081.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::21) To LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:37e::12) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO6P302MB0318:EE_|CWLP302MB0148:EE_ X-MS-Office365-Filtering-Correlation-Id: da1844c0-9d28-4d6a-4490-08dafe2b097a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oJ7jmWMCBzRxEfobSbZ2jDSHfE+DLqZ3rFh2iEdo8aOyfAwTwYOuOGd9fgb+ZrJdUDy5mK1UdDNE41H8t653nKnpb+tDDf7zmcJpeSsoP9NwWhVyR6ldgxYJQgFY7APikcegzLOZ9lEUWlqczsZ/5uP8fjlgiIpblyt+dmHdz/vz7Yk3VVHBGjnT2FFBu9UUIv27e68JKwtrPeM4ynxjHa+H7pfzP7If6Bt4mOX9euWsOqaa3iSy9/7H9qAGITzP+9TdLHIlDcd9Kt4x3/QT10jJBg1FJVezpaE4fW7q0Zki3TAWPJkeK9VyoJDnifvq81p+2R1v9fSongokslMF9YD7MmdbYLtMkG4FL7HxZEb+ovWGOCEZTXwYJzAsU4mva58QGQ37vyL74RQ+X+J6GMNuewyWU5XFlBoPzfPDXwfAUjYs+bTfsMCQsFx2DQdqVgpNDMcfSy160f9x0/EBPI3J2aCQkpov+ni0/y6o7DyRMk/k23rZ3MbvxWz48FLRMoZDKu0RV9ireM5MHMO/hbQarUZEzLBAGGr9Mqyv0EYmDRBs4x69b57096qzN2bUPEPrHw3SDTQZcWjIkc2dQWc/IngMEh5hj8oPV0ixWGp254V1Z77CaGUz1C6fLD8a//4MZXDYrMaJW/Z8A/1oJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(39860400002)(136003)(396003)(376002)(451199015)(36756003)(86362001)(786003)(2906002)(8936002)(5660300002)(41300700001)(36916002)(38100700002)(478600001)(6486002)(8676002)(4743002)(6916009)(26005)(6506007)(6512007)(66946007)(186003)(2616005)(66476007)(66556008)(316002)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jfdZHdvtiuw7Qr9fO5Y3KdlUS+rLpqUZLWt2lonXTbpwI1YDlFkxLSWNOboKL62sg8LBBfHRB3oZFH9Td1xDUNn5nVn5KNV02OLkT2/jFYzn7UpToa1T5vliVBuX7rCxGUrMN/EhvT8S7hOmJl6NK5a5DclayFKM/ytJ5Dxz33C3k/UXhIfeGtOpObArb7NKUldupIxHml1v5NSo3cNo6zSeXn0qlJ4izyrdT5kNLi+pVQQAgTqL3dQnnzUnGfqSdWoZilofTT7s1mSWTsVcV0OEcmWkK0RAY17rDGHWWhwYC79sA4lNKHD237jfzZ5fDlTNJplfZyEk0S/gEnVxNh/FRVbBiIEDSvynGQLToRYPA/sPIY8pQC8Nxwkm7iT0pVv265jiPolOCxODrQB8IkQsIVi9wdLUH5qH2widvv5KvUbYHdm/pyZXaFTNJn8IlrIMD35yJJCw3iWx+jwOUEEyMduiutA+Z2qVUnUSspOnVltzF1RbuBetq1JATxheLqKBfdSJJgQ+cgygWVFvMmQal5LAAu/dfcuIQfzn7UgQVwrr3Xe3C7Hu0Or1B3F+8zEcWGYgrsqRZ3aRkx/m06Yn8bfZF0rh90h4CM8HGHVuEw6tNkxDvWJF5LW9dK79fXftTzPbuTikS5PHPYgTOKL3isAZdrgXU2yz7pBNQqy4eV7j0aG/3mOEwc5XBOkU4a1CWnsQiikdZToOhcHwc6oXeYIdTMlugbOldnMR5uGHdYMasxfKlMxbQ/ O3fw263j8dPX24X/De5DkHDR60qaNrZxSz+CSfgpjPNgqNfXpjtwLsYFTV8SmBwrIsenO73gkwjRDtnDZ/ONCDFGn0AqiQLb3H X-OriginatorOrg: hw.ac.uk X-MS-Exchange-CrossTenant-Network-Message-Id: da1844c0-9d28-4d6a-4490-08dafe2b097a X-MS-Exchange-CrossTenant-AuthSource: LO6P302MB0318.GBRP302.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 16:50:02.3497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6c425ff2-6865-42df-a4db-8e6af634813d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SssOQQJI3YwGP+Gy+UDj6MO2jRpSIe+hErgVJb4jaE7rkkWF00WCNTWxfKSlAaUr X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP302MB0148 Received-SPF: pass client-ip=2a01:111:f400:fe14::72c; envelope-from=A.HajiAli@hw.ac.uk; helo=GBR01-CWL-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 24 Jan 2023 13:26:36 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254064 Archived-At: In the function `mml-insert-mime-headers`, the part contents (in `cont`) is tested for `recipient-filename` on mml.el:938 However, that logic is inside an if statement on non-nil `parameters` which is returned from `(mml-parameter-string cont mml-content-disposition-parameters)` The result is that if `cont` does not contain any of the fields in `mml-content-disposition-parameters`, as is the case when the part has a buffer without a file-name. The recipient-filename is not include in `Content-Disposition`. If this is unintended, as I suspect it is, it can be fixed with the following patch, for example: ------------------------------------------------------------ --- lisp/gnus/mml.el +++ lisp/gnus/mml.el @@ -924,22 +924,23 @@ (insert "\n")) (when (setq id (cdr (assq 'id cont))) (insert "Content-ID: " id "\n")) - (setq parameters - (mml-parameter-string - cont mml-content-disposition-parameters)) - (when (or (setq disposition (cdr (assq 'disposition cont))) - parameters) - (insert "Content-Disposition: " - (or disposition - (mml-content-disposition type (cdr (assq 'filename cont))))) - (when parameters - (let ((cont (copy-sequence cont))) - ;; Set the file name to what's specified by the user. - (when-let ((recipient-filename (cdr (assq 'recipient-filename cont)))) - (setcdr cont - (cons (cons 'filename recipient-filename) - (cdr cont)))) - (mml-insert-parameter-string + (let ((cont cont)) + (when-let ((recipient-filename (cdr (assq 'recipient-filename cont)))) + ;; Set the file name to what's specified by the user. + (setq cont (copy-sequence cont)) + (setcdr cont + (cons (cons 'filename recipient-filename) + (cdr cont)))) + (setq parameters + (mml-parameter-string + cont mml-content-disposition-parameters)) + (when (or (setq disposition (cdr (assq 'disposition cont))) + parameters) + (insert "Content-Disposition: " + (or disposition + (mml-content-disposition type (cdr (assq 'filename cont))))) + (when parameters + (mml-insert-parameter-string cont mml-content-disposition-parameters))) (insert "\n")) (unless (eq encoding '7bit) ------------------------------------------------------------ -- Al ________________________________ Heriot-Watt University was founded in 1821 and is a registered Scottish charity (SC000278).