Gnus development mailing list
 help / color / mirror / Atom feed
* Search for multipart/(signed|encrypted) in message-forward-make-body
@ 2006-11-09 13:49 Reiner Steib
  2006-11-10  6:40 ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2006-11-09 13:49 UTC (permalink / raw)


Hi,

in `message-forward-make-body' we have:

  (if digest
      (message-forward-make-body-digest forward-buffer)
    (if message-forward-as-mime
	(if (and message-forward-show-mml
		 (not (and (eq message-forward-show-mml 'best)
			   (with-current-buffer forward-buffer
			     (goto-char (point-min))
			     (re-search-forward
			      "Content-Type: *multipart/\\(signed\\|encrypted\\)"
			      nil t)))))
	    (message-forward-make-body-mml forward-buffer)
	  (message-forward-make-body-mime forward-buffer))
      (message-forward-make-body-plain forward-buffer)))

Shouldn't the search for multipart/(signed|encrypted) be restricted to
the headers?

--8<---------------cut here---------------start------------->8---
--- message.el	09 Nov 2006 14:45:46 +0100	7.189
+++ message.el	09 Nov 2006 14:48:17 +0100	
@@ -6798,10 +6798,12 @@
 	(if (and message-forward-show-mml
 		 (not (and (eq message-forward-show-mml 'best)
 			   (with-current-buffer forward-buffer
-			     (goto-char (point-min))
-			     (re-search-forward
-			      "Content-Type: *multipart/\\(signed\\|encrypted\\)"
-			      nil t)))))
+			     (save-restriction
+			       (mail-narrow-to-head)
+			       (goto-char (point-min))
+			       (re-search-forward
+				"Content-Type: *multipart/\\(signed\\|encrypted\\)"
+				nil t))))))
 	    (message-forward-make-body-mml forward-buffer)
 	  (message-forward-make-body-mime forward-buffer))
       (message-forward-make-body-plain forward-buffer)))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Search for multipart/(signed|encrypted) in message-forward-make-body
  2006-11-09 13:49 Search for multipart/(signed|encrypted) in message-forward-make-body Reiner Steib
@ 2006-11-10  6:40 ` Katsumi Yamaoka
  2006-11-11 21:10   ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2006-11-10  6:40 UTC (permalink / raw)


>>>>> In <v93b8senm9.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib wrote:

> in `message-forward-make-body' we have:

>   (if digest
>       (message-forward-make-body-digest forward-buffer)
>     (if message-forward-as-mime
> 	(if (and message-forward-show-mml
> 		 (not (and (eq message-forward-show-mml 'best)
> 			   (with-current-buffer forward-buffer
> 			     (goto-char (point-min))
> 			     (re-search-forward
> 			      "Content-Type: *multipart/\\(signed\\|encrypted\\)"
> 			      nil t)))))
> 	    (message-forward-make-body-mml forward-buffer)
> 	  (message-forward-make-body-mime forward-buffer))
>       (message-forward-make-body-plain forward-buffer)))

> Shouldn't the search for multipart/(signed|encrypted) be restricted to
> the headers?

I don't think so.  I tested your patch by forwarding again a
forwarded message in which the forwarded part contains non-ASCII
text and a gpg signature.  Note that the gpg signature was made
with encoded text.  Where the word *encoded* means charset
encoding and CTE (i.e., 7bit, B, or Q) encoding.

When I type `C-c C-f' in the summary buffer, I get a message
buffer with human-readable text in the body.  That's good.
However, Gnus will not necessarily use the same CTE as the one
used when the original message was sent.  Because there is no
`encoding=' tag which inherits the original CTE.  Even if they
are the same, Q encoding does not always output the same result.
So, it may destroy the consistency of the text and the signature.

Regards,



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

* Re: Search for multipart/(signed|encrypted) in message-forward-make-body
  2006-11-10  6:40 ` Katsumi Yamaoka
