Re: notmuch-reply doesn't use Reply-To

2016-03-23 Thread David Bremner
Jani Nikula  writes:

>>
>> Here is the reply message, and it does not contain the address in Reply-To.
>
> This was true way back when notmuch reply only knew about reply all. For
> --reply-to=sender, it's broken. The simplest "fix" might be
>
> diff --git a/notmuch-reply.c b/notmuch-reply.c
> index 6df54fc992bb..ed0f9cca5c00 100644
> --- a/notmuch-reply.c
> +++ b/notmuch-reply.c
> @@ -334,7 +334,7 @@ add_recipients_from_message (GMimeMessage *reply,
>   * that the address in the Reply-To header will always appear in
>   * the reply.
>   */
> -if (reply_to_header_is_redundant (message)) {
> +if (reply_to_header_is_redundant (message) && reply_all) {
> reply_to_map[0].header = "from";
> reply_to_map[0].fallback = NULL;
>  }

I'm going to mark this fixed for now, since the docs have now been
updated to match the behaviour.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-29 Thread Michal Sojka
Hi all,

On Fri, Dec 04 2015, Jani Nikula wrote:
> On Fri, 04 Dec 2015, Damien Cassou  wrote:
>> David Bremner  writes:
>>
>>> Damien Cassou  writes:
>>>
"To" : "r...@inria.fr",
"Reply-To" : "r...@inria.fr",
"From" : "seas...@rmod.inria.fr",
"Subject" : "[rmod] [Mm10s] 2015-11-30",
"Date" : "Mon, 30 Nov 2015 07:00:01 +0100"
>>>
>>> A quick look at the code suggests this is falling victim to the
>>> "reply-to munging" detection code, which considers a reply-to field
>>> redudant if it duplicates one of the other fields. From the source
>>>
>>> /* Some mailing lists munge the Reply-To header despite it being A Bad
>>>  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
>>>  *
>>>  * The munging is easy to detect, because it results in a
>>>  * redundant reply-to header, (with an address that already exists
>>>  * in either To or Cc). So in this case, we ignore the Reply-To
>>>  * field and use the From header. This ensures the original sender
>>>  * will get the reply even if not subscribed to the list. Note
>>>  * that the address in the Reply-To header will always appear in
>>>  * the reply.
>>>  */
>>
>>
>> The last sentence seems to contradict my example:
>>
>> Note that the address in the Reply-To header will always appear in
>> the reply.
>>
>> Here is the reply message, and it does not contain the address in Reply-To.
>
> This was true way back when notmuch reply only knew about reply all. For
> --reply-to=sender, it's broken. The simplest "fix" might be

I don't think that this is broken for two reasons:

1. In tests/T230-reply-to-sender.sh, there is "Un-munging Reply-To"
   test, which checks the same combination of headers as in Damien's
   case and uses --reply-to=sender. The test passes and the reply has
   To=From.

2. When replying to mailing lists using reply-to munging, current
   notmuch behavior allows me to decide whether to reply 1) privately to
   the mail sender (--reply-to=sender) or 2) to the mailing list
   (--reply-to=all). The proposed change would make option 1) harder.

Therefore I suggest to fix this by applying the documentation patch from
the follow-up mail.

-Michal
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread David Bremner
Damien Cassou  writes:

>"To" : "r...@inria.fr",
>"Reply-To" : "r...@inria.fr",
>"From" : "seas...@rmod.inria.fr",
>"Subject" : "[rmod] [Mm10s] 2015-11-30",
>"Date" : "Mon, 30 Nov 2015 07:00:01 +0100"

A quick look at the code suggests this is falling victim to the
"reply-to munging" detection code, which considers a reply-to field
redudant if it duplicates one of the other fields. From the source

