ask when sending list message replies to author only - Armin Wolfermann (aw) --- init.h | 7 +++++++ mutt.h | 1 + send.c | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) --- init.h +++ init.h 2019-01-02 13:22:21.794925899 +0000 @@ -1559,6 +1559,13 @@ struct option_t MuttVars[] = { ** from your spool mailbox to your $$mbox mailbox, or as a result of ** a ``$mbox-hook'' command. */ + { "list_reply", DT_QUAD, R_NONE, OPT_LISTREPLY, MUTT_NO }, + /* + ** .pp + ** When set, address replies to the mailing list the original message came + ** from (instead to the author only). Setting this option to ``ask-yes'' or + ** ``ask-no'' will ask if you really intended to reply to the author only. + */ { "mail_check", DT_NUM, R_NONE, UL &BuffyTimeout, 5 }, /* ** .pp --- mutt.h +++ mutt.h 2019-01-02 13:22:21.794925899 +0000 @@ -320,6 +320,7 @@ enum #endif OPT_SUBJECT, OPT_VERIFYSIG, /* verify PGP signatures */ + OPT_LISTREPLY, /* THIS MUST BE THE LAST VALUE. */ OPT_MAX --- send.c +++ send.c 2019-01-02 13:22:21.794925899 +0000 @@ -448,6 +448,7 @@ static int include_reply (CONTEXT *ctx, static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto) { char prompt[STRING]; + struct Address *tmp; if (flags && env->mail_followup_to && hmfupto == MUTT_YES) { @@ -461,6 +462,23 @@ static int default_to (ADDRESS **to, ENV if (flags & SENDLISTREPLY) return 0; + /* If this message came from a mailing list, ask the user if he really + * intended to reply to the author only. + */ + if (!(flags & SENDGROUPREPLY) && mutt_is_list_cc (0, env->to, env->cc)) { + switch (query_quadoption (OPT_LISTREPLY, + _("Message came from a mailing list. Reply to author only?"))) + { + case MUTT_NO: + tmp = find_mailing_lists (env->to, env->cc); + rfc822_append (to, tmp, 0); + rfc822_free_address (&tmp); + return 0; + case -1: + return -1; /* abort */ + } + } + if (!option(OPTREPLYSELF) && mutt_addr_is_user (env->from)) { /* mail is from the user, assume replying to recipients */