<<< Date Index >>>     <<< Thread Index >>>

Re: mutt/2304: reply / group reply behavior broken WRT $reply_to and $reply_self



The following reply was made to PR mutt/2304; it has been noted by GNATS.

From: Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc: 
Subject: Re: mutt/2304: reply / group reply behavior broken WRT $reply_to and 
$reply_self
Date: Tue, 27 Jun 2006 06:38:56 +0200

 On 2006-06-24 18:55:02 +0200, Derek Martin wrote:
 
 >  No it isn't... at least not necessarily.  It is only the
 >  address where you want replies to go.  In addition to the
 >  other examples I gave, there is the very common example of
 >  mailing lists.  People who use mailing lists often set the
 >  Reply-to header to the mailing list they are reading.  If
 >  they reply to their own message, clearly they want the
 >  reply to go to the list; not to the recipient list.  
 
 Is that so clear?
 
 The main assumption when $reply_self is unset is that people
 won't want to talk to themselves.
 
 Also, Reply-To is just about the last thing you'd really want
 to use to redirect follow-ups to a mailing list.  But that's a
 different discussion.
 
 >  Another valid use is if you are sending mail to business
 >  associates shorly before you leave your current position.  
 
 I don't see how this is a use case for having responses
 redirected when you are responding to your own message.  (It's
 obviously a classical reply-to use case when somebody else
 responds.)
 
 >> So, if $reply_self is unset, mutt should ignore it.
 
 > Hopefully it's clear that this is not the case.  
 
 Sorry, but it's not clear.
 
 > Moreover, if $reply-self IS set, mutt STILL ignores the
 > Reply-to header.  You have no way to tell mutt that you want
 > to honor the sender's wishes (that is, your own wishes) and
 > use the Reply-to header.
 
 Staring at the current code, I don't see the behavior that you
 describe -- but maybe that's because I'm sitting in a hotel and
 waiting for breakfast to be served.
 
 Anyway, let's look; if I'm being dense, blame it on the lack of
 coffee.  Let's assume that (a) the user wrote the message, (b)
 it has a reply-to header, and (c) $reply_self is set.
 
    440 static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int 
hmfupto)
    441 {
    442   char prompt[STRING];
    443 
    444   if (flags && env->mail_followup_to && hmfupto == M_YES) 
    445   {
    446     rfc822_append (to, env->mail_followup_to);
    447     return 0;
    448   }
    449 
    450   /* Exit now if we're setting up the default Cc list for list-reply
    451    * (only set if Mail-Followup-To is present and honoured).
    452    */
    453   if (flags & SENDLISTREPLY)
    454     return 0;
    455 
 
 Let's assume we're not dealing with Mail-Followup-To, and we're
 not dealing with list replies.  So...
 
    456   if (!option(OPTREPLYSELF) && mutt_addr_is_user (env->from))
 
 $reply_self is set -> go to 461.
 
    457   {
    458     /* mail is from the user, assume replying to recipients */
    459     rfc822_append (to, env->to);
    460   }
    461   else if (env->reply_to)
    462   {
 
 There is a Reply-To header, so here we go...
 
    463     if ((mutt_addrcmp (env->from, env->reply_to) && 
!env->reply_to->next) ||
 
 Is env->from really the same thing as env->reply_to?  If so,
 assume that env->from has the better real name.  (That's what
 this part really boils dow to.)
 
    464         (option (OPTIGNORELISTREPLYTO) &&
 
 Mhhh.....  Set?
 
    465         mutt_is_mail_list (env->reply_to) &&
 
 If so, does Reply-To point to a list?
 
    466         (mutt_addrsrc (env->reply_to, env->to) ||
    467         mutt_addrsrc (env->reply_to, env->cc))))
 
 That the original message is addressed to?
 
    468     {
    469       /* If the Reply-To: address is a mailing list, assume that it was
    470        * put there by the mailing list, and use the From: address
    471        * 
    472        * We also take the from header if our correspondant has a 
reply-to
    473        * header which is identical to the electronic mail address given
    474        * in his From header.
    475        * 
    476        */
    477       rfc822_append (to, env->from);
    
 => Use the From header.
 
    478     }
    479     else if (!(mutt_addrcmp (env->from, env->reply_to) && 
    480                !env->reply_to->next) &&
    481              quadoption (OPT_REPLYTO) != M_YES)
    482     {
 
 If $reply_to isn't set to "honor automatically", and reply-to
 is substantially different from "from", then ask user.  We'll
 assume you set $reply_to to "yes", so we continue in line
 506...
 
 (Incidentally, the "substantially different" test here will
 always succeed -- this was checked for in the previous else if
 clause.  So we can simplify the code a bit.)
 
    483       /* There are quite a few mailing lists which set the Reply-To:
    484        * header field to the list address, which makes it quite 
impossible
    485        * to send a message to only the sender of the message.  This
    486        * provides a way to do that.
    487        */
    488       snprintf (prompt, sizeof (prompt), _("Reply to %s%s?"),
    489                 env->reply_to->mailbox, 
    490                 env->reply_to->next?",...":"");
    491       switch (query_quadoption (OPT_REPLYTO, prompt))
    492       {
    493       case M_YES:
    494         rfc822_append (to, env->reply_to);
    495         break;
    496 
    497       case M_NO:
    498         rfc822_append (to, env->from);
    499         break;
    500 
    501       default:
    502         return (-1); /* abort */
    503       }
    504     }
    505     else
 
 Anyway, our example puts us here, and we copy the Reply-To
 header to the To header.
 
    506       rfc822_append (to, env->reply_to);
    507   }
    508   else
 
 "If there was no reply-to header, then use from."
 
    509     rfc822_append (to, env->from);
    510 
    511   return (0);
    512 }
 
 It strikes me that the behavior you describe as wrong would
 occur if the Reply-To header points to a mailing list that the
 message is addressed to, and the ignore_list_reply_to option is
 set.  In that case, however, it would be the expected behavior.
 
 Is it possible that this is the case you're observing?
 
 (As I said above, I haven't had coffee, yet, so I might be
 dense and mis-read the code.  If so, please point out the
 mistake in the reasoning above.)
 
 >  >  Mutt's current behavior lets me write a follow-up message to
 >  >  the same recipients that the original had.  That's a feature to
 >  >  me.
 >  
 >  But this is exactly what you get if you unset $reply_to.  
 
 It's what you get if you unset $reply_to and do a group_reply.
 The current code lets you press "reply" and just address the
 recipients from the To header.
 
 Regards,
 -- 
 Thomas Roessler                              <roessler@xxxxxxxxxxxxxxxxxx>