/* Some mailing lists munge the Reply-To header despite it being A Bad
 * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
 *
 * The munging is easy to detect, because it results in a
 * redundant reply-to header, (with an address that already exists
 * in either To or Cc). So in this case, we ignore the Reply-To
 * field and use the From header. This ensures the original sender
 * will get the reply even if not subscribed to the list. Note
 * that the address in the Reply-To header will always appear in
 * the reply.
 */
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread David Bremner
Damien Cassou  writes:

> Hi,
>
> I've the impression that notmuch-reply doesn't respect the Reply-To
> field: I've an email with a Reply-To field. But when I execute "notmuch
> reply id:", the To: field is set to the From: field of the
> original email and not to the Reply-To: field.
>

Hmm. The following test suggests it doesn't ignore reply-to completely.
Maybe there is some side-effect from --reply-to=sender. What if you try
omitting that?

test_begin_subtest "Support for Reply-To"
add_message '[from]="Sender "' \
 [to]=test_su...@notmuchmail.org \
 [subject]=notmuch-reply-test \
'[date]="Tue, 05 Jan 2010 15:43:56 -"' \
'[body]="support for reply-to"' \
'[reply-to]="Sender "'

output=$(notmuch reply id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite 

Subject: Re: notmuch-reply-test
To: Sender 
In-Reply-To: <${gen_msg_id}>
References: <${gen_msg_id}>

On Tue, 05 Jan 2010 15:43:56 -, Sender  wrote:
> support for reply-to"

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread Tomi Ollila
On Fri, Dec 04 2015, David Bremner  wrote:

> Damien Cassou  writes:
>
>>"To" : "r...@inria.fr",
>>"Reply-To" : "r...@inria.fr",
>>"From" : "seas...@rmod.inria.fr",
>>"Subject" : "[rmod] [Mm10s] 2015-11-30",
>>"Date" : "Mon, 30 Nov 2015 07:00:01 +0100"
>
> A quick look at the code suggests this is falling victim to the
> "reply-to munging" detection code, which considers a reply-to field
> redudant if it duplicates one of the other fields. From the source
>
> /* Some mailing lists munge the Reply-To header despite it being A Bad
>  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
>  *
>  * The munging is easy to detect, because it results in a
>  * redundant reply-to header, (with an address that already exists
>  * in either To or Cc). So in this case, we ignore the Reply-To
>  * field and use the From header. This ensures the original sender
>  * will get the reply even if not subscribed to the list. Note
>  * that the address in the Reply-To header will always appear in
>  * the reply.
>  */

For anyone who did that feature, Thank You ! :D

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread David Bremner
Damien Cassou  writes:

>
> The last sentence seems to contradict my example:
>
> Note that the address in the Reply-To header will always appear in
> the reply.
>

The feature, and the comment, predate the "--reply-to=sender" option so
maybe something needs to be updated.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread Jani Nikula
On Fri, 04 Dec 2015, Damien Cassou  wrote:
> David Bremner  writes:
>
>> Damien Cassou  writes:
>>
>>>"To" : "r...@inria.fr",
>>>"Reply-To" : "r...@inria.fr",
>>>"From" : "seas...@rmod.inria.fr",
>>>"Subject" : "[rmod] [Mm10s] 2015-11-30",
>>>"Date" : "Mon, 30 Nov 2015 07:00:01 +0100"
>>
>> A quick look at the code suggests this is falling victim to the
>> "reply-to munging" detection code, which considers a reply-to field
>> redudant if it duplicates one of the other fields. From the source
>>
>> /* Some mailing lists munge the Reply-To header despite it being A Bad
>>  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
>>  *
>>  * The munging is easy to detect, because it results in a
>>  * redundant reply-to header, (with an address that already exists
>>  * in either To or Cc). So in this case, we ignore the Reply-To
>>  * field and use the From header. This ensures the original sender
>>  * will get the reply even if not subscribed to the list. Note
>>  * that the address in the Reply-To header will always appear in
>>  * the reply.
>>  */
>
>
> The last sentence seems to contradict my example:
>
> Note that the address in the Reply-To header will always appear in
> the reply.
>
> Here is the reply message, and it does not contain the address in Reply-To.

This was true way back when notmuch reply only knew about reply all. For
--reply-to=sender, it's broken. The simplest "fix" might be

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 6df54fc992bb..ed0f9cca5c00 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -334,7 +334,7 @@ add_recipients_from_message (GMimeMessage *reply,
  * that the address in the Reply-To header will always appear in
  * the reply.
  */
-if (reply_to_header_is_redundant (message)) {
+if (reply_to_header_is_redundant (message) && reply_all) {
reply_to_map[0].header = "from";
reply_to_map[0].fallback = NULL;
 }


BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-reply doesn't use Reply-To

2015-12-04 Thread Damien Cassou
David Bremner  writes:

> Damien Cassou  writes:
>
>>"To" : "r...@inria.fr",
>>"Reply-To" : "r...@inria.fr",
>>"From" : "seas...@rmod.inria.fr",
>>"Subject" : "[rmod] [Mm10s] 2015-11-30",
>>"Date" : "Mon, 30 Nov 2015 07:00:01 +0100"
>
> A quick look at the code suggests this is falling victim to the
> "reply-to munging" detection code, which considers a reply-to field
> redudant if it duplicates one of the other fields. From the source
>
> /* Some mailing lists munge the Reply-To header despite it being A Bad
>  * Thing, see http://www.unicom.com/pw/reply-to-harmful.html
>  *
>  * The munging is easy to detect, because it results in a
>  * redundant reply-to header, (with an address that already exists
>  * in either To or Cc). So in this case, we ignore the Reply-To
>  * field and use the From header. This ensures the original sender
>  * will get the reply even if not subscribed to the list. Note
>  * that the address in the Reply-To header will always appear in
>  * the reply.
>  */


The last sentence seems to contradict my example:

Note that the address in the Reply-To header will always appear in
the reply.

Here is the reply message, and it does not contain the address in Reply-To.

$ notmuch reply --reply-to=sender --format=json 
"id:565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr" | json_pp
{
   "reply-headers" : {
  "References" : "<565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr>",
  "Subject" : "Re: [rmod] [Mm10s] 2015-11-30",
  "To" : "seas...@rmod.inria.fr",
  "From" : "Damien Cassou ",
  "In-reply-to" : "<565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr>"

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


notmuch-reply doesn't use Reply-To

2015-12-03 Thread Damien Cassou
Hi,

I've the impression that notmuch-reply doesn't respect the Reply-To
field: I've an email with a Reply-To field. But when I execute "notmuch
reply id:", the To: field is set to the From: field of the
original email and not to the Reply-To: field.

Here is the original email I want to reply to:

$ notmuch show --format=json --entire-thread=false --body=false 
"id:565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr" | json_pp
[
   [
  [
 {
   [...]
"headers" : {
   "To" : "r...@inria.fr",
   "Reply-To" : "r...@inria.fr",
   "From" : "seas...@rmod.inria.fr",
   "Subject" : "[rmod] [Mm10s] 2015-11-30",
   "Date" : "Mon, 30 Nov 2015 07:00:01 +0100"
},
[...]


Here is the result of notmuch-reply:

$ notmuch reply --reply-to=sender --format=json 
"id:565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr" | json_pp
{
   "reply-headers" : {
  "References" : "<565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr>",
  "Subject" : "Re: [rmod] [Mm10s] 2015-11-30",
  "To" : "seas...@rmod.inria.fr",
  "From" : "Damien Cassou ",
  "In-reply-to" : "<565be5e1.x5p1i6xirrudvma6%seas...@rmod.inria.fr>"
   },
   "original" : {
  "tags" : [
[...]


As you can see, the "To" field of the reply is not set from the original
Reply-To: field, but from the original From: field.

Can anyone help me please?

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch