-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.2.13 changes the behavior of g_mime_message_get_addresses
when more than one Cc
header exists.
#129
Comments
So i see two ways that we can deal with this:
I'm not sure what the correct approach is. I don't know how many messages in existence carry this particular quirky violation of the standard. And i don't know how else to interpret such a message -- i mean, which |
Attached are two simple test files: if you build
Then you'll see that with versions before 3.2.13 the result is to show both Bob and Charles, but as of 3.2.13 (or really, as of 4a80ae5) the result is to show only Charles. |
Cc
header exists.g_mime_message_get_addresses
when more than one Cc
header exists.
Hm, @ojwb points out on the RFC 5322 §4 ("Obsolete Syntax") acknowledges as much:
And in §4.5.3 ("Obsolete Destination Address Fields"), we see:
So as a parser, i think gmime 3.2.13 is doing the wrong thing here, and it should be fixed. |
I think this resolves a copy/paste error that was introduced in 4a80ae5. The logic for `message_add_addresses` is that it is supposed to just be appending to a list of addresses, rather than trying to re-merge a series of addresses. It looks like the function's framing was copy/pasted from `message_update_addresses`, which does the more complete re-build/re-merge. However, `message_update_addresses` starts with an initial `internet_address_list_clear`, and then proceeds to cycle through the entire list of headers, trying to collect the ones that match the field name, so clearing the address list initially makes sense. For `message_add_addresses` though, the goal is just to append to the current list that already exists, so the list should not be initially cleared. Fixes: jstedfast#129
Oops, yes, your patch looks correct. My intention was always to have GMime combine all of the Cc: addresses into 1 InternetAddressList for convenient usage. |
I think this resolves a copy/paste error that was introduced in 4a80ae5. The logic for `message_add_addresses` is that it is supposed to just be appending to a list of addresses, rather than trying to re-merge a series of addresses. It looks like the function's framing was copy/pasted from `message_update_addresses`, which does the more complete re-build/re-merge. However, `message_update_addresses` starts with an initial `internet_address_list_clear`, and then proceeds to cycle through the entire list of headers, trying to collect the ones that match the field name, so clearing the address list initially makes sense. For `message_add_addresses` though, the goal is just to append to the current list that already exists, so the list should not be initially cleared. Fixes: #129
In the notmuch test suite, we're seeing a failure to reply correctly to a message that has multiple
cc
headers.From a git bisect, i found that 4a80ae5 introduces this failure:
The message that is being replied to is this simple, subtly-malformed message:
I note that RFC 5322 §3.6 indicates that there must be exactly 0 or 1
Cc
header, but in practice,notmuch
has been working off the assumption that earlier versions of gmime had, which is that multipleCc
headers could or would be collapsed and treated as a single header.The text was updated successfully, but these errors were encountered: