unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [BUG] [PATCH] Fix appending of Received headers
@ 2011-05-17  2:10 Stewart Smith
  2011-05-24 20:33 ` Carl Worth
  0 siblings, 1 reply; 4+ messages in thread
From: Stewart Smith @ 2011-05-17  2:10 UTC (permalink / raw)
  To: notmuch

We're not properly concatenating the Received headers if we parse them
while requesting a header that isn't Received.

this fixes notmuch-reply address detection in a bunch of situations.

diff --git a/lib/message-file.c b/lib/message-file.c
index 7722832..dd0f698 100644
--- a/lib/message-file.c
+++ b/lib/message-file.c
@@ -329,7 +329,7 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,
 	/* we treat the Received: header special - we want to concat ALL of 
 	 * the Received: headers we encounter.
 	 * for everything else we return the first instance of a header */
-	if (is_received) {
+	if (strcasecmp(header, "received") == 0) {
 	    if (header_sofar == NULL) {
 		/* first Received: header we encountered; just add it */
 		g_hash_table_insert (message->headers, header, decoded_value);

-- 
Stewart Smith

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

* Re: [BUG] [PATCH] Fix appending of Received headers
  2011-05-17  2:10 [BUG] [PATCH] Fix appending of Received headers Stewart Smith
@ 2011-05-24 20:33 ` Carl Worth
  2011-06-11  0:22   ` Carl Worth
  0 siblings, 1 reply; 4+ messages in thread
From: Carl Worth @ 2011-05-24 20:33 UTC (permalink / raw)
  To: Stewart Smith, notmuch

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

On Tue, 17 May 2011 12:10:32 +1000, Stewart Smith <stewart@flamingspork.com> wrote:
> We're not properly concatenating the Received headers if we parse them
> while requesting a header that isn't Received.

Thanks, Stewart. The fix looks clearly correct.

> this fixes notmuch-reply address detection in a bunch of situations.

But can we go one step beyond "a bunch of situations"? Could you send a
message that demonstrates this bug? Or better yet, extend the
test/from-guessing test case to expose the bug?

I'd prefer to fix the test suite here so that we don't later regress on
this behavior.

Thanks,

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [BUG] [PATCH] Fix appending of Received headers
  2011-05-24 20:33 ` Carl Worth
@ 2011-06-11  0:22   ` Carl Worth
  2011-06-11  2:36     ` Stewart Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Carl Worth @ 2011-06-11  0:22 UTC (permalink / raw)
  To: Stewart Smith, notmuch

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

On Tue, 24 May 2011 13:33:25 -0700, Carl Worth <cworth@cworth.org> wrote:
> On Tue, 17 May 2011 12:10:32 +1000, Stewart Smith <stewart@flamingspork.com> wrote:
> > We're not properly concatenating the Received headers if we parse them
> > while requesting a header that isn't Received.
...
> I'd prefer to fix the test suite here so that we don't later regress on
> this behavior.

I've done that now. What the test suite was missing was having messages
that actually had more than one Received header, (otherwise, no
concatenation was ever used in the testing).

The new test and the patch are both now pushed.

Thanks again, Stewart.

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [BUG] [PATCH] Fix appending of Received headers
  2011-06-11  0:22   ` Carl Worth
@ 2011-06-11  2:36     ` Stewart Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Stewart Smith @ 2011-06-11  2:36 UTC (permalink / raw)
  To: Carl Worth, notmuch

On Fri, 10 Jun 2011 17:22:50 -0700, Carl Worth <cworth@cworth.org> wrote:
Non-text part: multipart/signed
> On Tue, 24 May 2011 13:33:25 -0700, Carl Worth <cworth@cworth.org> wrote:
> > On Tue, 17 May 2011 12:10:32 +1000, Stewart Smith <stewart@flamingspork.com> wrote:
> > > We're not properly concatenating the Received headers if we parse them
> > > while requesting a header that isn't Received.
> ...
> > I'd prefer to fix the test suite here so that we don't later regress on
> > this behavior.
> 
> I've done that now. What the test suite was missing was having messages
> that actually had more than one Received header, (otherwise, no
> concatenation was ever used in the testing).
> 
> The new test and the patch are both now pushed.

Great and thanks! Sorry I didn't manage to get updating test suite to
the top of my TODO list.

-- 
Stewart Smith

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

end of thread, other threads:[~2011-06-11  2:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17  2:10 [BUG] [PATCH] Fix appending of Received headers Stewart Smith
2011-05-24 20:33 ` Carl Worth
2011-06-11  0:22   ` Carl Worth
2011-06-11  2:36     ` Stewart Smith

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).