unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* changing behaviour of notmuch show --part=1
@ 2017-05-22 10:32 David Bremner
  2017-05-22 21:06 ` Daniel Kahn Gillmor
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2017-05-22 10:32 UTC (permalink / raw)
  To: notmuch, notmuch

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


The current behaviour of "notmuch show --part=1 --raw" is somewhat
peculiar. This is supposed to be the message body, but if the message is
multipart, it also includes the headers. This seems to be a direct
translation of an implimentation of quirk of gmime. In gmime 3.0 this
quirk goes away, and the behaviour of notmuch consequently changes,
unless we do something about it. I actually think the new behaviour
makes more sense (you only get the headers with part=0). There seem to
be several options

1) Bug-for-Bug-compatibility: Add special case code for gmime-3.0 to
   output headers.

2) Allow-varying-output: Consider the previous behaviour a bug, fixed by
   using gmime-3.0.  This makes it hard for people to rely on, although
   how one relies on it currently since it varies by message is a
   mystery.

3) Fix the alleged bug: special case the output of the body with
   gmime-2.6 to avoid outputting headers.

d

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

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

* Re: changing behaviour of notmuch show --part=1
  2017-05-22 10:32 changing behaviour of notmuch show --part=1 David Bremner
@ 2017-05-22 21:06 ` Daniel Kahn Gillmor
  2017-05-23 11:17   ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kahn Gillmor @ 2017-05-22 21:06 UTC (permalink / raw)
  To: David Bremner, notmuch, notmuch

On Mon 2017-05-22 07:32:17 -0300, David Bremner wrote:
> The current behaviour of "notmuch show --part=1 --raw" is somewhat
> peculiar. This is supposed to be the message body, but if the message is
> multipart, it also includes the headers. This seems to be a direct
> translation of an implimentation of quirk of gmime. In gmime 3.0 this
> quirk goes away, and the behaviour of notmuch consequently changes,
> unless we do something about it. I actually think the new behaviour
> makes more sense (you only get the headers with part=0). There seem to
> be several options
>
> 1) Bug-for-Bug-compatibility: Add special case code for gmime-3.0 to
>    output headers.
>
> 2) Allow-varying-output: Consider the previous behaviour a bug, fixed by
>    using gmime-3.0.  This makes it hard for people to rely on, although
>    how one relies on it currently since it varies by message is a
>    mystery.
>
> 3) Fix the alleged bug: special case the output of the body with
>    gmime-2.6 to avoid outputting headers.

i favor (2) for the short term, while treating (3) as an open bug to be
fixed.

thanks for identifying this, David.

       --dkg

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

* Re: changing behaviour of notmuch show --part=1
  2017-05-22 21:06 ` Daniel Kahn Gillmor
@ 2017-05-23 11:17   ` David Bremner
  0 siblings, 0 replies; 3+ messages in thread
From: David Bremner @ 2017-05-23 11:17 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch, notmuch

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

>>
>> 2) Allow-varying-output: Consider the previous behaviour a bug, fixed by
>>    using gmime-3.0.  This makes it hard for people to rely on, although
>>    how one relies on it currently since it varies by message is a
>>    mystery.
>>
>> 3) Fix the alleged bug: special case the output of the body with
>>    gmime-2.6 to avoid outputting headers.
>
> i favor (2) for the short term, while treating (3) as an open bug to be
> fixed.
>
> thanks for identifying this, David.
>
>        --dkg

(2) is essentially implimented by

    id:20170523005351.15431-3-david@tethera.net

Jeff Stedfast wrote the following code for (3) on the gmime-devel list;
it needs to be conditionalized on GMIME_MAJOR_VERSION, and tested.

,----
| 
|  This is a bit of a hack, but...
| 
|  cache = g_mime_header_list_get_stream (object->headers);
|  g_object_ref (cache);
|  g_mime_header_list_set_stream (object->headers, NULL);
| 
|  g_mime_object_write_to_stream (object, ostream);
| 
|  g_mime_header_list_set_stream (object->headers, cache);
|  g_object_unref (cache);
| 
`----

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

end of thread, other threads:[~2017-05-23 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 10:32 changing behaviour of notmuch show --part=1 David Bremner
2017-05-22 21:06 ` Daniel Kahn Gillmor
2017-05-23 11:17   ` 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).