From: Rocco Rutte Date: Mon, 1 Jun 2009 08:36:50 +0000 (+0200) Subject: Treat address groups as no recipients X-Git-Tag: neomutt-20160307~617 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6715fccfe4c6ae4912f832ee59d6b712eda7fea4;p=neomutt Treat address groups as no recipients When sending with Sendmail or SMTP we exclude address groups anyway, so treat these addresses as not present when checking for valid recipients before sending in the compose menu. --- diff --git a/send.c b/send.c index a8cb08891..d42818c1f 100644 --- a/send.c +++ b/send.c @@ -1094,6 +1094,19 @@ static int is_reply (HEADER *reply, HEADER *orig) mutt_find_list (orig->env->in_reply_to, reply->env->message_id); } +static int has_recips (ADDRESS *a) +{ + int c = 0; + + for ( ; a; a = a->next) + { + if (!a->mailbox || a->group) + continue; + c++; + } + return c; +} + int ci_send_message (int flags, /* send mode */ HEADER *msg, /* template to use for new message */ @@ -1553,7 +1566,8 @@ main_loop: } } - if (!msg->env->to && !msg->env->cc && !msg->env->bcc) + if (!has_recips (msg->env->to) && !has_recips (msg->env->cc) && + !has_recips (msg->env->bcc)) { if (! (flags & SENDBATCH)) {