From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oDazKu1b7F+iSwAA0tVLHw (envelope-from ) for ; Wed, 30 Dec 2020 10:52:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qH+OJu1b7F8zFQAAB5/wlQ (envelope-from ) for ; Wed, 30 Dec 2020 10:52:29 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CAD85940276 for ; Wed, 30 Dec 2020 10:52:26 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3881329D05; Wed, 30 Dec 2020 05:52:17 -0500 (EST) X-Greylist: delayed 350 seconds by postgrey-1.36 at nmbug; Wed, 30 Dec 2020 05:52:14 EST Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1DA222852E for ; Wed, 30 Dec 2020 05:52:14 -0500 (EST) Received: from mithlond (mobile-access-bceec9-217.dhcp.inet.fi [188.238.201.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 594341B00118; Wed, 30 Dec 2020 12:46:09 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1609325169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sg3A//y4uu35rNaIU+Yn+siSMQHohF4ujWWO2VHHGi0=; b=BG8mj76mjSbHqXulwhrfVoGziAAG+jBonidQHD7S/8sFqXpI9aGYhna7isb8BTndMC0lxL /ZBpgvw0ZmwYU+G/HP6Ioqu9ZUM4uO4MFOc8CC/mw2lE02U8So0S4+wyDPnmHdtbRKuIUV jLszmgmBY6aORksjSCnEjF7+D8TyGxHykuzd4UvJ3CpRsMgvPZe44NSV7o0f5qqEIWOWZ5 D9mh3TVRgXoNw7x2CR52+xXohW+GWUccGGavh/jtOk/8CQRiT/cJ/oN0PdrM1rGLL06zNt kJpFhy2FsKuz0XfHquVwQfXwAO9//lMNfef9KnC8/LKIgxzLhdxOiYWLmNYeXQ== From: Teemu Likonen To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: filtering headers from forwarded messages In-Reply-To: <874kkbulza.fsf@fifthhorseman.net> References: <877e2qbzms.fsf@fifthhorseman.net> <87eewmlzqs.fsf@iki.fi> <875zhm6kch.fsf@fifthhorseman.net> <87pnfjgnku.fsf@fifthhorseman.net> <874kkbulza.fsf@fifthhorseman.net> Date: Wed, 30 Dec 2020 12:46:02 +0200 Message-ID: <87r1n7d11x.fsf@iki.fi> MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1609325169; a=rsa-sha256; cv=none; b=HpwFhgh2T+x5DHVh9pZT53CLD4y8FeflqN4WL7sHH4R/gJcben1QN8xccdZe8P6pVREgcn vkF6MhcnYRlkjKc2sRUv0E9JDBv/Ju7jnTSiHqypE7NbPD57gygutlWVkWGTxG+xBJVE8T flxiG0fwgsqY2xBSOSA1WH/XWaxF7/dDWNbspYx/zwt6h6q9Nw5IUxokS/j7sSPczAW8xn RkbCabZDhHBxaAYup4HKShh6/xOX5rrefjYqk6lbtuRx6QayAonUfICTfR7cohCtGy23Bu OXSQ1qNrOTQ5zpSFlrRSzF2omUmT+waPuufMnWqhpNigmFtXKIx0cZymzWiBMg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1609325169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sg3A//y4uu35rNaIU+Yn+siSMQHohF4ujWWO2VHHGi0=; b=Z540/cSX5NCXl6Mf4kWR24K2jExpfNCEijfF3WAnLPY28dggecrEDE4AYO8DW6Flp1tXi9 qwy1iExv249ZVXQequjohabR6ep2WbQ6U550AIt7J5IVOspMVFMCPYRceNYeESqqTEoycd QlLDkrJIugoGZ2oq5vqncmJIhAjhff38oviSZVqoLLO1dNxTd5v1/DfZiMm3MOSSzs4+dL csagGs8aiLpla/CBAixNaEvmiKW7b93XukRDWwh317+W9TYa25FSBRt5k+8x6CDoRo6YTA Ij2LZkdnUb05jyMb7k5/8UTteL2u8X9cFf5gVlh7zQ+e/28GC0wulwx4G8UuoA== Message-ID-Hash: NYXC5Y7YRZAT4KU4VDVEW4LTYDDYWXYF X-Message-ID-Hash: NYXC5Y7YRZAT4KU4VDVEW4LTYDDYWXYF X-MailFrom: tlikonen@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============3984889724984878482==" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.36 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=BG8mj76m; arc=reject (signature check failed: fail, {[1] = sig:iki.fi:reject}); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: CAD85940276 X-Spam-Score: 0.36 X-Migadu-Scanner: scn1.migadu.com X-TUID: VsXkDgtefzaf --===============3984889724984878482== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * 2020-12-24 12:56:09-0500, Daniel Kahn Gillmor wrote: >> On Wed 2020-01-08 10:25:50 -0500, Daniel Kahn Gillmor wrote: >>> Thanks for the pointer! it looks like >>> message-forward-{ignored,included}-headers should do (roughly) what >>> i want. I'll try them out. > Hm, it now looks to me like message-forward-ignored-headers isn't > working since i upgraded to emacs 27.1. In particular, since: > > https://lists.defectivebydesign.org/archive/html/emacs-diffs/2018-04/msg0= 0135.html I don't know any automatic way to remove headers from an email message that is stored as a MIME part. When a forwarded message is stored as inline text (setq message-forward-as-mime nil) then the message is rendered at the time of composing the message. Unnecessary headers are removed, character encodings are decoded etc. When the forwarded message is stored as MIME type "message/rfc822" (setq message-forward-as-mime t) then the message is meant to be rendered by the receiver's email program which will decode all necessary headers, especially MIME headers, convert between character sets and pretty-print the message's headers and some of the MIME "text/*" parts. Filtering or editing headers of email MIME part (message/rfc822) can be tricky: there are message's main headers which tell the "Content-Type" of the body, and the body can contain different MIME parts with some of their own headers. If we filter too much or convert between character sets the message is not proper message/rfc822 part anymore and can't be rendered correctly. What about forwarding a message as MIME part which is just "text/plain" (and not "message/rfc822")? At least this can be done by setting (setq message-forward-as-mime nil) and manually inserting Emacs MML tags in the (notmuch-)message-mode buffer: C-c RET p text/plain RET or calling from Lisp code: (mml-insert-part "text/plain") The inserted MML tags need to be put manually around the forwarded message. With some hackery one could write a semi-automatic function for that. =2D-=20 /// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/ // OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCX+xaaxAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJzwE0A/3RIBq1ihs8VI95p6EuO+9uCUOuG4+KgAoXn 8Tm159gxAQD/3oP9ievwiHVJNHa5te+T9lIZfcWkyVJ4086elBFsBw== =JbGV -----END PGP SIGNATURE----- --=-=-=-- --===============3984889724984878482== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3984889724984878482==--