From 6715fccfe4c6ae4912f832ee59d6b712eda7fea4 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Mon, 1 Jun 2009 10:36:50 +0200 Subject: [PATCH] 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. --- send.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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)) { -- 2.40.0