@ 2006-11-11 21:10   ` Reiner Steib
  2006-11-22  7:25     ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2006-11-11 21:10 UTC (permalink / raw)


On Fri, Nov 10 2006, Katsumi Yamaoka wrote:

>>>>>>	Reiner Steib wrote:
>
>> in `message-forward-make-body' we have:
>
>>   (if digest
>>       (message-forward-make-body-digest forward-buffer)
>>     (if message-forward-as-mime
>> 	(if (and message-forward-show-mml
>> 		 (not (and (eq message-forward-show-mml 'best)
>> 			   (with-current-buffer forward-buffer
>> 			     (goto-char (point-min))
>> 			     (re-search-forward
>> 			      "Content-Type: *multipart/\\(signed\\|encrypted\\)"
>> 			      nil t)))))
>> 	    (message-forward-make-body-mml forward-buffer)
>> 	  (message-forward-make-body-mime forward-buffer))
>>       (message-forward-make-body-plain forward-buffer)))
>
>> Shouldn't the search for multipart/(signed|encrypted) be restricted to
>> the headers?
>
> I don't think so.  I tested your patch by forwarding again a
> forwarded message in which the forwarded part contains non-ASCII
> text and a gpg signature.

Ah, I didn't think of this case.  Thanks for clarifying.

Wouldn't any text like "Content-Type: multipart/encrypted" in this
line give a false match?  Probably this isn't harmful because the
message body looks nice with `message-forward-make-body-mml', but
`message-forward-make-body-mime' is safer.  Is this correct?

Maybe adding a doc string and a few comments to
`message-forward-make-body' would be a good idea.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Search for multipart/(signed|encrypted) in message-forward-make-body
  2006-11-11 21:10   ` Reiner Steib
@ 2006-11-22  7:25     ` Katsumi Yamaoka
  2006-11-30  6:22       ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2006-11-22  7:25 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

>>>>> In <v9ejs9g05r.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib wrote:

>>> in `message-forward-make-body' we have:

[...]

>>> Shouldn't the search for multipart/(signed|encrypted) be restricted to
>>> the headers?

>> I don't think so.  I tested your patch by forwarding again a
>> forwarded message in which the forwarded part contains non-ASCII
>> text and a gpg signature.

> Ah, I didn't think of this case.  Thanks for clarifying.

> Wouldn't any text like "Content-Type: multipart/encrypted" in this
> line give a false match?  Probably this isn't harmful because the
> message body looks nice with `message-forward-make-body-mml', but
> `message-forward-make-body-mime' is safer.  Is this correct?

The complete version is below. :)
The new function `message-signed-or-encrypted-p' dissects the
message to forward and detects a signed or encrypted part by
rightful means.  Even if the function causes an error, Message
chooses the raw mode safely.  Could you test it?  In addition,
I'd like to install it to only the trunk if it is ok.  WDYT?


[-- Attachment #2: Type: application/emacs-lisp, Size: 2293 bytes --]

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

* Re: Search for multipart/(signed|encrypted) in message-forward-make-body
  2006-11-22  7:25     ` Katsumi Yamaoka
@ 2006-11-30  6:22       ` Katsumi Yamaoka
  2006-11-30 21:37         ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2006-11-30  6:22 UTC (permalink / raw)


>>>>> In <b4mirh8ndrx.fsf@jpl.org> Katsumi Yamaoka wrote:

> The complete version is below. :)
> The new function `message-signed-or-encrypted-p' dissects the
> message to forward and detects a signed or encrypted part by
> rightful means.  Even if the function causes an error, Message
> chooses the raw mode safely.  Could you test it?  In addition,
> I'd like to install it to only the trunk if it is ok.  WDYT?

I've committed this only in the trunk along with comments.



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

* Re: Search for multipart/(signed|encrypted) in message-forward-make-body
  2006-11-30  6:22       ` Katsumi Yamaoka
@ 2006-11-30 21:37         ` Reiner Steib
  0 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2006-11-30 21:37 UTC (permalink / raw)


On Thu, Nov 30 2006, Katsumi Yamaoka wrote:

>>>>>> In <b4mirh8ndrx.fsf@jpl.org> Katsumi Yamaoka wrote:
>
>> The complete version is below. :)
>> The new function `message-signed-or-encrypted-p' dissects the
>> message to forward and detects a signed or encrypted part by
>> rightful means.  Even if the function causes an error, Message
>> chooses the raw mode safely.  Could you test it?  

I didn't have time to test it.

>> In addition, I'd like to install it to only the trunk if it is ok.
>> WDYT?
>
> I've committed this only in the trunk along with comments.

Thanks.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2006-11-30 21:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-09 13:49 Search for multipart/(signed|encrypted) in message-forward-make-body Reiner Steib
2006-11-10  6:40 ` Katsumi Yamaoka
2006-11-11 21:10   ` Reiner Steib
2006-11-22  7:25     ` Katsumi Yamaoka
2006-11-30  6:22       ` Katsumi Yamaoka
2006-11-30 21:37         ` Reiner Steib

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 NNTP newsgroup(s).