unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* do not inline application/* in replies
@ 2022-03-19 10:07 David Bremner
  2022-03-19 10:07 ` [PATCH 1/5] test: start corpus for attachments David Bremner
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

Since notmuch 0.24, notmuch-emacs has overriden the Gnus defaults for
inlining attachements with type "application/*" when showing
messages. This series adds some tests and applies the same override
for reply.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] test: start corpus for attachments
  2022-03-19 10:07 do not inline application/* in replies David Bremner
@ 2022-03-19 10:07 ` David Bremner
  2022-03-19 10:07 ` [PATCH 2/5] test/emacs: add regression test for display of tar attachments David Bremner
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

Initially these are to test the emacs frontend.
---
 test/corpora/attachment/x-gtar-compressed.eml | 136 ++++++++++++++++++
 1 file changed, 136 insertions(+)
 create mode 100644 test/corpora/attachment/x-gtar-compressed.eml

diff --git a/test/corpora/attachment/x-gtar-compressed.eml b/test/corpora/attachment/x-gtar-compressed.eml
new file mode 100644
index 00000000..258a74d1
--- /dev/null
+++ b/test/corpora/attachment/x-gtar-compressed.eml
@@ -0,0 +1,136 @@
+Return-path: <anarcat@orangeseeds.org>
+Envelope-to: david@tethera.net
+Delivery-date: Mon, 19 Mar 2018 13:56:54 -0400
+Received: from marcos.anarc.at ([206.248.172.91])
+	by fethera.tethera.net with esmtp (Exim 4.89)
+	(envelope-from <anarcat@orangeseeds.org>)
+	id 1exz1i-0002aa-If
+	for david@tethera.net; Mon, 19 Mar 2018 13:56:54 -0400
+Received: from [127.0.0.1] (localhost [127.0.0.1])	(Authenticated sender: anarcat)	with ESMTPSA id 718A610E04F
+From: =?utf-8?Q?Antoine_Beaupr=C3=A9?= <anarcat@orangeseeds.org>
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+In-Reply-To: <87a7v42bv9.fsf@curie.anarc.at>
+References: <87d10042pu.fsf@curie.anarc.at> <87woy8vx7i.fsf@tesseract.cs.unb.ca> <87a7v42bv9.fsf@curie.anarc.at>
+Date: Mon, 19 Mar 2018 13:56:54 -0400
+Message-ID: <874llc2bkp.fsf@curie.anarc.at>
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="=-=-="
+X-Spam_score: 0.0
+X-Spam_score_int: 0
+X-Spam_bar: /
+
+--=-=-=
+Content-Type: text/plain
+
+And obviously I forget the frigging attachment.
+
+
+--=-=-=
+Content-Type: application/x-gtar-compressed
+Content-Disposition: attachment; filename=zendesk-email-loop2.tgz
+Content-Transfer-Encoding: base64
+
+H4sIAJX1r1oAA+xbaVPbyNbO19Gv6CF1K0mBrM2SLYOY8QoGbAzegKlbVFtq28KyJNSSF269//09
+Lclm35LJTebOiARbvZw+a5+npcPIDh08EMwoED58r0uEKyeK7FPKqfc+V9cHSZFVJZeTlWz2gyjJ
+OUn9gNTvxtGdK6IhDhD6gF0cmDh8dtxr/X/Ra3Rrf0mVpaym5FQlc6orWl7P5hQpmxdzmi4qSj4D
+Y2xSkLdq7XeuwQysPWt/WZIVOba/LGqalJPA/jktJ35A4neR+MH1N7f/KQmjwOVbOBwX0A6NfN8L
+wt8Tr8iY3nSXO+OPA3tku9jhO14BpXrYTIb8Ht9mcMhViGPPSECsF0edEpPAMKuAhoE3RVNo9mhm
+1Y0+O56JnbFHQ/QHbAIZEX6kf3/hfhkskZUssLwzugUDh/biC5rb4RhV241OC9kWkrJFVZHEqqiK
+3C9DL0A7z7Czu406EdlCkoIa4ASyKOXhV0HOFZQc4sWsKKLP1UrnC+ig7eMpXx4Tc0ICvkcCantu
+AbHWIqWYUttFSiabkdBnoKLCXF7Of0Ge+1DEFakjMiNOAa1u2yEOI1pATW8LUdMLiMFLGRUF5Dqy
+QaeG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Pl9l3o1XD/N
+OL0zcJqOEY3Mj0X4FwqT0cj8WIR8exeNTGtl5CgNysG5LycFkWs+Gd/wwGkuvEoIe8mYEUvU6jXG
+jFgiafU3tjgVmGkllyXLyRm+xJwU6UuzWKLNKOYF1tr4L9kve6i8XbAi6+rss66momVkXb056vyv
+PH06h/e/Lb0b35P3v3krvP/tf1D3/yErzqX//er9f+h/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABg
+lD9gaWU0AHgAAA==
+--=-=-=
+Content-Type: text/plain
+
+
+PS: don't we have a "you forgot to actually attach the damn file" plugin
+when we detect the word "attachment" and there's no attach? :p
+
+--=-=-=--
-- 
2.35.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] test/emacs: add regression test for display of tar attachments
  2022-03-19 10:07 do not inline application/* in replies David Bremner
  2022-03-19 10:07 ` [PATCH 1/5] test: start corpus for attachments David Bremner
@ 2022-03-19 10:07 ` David Bremner
  2022-03-19 10:07 ` [PATCH 3/5] test: add known broken test for inlining in emacs/reply David Bremner
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

These should continue to display as buttons by default, even as we
update the handling for reply.
---
 test/T450-emacs-show.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh
index 057ad37e..6266ffc5 100755
--- a/test/T450-emacs-show.sh
+++ b/test/T450-emacs-show.sh
@@ -245,4 +245,26 @@ test_emacs "(test-log-error
 	        (notmuch-show \"$tid\")))"
 test_expect_equal "$(cat MESSAGES)" "COMPLETE"
 
+add_email_corpus attachment
+
+test_begin_subtest "tar not inlined by default"
+test_emacs '(notmuch-show "id:874llc2bkp.fsf@curie.anarc.at")
+	(test-visible-output "OUTPUT")'
+cat <<EOF > EXPECTED
+Antoine Beaupré <anarcat@orangeseeds.org> (2018-03-19) (attachment inbox)
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
+Date: Mon, 19 Mar 2018 13:56:54 -0400
+
+[ multipart/mixed ]
+[ text/plain ]
+And obviously I forget the frigging attachment.
+[ zendesk-email-loop2.tgz: application/x-gtar-compressed ]
+[ text/plain ]
+
+PS: don't we have a "you forgot to actually attach the damn file" plugin
+when we detect the word "attachment" and there's no attach? :p
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
-- 
2.35.1
\r

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] test: add known broken test for inlining in emacs/reply
  2022-03-19 10:07 do not inline application/* in replies David Bremner
  2022-03-19 10:07 ` [PATCH 1/5] test: start corpus for attachments David Bremner
  2022-03-19 10:07 ` [PATCH 2/5] test/emacs: add regression test for display of tar attachments David Bremner
@ 2022-03-19 10:07 ` David Bremner
  2022-03-19 10:07 ` [PATCH 4/5] emacs: factor out calculation of mm-inline-override-types David Bremner
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

The same mitigation already applied for show should also be applied
for reply
---
 test/T453-emacs-reply.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 test/T453-emacs-reply.sh

diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh
new file mode 100755
index 00000000..5d6c5309
--- /dev/null
+++ b/test/T453-emacs-reply.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+test_description="emacs reply"
+. $(dirname "$0")/test-lib.sh || exit 1
+. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1
+
+EXPECTED=$NOTMUCH_SRCDIR/test/emacs-show.expected-output
+
+test_require_emacs
+
+add_email_corpus attachment
+
+test_begin_subtest "tar not inlined by default"
+test_subtest_known_broken
+test_emacs '(notmuch-mua-new-reply "id:874llc2bkp.fsf@curie.anarc.at")
+	(test-visible-output "OUTPUT.raw")'
+cat <<EOF > EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Antoine Beaupré <anarcat@orangeseeds.org>
+Subject: Re: bug: "no top level messages" crash on Zen email loops
+In-Reply-To: <874llc2bkp.fsf@curie.anarc.at>
+Fcc: MAIL_DIR/sent
+--text follows this line--
+Antoine Beaupré <anarcat@orangeseeds.org> writes:
+
+> And obviously I forget the frigging attachment.
+>
+>
+> PS: don't we have a "you forgot to actually attach the damn file" plugin
+> when we detect the word "attachment" and there's no attach? :p
+EOF
+notmuch_dir_sanitize < OUTPUT.raw > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_done
-- 
2.35.1
\r

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] emacs: factor out calculation of mm-inline-override-types
  2022-03-19 10:07 do not inline application/* in replies David Bremner
                   ` (2 preceding siblings ...)
  2022-03-19 10:07 ` [PATCH 3/5] test: add known broken test for inlining in emacs/reply David Bremner
@ 2022-03-19 10:07 ` David Bremner
  2022-03-19 10:07 ` [PATCH 5/5] emacs/reply: restrict what mime types are inlined by default David Bremner
  2022-05-16 10:22 ` do not inline application/* in replies David Bremner
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

The intended use case of this new function is to make reply behaviour
track that of show with respect to attachments.

Also fix the glob (which worked by fluke) into the documented regexp.
---
 emacs/notmuch-lib.el  |  8 ++++++++
 emacs/notmuch-show.el | 10 ++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 6fc71cc7..1cc7e9c4 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -1037,6 +1037,14 @@ region if the region is active, or both `point' otherwise."
   'notmuch-interactive-region
   "notmuch 0.29")
 
+(defun notmuch--inline-override-types ()
+  "Override mm-inline-override-types to stop application/*
+parts from being displayed unless the user has customized
+it themselves."
+  (if (equal mm-inline-override-types
+	     (eval (car (get 'mm-inline-override-types 'standard-value))))
+      (cons "application/.*" mm-inline-override-types)
+    mm-inline-override-types))
 ;;; _
 
 (provide 'notmuch-lib)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 7c1f02c9..69f6c845 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1264,14 +1264,8 @@ matched."
   (let ((buffer-name (generate-new-buffer-name
 		      (or buffer-name
 			  (concat "*notmuch-" thread-id "*"))))
-	;; We override mm-inline-override-types to stop application/*
-	;; parts from being displayed unless the user has customized
-	;; it themselves.
-	(mm-inline-override-types
-	 (if (equal mm-inline-override-types
-		    (eval (car (get 'mm-inline-override-types 'standard-value))))
-	     (cons "application/*" mm-inline-override-types)
-	   mm-inline-override-types)))
+	(mm-inline-override-types (notmuch--inline-override-types)))
+
     (pop-to-buffer-same-window (get-buffer-create buffer-name))
     ;; No need to track undo information for this buffer.
     (setq buffer-undo-list t)
-- 
2.35.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] emacs/reply: restrict what mime types are inlined by default
  2022-03-19 10:07 do not inline application/* in replies David Bremner
                   ` (3 preceding siblings ...)
  2022-03-19 10:07 ` [PATCH 4/5] emacs: factor out calculation of mm-inline-override-types David Bremner
@ 2022-03-19 10:07 ` David Bremner
  2022-05-16 10:22 ` do not inline application/* in replies David Bremner
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-03-19 10:07 UTC (permalink / raw)
  To: notmuch

Apply the previously factored-out function used by notmuch-show.
---
 emacs/notmuch-mua.el     | 4 +++-
 test/T453-emacs-reply.sh | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index c679373b..60801f4b 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -316,7 +316,9 @@ Typically this is added to `notmuch-mua-send-hook'."
 		;; text.
 		(notmuch-show-process-crypto process-crypto)
 		;; Don't indent multipart sub-parts.
-		(notmuch-show-indent-multipart nil))
+		(notmuch-show-indent-multipart nil)
+		;; Stop certain mime types from being inlined
+		(mm-inline-override-types (notmuch--inline-override-types)))
 	     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
 	     (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
 		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh
index 5d6c5309..c26c4473 100755
--- a/test/T453-emacs-reply.sh
+++ b/test/T453-emacs-reply.sh
@@ -11,7 +11,6 @@ test_require_emacs
 add_email_corpus attachment
 
 test_begin_subtest "tar not inlined by default"
-test_subtest_known_broken
 test_emacs '(notmuch-mua-new-reply "id:874llc2bkp.fsf@curie.anarc.at")
 	(test-visible-output "OUTPUT.raw")'
 cat <<EOF > EXPECTED
-- 
2.35.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: do not inline application/* in replies
  2022-03-19 10:07 do not inline application/* in replies David Bremner
                   ` (4 preceding siblings ...)
  2022-03-19 10:07 ` [PATCH 5/5] emacs/reply: restrict what mime types are inlined by default David Bremner
@ 2022-05-16 10:22 ` David Bremner
  5 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2022-05-16 10:22 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> Since notmuch 0.24, notmuch-emacs has overriden the Gnus defaults for
> inlining attachements with type "application/*" when showing
> messages. This series adds some tests and applies the same override
> for reply.

Applied to master.

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-16 10:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19 10:07 do not inline application/* in replies David Bremner
2022-03-19 10:07 ` [PATCH 1/5] test: start corpus for attachments David Bremner
2022-03-19 10:07 ` [PATCH 2/5] test/emacs: add regression test for display of tar attachments David Bremner
2022-03-19 10:07 ` [PATCH 3/5] test: add known broken test for inlining in emacs/reply David Bremner
2022-03-19 10:07 ` [PATCH 4/5] emacs: factor out calculation of mm-inline-override-types David Bremner
2022-03-19 10:07 ` [PATCH 5/5] emacs/reply: restrict what mime types are inlined by default David Bremner
2022-05-16 10:22 ` do not inline application/* in replies David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).