is_message = mutt_is_message_type(a->type, a->subtype);
if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
+ {
return rc;
+ }
use_mailcap =
(flag == MUTT_MAILCAP || (flag == MUTT_REGULAR && mutt_needs_mailcap(a)));
snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
if (mutt_copy_message_fp(msg->fp, fp, hn, 0, chflags) == 0 &&
mx_commit_message(msg, &ctx) == 0)
+ {
r = 0;
+ }
else
+ {
r = -1;
+ }
mx_close_message(&ctx, &msg);
mx_close_mailbox(&ctx, NULL);
{
if ((mutt_str_strncmp(de->d_name, ".", 1) == 0) ||
(mutt_str_strncmp(de->d_name, "..", 2) == 0))
+ {
continue;
+ }
mutt_debug(3, "bcache: list: dir: '%s', id :'%s'\n", bcache->path, de->d_name);
if (prefix && *prefix &&
(mutt_str_strncmp(prefix, de->d_name, mutt_str_strlen(prefix)) != 0))
+ {
continue;
+ }
if (!((regexec(Mask.regex, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
continue;
*/
if ((mutt_str_strcmp(state->entry[0].desc, "..") == 0) ||
(mutt_str_strcmp(state->entry[0].desc, "../") == 0))
+ {
/* Skip the first entry, unless there's only one entry. */
menu->current = (menu->max > 1);
+ }
else
+ {
menu->current = 0;
+ }
}
static void init_menu(struct BrowserState *state, struct Menu *menu,
#ifdef USE_SIDEBAR
if ((orig_new != tmp->new) || (orig_count != tmp->msg_count) ||
(orig_unread != tmp->msg_unread) || (orig_flagged != tmp->msg_flagged))
+ {
mutt_set_current_menu_redraw(REDRAW_SIDEBAR);
+ }
#endif
if (!tmp->new)
{
if (stat(b->path, &tmp_sb) == 0 && sb.st_dev == tmp_sb.st_dev &&
sb.st_ino == tmp_sb.st_ino)
+ {
return b;
+ }
}
return NULL;
}
if (!first && (MuttMessageWindow->cols >= 7) &&
(pos + strlen(path) >= (size_t) MuttMessageWindow->cols - 7))
+ {
break;
+ }
if (!first)
pos += strlen(strncat(buffylist + pos, ", ", sizeof(buffylist) - 1 - pos));
mutt_str_strfcpy(scratch, in, sizeof(scratch));
for (size_t i = 0; PreferredMIMENames[i].key; i++)
+ {
if ((mutt_str_strcasecmp(scratch, PreferredMIMENames[i].key) == 0) ||
(mutt_str_strcasecmp(scratch, PreferredMIMENames[i].key) == 0))
{
mutt_str_strfcpy(dest, PreferredMIMENames[i].pref, dlen);
goto out;
}
+ }
mutt_str_strfcpy(dest, scratch, dlen);
{
if ((mutt_str_strcasecmp(PreferredMIMENames[i].key, s) == 0) ||
(mutt_str_strcasecmp(PreferredMIMENames[i].pref, s) == 0))
+ {
return true;
+ }
}
cd = mutt_iconv_open(s, s, 0);
buffer[0] = '\0';
if (mutt_get_field(_("Pipe to command: "), buffer, sizeof(buffer), MUTT_CMD) != 0 ||
!buffer[0])
+ {
return;
+ }
mutt_expand_path(buffer, sizeof(buffer));
pipe_message(h, buffer, option(OPT_PIPE_DECODE), 0, option(OPT_PIPE_SPLIT), PipeSep);
fname[0] = 0;
if (mutt_get_field(_("New file: "), fname, sizeof(fname), MUTT_FILE) != 0 ||
!fname[0])
+ {
continue;
+ }
mutt_expand_path(fname, sizeof(fname));
/* Call to lookup_mime_type () ? maybe later */
devnull = open("/dev/null", O_RDWR);
if (devnull < 0 || dup2(pout[0], STDIN_FILENO) < 0 ||
dup2(pin[1], STDOUT_FILENO) < 0 || dup2(devnull, STDERR_FILENO) < 0)
+ {
_exit(127);
+ }
close(pin[0]);
close(pin[1]);
close(pout[0]);
/* note: CH_FROM takes precedence over header weeding. */
if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) &&
(flags & CH_WEED) && mutt_matches_ignore(buf))
+ {
continue;
+ }
if ((flags & CH_WEED_DELIVERED) &&
(mutt_str_strncasecmp("Delivered-To:", buf, 13) == 0))
+ {
continue;
+ }
if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
((mutt_str_strncasecmp("Status:", buf, 7) == 0) ||
(mutt_str_strncasecmp("X-Status:", buf, 9) == 0)))
+ {
continue;
+ }
if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &&
((mutt_str_strncasecmp("Content-Length:", buf, 15) == 0) ||
(mutt_str_strncasecmp("Lines:", buf, 6) == 0)))
+ {
continue;
+ }
if ((flags & CH_MIME) &&
(((mutt_str_strncasecmp("content-", buf, 8) == 0) &&
((mutt_str_strncasecmp("transfer-encoding:", buf + 8, 18) == 0) ||
(mutt_str_strncasecmp("type:", buf + 8, 5) == 0))) ||
(mutt_str_strncasecmp("mime-version:", buf, 13) == 0)))
+ {
continue;
+ }
if ((flags & CH_UPDATE_REFS) && (mutt_str_strncasecmp("References:", buf, 11) == 0))
continue;
if ((flags & CH_UPDATE_IRT) && (mutt_str_strncasecmp("In-Reply-To:", buf, 12) == 0))
memset(&mbstate, 0, sizeof(mbstate));
if ((n1 = wcrtomb(buf, wc, &mbstate)) == (size_t)(-1) ||
(n2 = wcrtomb(buf + n1, 0, &mbstate)) == (size_t)(-1))
+ {
return -1; /* ERR */
+ }
else
+ {
return addstr(buf);
+ }
}
/**
*/
if (((Sort & SORT_REVERSE) && (Sort & SORT_MASK) != SORT_THREADS) ||
((Sort & SORT_MASK) == SORT_THREADS && ((Sort ^ SortAux) & SORT_REVERSE)))
+ {
return 0;
+ }
else
+ {
return (Context->vcount ? Context->vcount - 1 : 0);
+ }
}
return 0;
}
buf[0] = 0;
if (mutt_get_field(_("Enter Message-Id: "), buf, sizeof(buf), 0) != 0 ||
!buf[0])
+ {
break;
+ }
}
else
{
/* try to find what used to be the current message */
menu->current = -1;
for (i = 0; i < Context->vcount; i++)
+ {
if (Context->hdrs[Context->v2r[i]]->index == menu->oldcurrent)
{
menu->current = i;
break;
}
+ }
if (menu->current < 0)
menu->current = 0;
}
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
int hint = Context->hdrs[Context->v2r[menu->current]]->index;
/* If we are returning to the pager via an index menu redirection, we
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
if (edit)
mutt_edit_message(Context, tag ? NULL : CURHDR);
else
CHECK_ATTACH;
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
ci_send_message(SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
CHECK_ATTACH;
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
ci_send_message(SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
CHECK_VISIBLE;
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
ci_send_message(SENDREPLY | SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
{
if (Context && Context->magic == MUTT_NNTP &&
!((struct NntpData *) Context->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ {
break;
+ }
if (op == OP_POST)
ci_send_message(SENDNEWS, NULL, NULL, Context, NULL);
else
CHECK_VISIBLE;
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ {
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ }
ci_send_message(SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
}
if (state->curpos < state->begin ||
mutt_mb_wcswidth(state->wbuf + state->begin, state->curpos - state->begin) >= width)
+ {
state->begin = mutt_mb_width_ceiling(
state->wbuf, state->lastchar,
mutt_mb_wcswidth(state->wbuf, state->curpos) - width / 2);
+ }
mutt_window_move(MuttMessageWindow, 0, col);
w = 0;
for (i = state->begin; i < state->lastchar; i++)
if ((tm.tm_hour < 0) || (tm.tm_hour > 23) || (tm.tm_min < 0) ||
(tm.tm_min > 59) || (tm.tm_sec < 0) || (tm.tm_sec > 60))
+ {
return 0;
+ }
s = mutt_str_next_word(s);
if (!*s)
tagptr++;
for (i = 0, j = -1; EnrichedTags[i].tag_name; i++)
+ {
if (wcscasecmp(EnrichedTags[i].tag_name, tagptr) == 0)
{
j = EnrichedTags[i].index;
break;
}
+ }
if (j != -1)
{
{
if ((mutt_str_strcasecmp(a->subtype, "signed") == 0) ||
(mutt_str_strcasecmp(a->subtype, "encrypted") == 0))
+ {
return 1;
+ }
}
for (struct Body *b = a->parts; b; b = b->next)
if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) &&
(s->flags & MUTT_FIRSTDONE))
+ {
break;
+ }
}
if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
handler = crypt_pgp_application_pgp_handler;
else if (option(OPT_REFLOW_TEXT) &&
(mutt_str_strcasecmp("flowed", mutt_get_parameter("format", b->parameter)) == 0))
+ {
handler = rfc3676_handler;
+ }
else
+ {
handler = text_plain_handler;
+ }
}
else if (mutt_str_strcasecmp("enriched", b->subtype) == 0)
handler = text_enriched_handler;
if ((mutt_str_strcmp("inline", ShowMultipartAlternative) != 0) &&
(mutt_str_strcasecmp("alternative", b->subtype) == 0))
+ {
handler = alternative_handler;
+ }
else if (WithCrypto && (mutt_str_strcasecmp("signed", b->subtype) == 0))
{
p = mutt_get_parameter("protocol", b->parameter);
handler = mutt_signed_handler;
}
else if (mutt_is_valid_multipart_pgp_encrypted(b))
+ {
handler = valid_pgp_encrypted_handler;
+ }
else if (mutt_is_malformed_multipart_pgp_encrypted(b))
+ {
handler = malformed_pgp_encrypted_handler;
+ }
if (!handler)
handler = multipart_handler;
{
if (!mutt_match_regex_list(addr->mailbox, UnMailLists) &&
!mutt_match_regex_list(addr->mailbox, UnSubscribedLists))
+ {
return mutt_match_regex_list(addr->mailbox, SubscribedLists);
+ }
return false;
}
case 'K':
if (!first_mailing_list(dest, destlen, hdr->env->to) &&
!first_mailing_list(dest, destlen, hdr->env->cc))
+ {
dest[0] = 0;
+ }
if (dest[0])
{
mutt_str_strfcpy(buf2, dest, sizeof(buf2));
if (km_expand_key(buf, sizeof(buf), km_find_func(menu, op)) ||
km_expand_key(buf, sizeof(buf), km_find_func(MENU_GENERIC, op)))
+ {
snprintf(d, dlen, "%s:%s", buf, txt);
+ }
else
+ {
d[0] = '\0';
+ }
}
char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items)
size_t n1, n2;
if ((n1 = wcrtomb(buf, wc, &mbstate2)) != (size_t)(-1) &&
(n2 = wcrtomb(buf + n1, 0, &mbstate2)) != (size_t)(-1))
+ {
fputs(buf, f);
+ }
}
}
else if (wc < 0x20 || wc == 0x7f)
}
if (!regen_file)
+ {
for (hclass = HC_FIRST; hclass < HC_LAST; hclass++)
+ {
if (n[hclass] > SaveHistory)
{
regen_file = true;
break;
}
+ }
+ }
if (regen_file)
{
*p = '\0';
if (option(OPT_HISTORY_REMOVE_DUPS) &&
(dup_hash_dec(dup_hashes[hclass], linebuf + read) > 0))
+ {
continue;
+ }
*p = '|';
if (n[hclass]-- <= SaveHistory)
fprintf(tmp, "%s\n", linebuf);
{
if (!authenticator->method ||
(mutt_str_strcasecmp(authenticator->method, method) == 0))
+ {
if ((r = authenticator->authenticate(idata, method)) != IMAP_AUTH_UNAVAIL)
{
FREE(&methods);
return r;
}
+ }
authenticator++;
}
if (mutt_bit_isset(idata->capabilities, AUTH_ANON) &&
(!idata->conn->account.user[0] ||
(mutt_str_strncmp(idata->conn->account.user, "anonymous", 9) == 0)))
+ {
rc = sasl_client_start(saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, &mech);
+ }
}
else if ((mutt_str_strcasecmp("login", method) == 0) &&
!strstr(NONULL(idata->capstr), "AUTH=LOGIN"))
+ {
/* do not use SASL login for regular IMAP login (#3556) */
return IMAP_AUTH_UNAVAIL;
+ }
if (rc != SASL_OK && rc != SASL_CONTINUE)
+ {
do
{
rc = sasl_client_start(saslconn, method, &interaction, &pc, &olen, &mech);
if (rc == SASL_INTERACT)
mutt_sasl_interact(interaction);
} while (rc == SASL_INTERACT);
+ }
client_start = (olen > 0);
#ifdef USE_SIDEBAR
if ((inc->new != new) || (inc->msg_count != status->messages) ||
(inc->msg_unread != status->unseen))
+ {
mutt_set_current_menu_redraw(REDRAW_SIDEBAR);
+ }
#endif
inc->new = new;
if (new_msg_count)
{
if ((mutt_str_strncasecmp(s, "UTF8=ACCEPT", 11) == 0) ||
(mutt_str_strncasecmp(s, "UTF8=ONLY", 9) == 0))
+ {
idata->unicode = 1;
+ }
}
}
{
if ((mutt_str_strncasecmp("* OK [CAPABILITY", idata->buf, 16) != 0) &&
check_capabilities(idata))
+ {
goto bail;
+ }
#ifdef USE_SSL
/* Attempt STARTTLS if available and desired. */
if (!idata->conn->ssf &&
rc = MUTT_YES;
else if ((rc = query_quadoption(OPT_SSL_STARTTLS,
_("Secure connection with TLS?"))) == MUTT_ABORT)
+ {
goto err_close_conn;
+ }
if (rc == MUTT_YES)
{
rc = imap_exec(idata, "STARTTLS", IMAP_CMD_FAIL_OK);
if ((force || (idata->state != IMAP_IDLE && time(NULL) >= idata->lastread + Timeout)) &&
imap_exec(idata, "NOOP", IMAP_CMD_POLL) != 0)
+ {
return -1;
+ }
/* We call this even when we haven't run NOOP in case we have pending
* changes to process, since we can reopen here. */
pmx.mbox = NULL;
if (mx_is_imap(Postponed) && !imap_parse_path(Postponed, &pmx) &&
mutt_account_match(&pmx.account, &mx.account))
+ {
imap_status(Postponed, 1);
+ }
FREE(&pmx.mbox);
snprintf(bufout, sizeof(bufout), "%s %s",
if (maxuid && (status = imap_mboxcache_get(idata, idata->mailbox, 0)) &&
(status->uidnext < maxuid + 1))
+ {
status->uidnext = maxuid + 1;
+ }
#ifdef USE_HCACHE
mutt_hcache_store_raw(idata->hcache, "/UIDVALIDITY", 12, &idata->uid_validity,
mx2 = "INBOX";
if ((mutt_str_strcasecmp(mx1, "INBOX") == 0) &&
(mutt_str_strcasecmp(mx2, "INBOX") == 0))
+ {
return 0;
+ }
b1 = mutt_mem_malloc(strlen(mx1) + 1);
b2 = mutt_mem_malloc(strlen(mx2) + 1);
if ((mutt_str_strcmp(buf->data, "*") != 0) &&
mutt_add_to_regex_list(&UnAlternates, buf->data, REG_ICASE, err) != 0)
+ {
return -1;
+ }
} while (MoreArgs(s));
case GS_RX:
if (data == MUTT_GROUP &&
mutt_group_context_add_regex(gc, buf->data, REG_ICASE, err) != 0)
+ {
goto bail;
+ }
else if (data == MUTT_UNGROUP &&
mutt_group_context_remove_regex(gc, buf->data) < 0)
+ {
goto bail;
+ }
break;
case GS_ADDR:
if ((mutt_str_strcmp(buf->data, "*") != 0) &&
mutt_add_to_regex_list(&UnMailLists, buf->data, REG_ICASE, err) != 0)
+ {
return -1;
+ }
} while (MoreArgs(s));
return 0;
if ((mutt_str_strcmp(buf->data, "*") != 0) &&
mutt_add_to_regex_list(&UnSubscribedLists, buf->data, REG_ICASE, err) != 0)
+ {
return -1;
+ }
} while (MoreArgs(s));
return 0;
/* Do we have a locale definition? */
if (((p = getenv("LC_ALL")) != NULL && p[0]) || ((p = getenv("LANG")) != NULL && p[0]) ||
((p = getenv("LC_CTYPE")) != NULL && p[0]))
+ {
OPT_LOCALES = true;
+ }
#endif
#ifdef HAVE_GETSID
{
if ((mutt_str_strncasecmp(start, bindings[i].name, len) == 0) &&
mutt_str_strlen(bindings[i].name) == len)
+ {
return bindings[i].op;
+ }
}
return OP_NULL;
{
if ((mutt_str_strcmp(a->mailbox, b->mailbox) != 0) ||
(mutt_str_strcmp(a->personal, b->personal) != 0))
+ {
return 0;
+ }
a = a->next;
b = b->next;
{
if ((mutt_str_strcmp(p1->attribute, p2->attribute) != 0) ||
(mutt_str_strcmp(p1->value, p2->value) != 0))
+ {
return 0;
+ }
p1 = p1->next;
p2 = p2->next;
*/
if (!option(OPT_MAIL_CHECK_RECENT) && utimebuf.actime >= utimebuf.modtime &&
mbox_has_new(ctx))
+ {
utimebuf.actime = utimebuf.modtime - 1;
+ }
utime(ctx->path, &utimebuf);
}
const char *transform = mutt_hash_find(TagTransforms, np->pattern);
if (transform &&
(strncmp((const char *) (s + 1), transform, strlen(transform)) == 0))
+ {
return np->pair;
+ }
}
return 0;
default:
if ((snprintf(path, sizeof(path), "%s/.mh_sequences", b->path) < sizeof(path)) &&
(stat(path, &sb) == 0))
+ {
return (sb.st_mtime > b->last_visited);
+ }
return -1;
}
if ((snprintf(path, sizeof(path), "%s/%d", b->path, msgno) < sizeof(path)) &&
(stat(path, &sb) == 0))
+ {
return (sb.st_mtime <= b->last_visited);
+ }
return -1;
}
{
if ((ctx->magic == MUTT_MH && !mh_valid_message(de->d_name)) ||
(ctx->magic == MUTT_MAILDIR && *de->d_name == '.'))
+ {
continue;
+ }
/* FOO - really ignore the return value? */
mutt_debug(2, "%s:%d: queueing %s\n", __FILE__, __LINE__, de->d_name);
if (h->attach_del || h->xlabel_changed ||
(h->env && (h->env->refs_changed || h->env->irt_changed)))
+ {
if (mh_rewrite_message(ctx, msgno) != 0)
return -1;
+ }
return 0;
}
/* This code is optimized to negative timezones (West of Greenwich) */
if ((yday == -1) || /* UTC passed midnight before localtime */
(yday > 1)) /* UTC passed new year before localtime */
+ {
t -= (24 * 60 * 60);
+ }
else
+ {
t += (24 * 60 * 60);
+ }
}
return t;
return TIME_T_MIN;
if ((t->tm_hour < 0) || (t->tm_hour > 23) || (t->tm_min < 0) ||
(t->tm_min > 59) || (t->tm_sec < 0) || (t->tm_sec > 60))
+ {
return TIME_T_MIN;
+ }
if (t->tm_year > 9999)
return TIME_T_MAX;
*/
if (!strstr(data->db_query, "date:") &&
windowed_query_from_query(data->db_query, buf, sizeof(buf)))
+ {
data->db_query = mutt_str_strdup(buf);
+ }
mutt_debug(2, "nm: query (windowed) '%s'\n", data->db_query);
}
msg->fp = fopen(path, "r");
if (!msg->fp && (errno == ENOENT) &&
((ctx->magic == MUTT_MAILDIR) || (ctx->magic == MUTT_NOTMUCH)))
+ {
msg->fp = maildir_open_find_message(folder, cur->path, NULL);
+ }
mutt_debug(1, "%s\n", __func__);
return !msg->fp;
if (p && ((p == HiddenTags) || (*(p - 1) == ',') || (*(p - 1) == ' ')) &&
((*(p + xsz) == '\0') || (*(p + xsz) == ',') || (*(p + xsz) == ' ')))
+ {
np->hidden = true;
+ }
}
STAILQ_INSERT_TAIL(head, np, entries);
/* if folder = {host} or imap[s]://host/: don't append slash */
if (mx_is_imap(NONULL(Folder)) &&
(Folder[strlen(Folder) - 1] == '}' || Folder[strlen(Folder) - 1] == '/'))
+ {
mutt_str_strfcpy(p, NONULL(Folder), sizeof(p));
+ }
else
#endif
#ifdef USE_NOTMUCH
if (lstat(ctx->path, &stc) == 0 && stc.st_ino == st.st_ino &&
stc.st_dev == st.st_dev && stc.st_rdev == st.st_rdev)
+ {
return 0; /* we are in the trash folder: simple sync */
+ }
#ifdef USE_IMAP
if (Context->magic == MUTT_IMAP && mx_is_imap(Trash))
{
/* continue from initial scan above */
for (; i < ctx->msgcount; i++)
+ {
if (ctx->hdrs[i]->deleted && (!ctx->hdrs[i]->purge))
{
if (mutt_append_message(&ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
return -1;
}
}
+ }
mx_close_mailbox(&ctx_trash, NULL);
}
{
if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read &&
!(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED)))
+ {
read_msgs++;
+ }
}
#ifdef USE_NNTP
{
/* tag messages for moving, and clear old tags, if any */
for (i = 0; i < ctx->msgcount; i++)
+ {
if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted &&
!(ctx->hdrs[i]->flagged && option(OPT_KEEP_FLAGGED)))
+ {
ctx->hdrs[i]->tagged = true;
+ }
else
+ {
ctx->hdrs[i]->tagged = false;
+ }
+ }
i = imap_copy_messages(ctx, NULL, mbox, 1);
}
if (ctx->msgcount == ctx->deleted && (ctx->magic == MUTT_MMDF || ctx->magic == MUTT_MBOX) &&
!mutt_is_spool(ctx->path) && !option(OPT_SAVE_EMPTY))
+ {
mutt_file_unlink_empty(ctx->path);
+ }
#ifdef USE_SIDEBAR
if (purge && ctx->deleted)
if (!b || !(b->type == TYPEMULTIPART) || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "signed") != 0))
+ {
return 0;
+ }
p = mutt_get_parameter("protocol", b->parameter);
if (!p)
if ((WithCrypto & APPLICATION_PGP) &&
!(mutt_str_strcasecmp(p, "application/pgp-signature") != 0))
+ {
return PGPSIGN;
+ }
if ((WithCrypto & APPLICATION_SMIME) &&
!(mutt_str_strcasecmp(p, "application/x-pkcs7-signature") != 0))
+ {
return SMIMESIGN;
+ }
if ((WithCrypto & APPLICATION_SMIME) &&
!(mutt_str_strcasecmp(p, "application/pkcs7-signature") != 0))
+ {
return SMIMESIGN;
+ }
return 0;
}
b = b->parts;
if (!b || b->type != TYPEAPPLICATION || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "pgp-encrypted") != 0))
+ {
return 0;
+ }
b = b->next;
if (!b || b->type != TYPEAPPLICATION || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "octet-stream") != 0))
+ {
return 0;
+ }
return PGPENCRYPT;
}
if (!b || b->type != TYPEMULTIPART || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "mixed") != 0))
+ {
return 0;
+ }
b = b->parts;
if (!b || b->type != TYPETEXT || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "plain") != 0) || b->length != 0)
+ {
return 0;
+ }
b = b->next;
if (!b || b->type != TYPEAPPLICATION || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "pgp-encrypted") != 0))
+ {
return 0;
+ }
b = b->next;
if (!b || b->type != TYPEAPPLICATION || !b->subtype ||
(mutt_str_strcasecmp(b->subtype, "octet-stream") != 0))
+ {
return 0;
+ }
b = b->next;
if (b)
if ((p = mutt_get_parameter("format", m->parameter)) &&
(mutt_str_strcasecmp(p, "keys-only") == 0))
+ {
t |= PGPKEY;
+ }
if (!t)
t |= PGPENCRYPT; /* not necessarily correct, but... */
a->encoding = ENCBASE64;
else if (a->content && a->encoding != ENCBASE64 &&
(a->content->from || (a->content->space && option(OPT_PGP_STRICT_ENC))))
+ {
a->encoding = ENCQUOTEDPRINTABLE;
+ }
a = a->next;
}
}
case SIGN:
if (a->next->type != TYPEMULTIPART ||
(mutt_str_strcasecmp(a->next->subtype, "mixed") != 0))
+ {
inconsistent = true;
+ }
break;
case PGPSIGN:
if (a->next->type != TYPEAPPLICATION ||
(mutt_str_strcasecmp(a->next->subtype, "pgp-signature") != 0))
+ {
inconsistent = true;
+ }
break;
case SMIMESIGN:
if (a->next->type != TYPEAPPLICATION ||
((mutt_str_strcasecmp(a->next->subtype, "x-pkcs7-signature") != 0) &&
(mutt_str_strcasecmp(a->next->subtype, "pkcs7-signature") != 0)))
+ {
inconsistent = true;
+ }
break;
default:
inconsistent = true;
s++;
if (*s == ',' || *s == '=' || *s == '+' || *s == '<' || *s == '>' ||
*s == '#' || *s == ';' || *s == '\\' || *s == '\"' || *s == ' ')
+ {
n++;
+ }
else if (isxdigit(*s) && isxdigit(*(s + 1)))
{
s++;
return NULL; /* invalid encoding */
else if (*s == ',' || *s == '=' || *s == '+' || *s == '<' || *s == '>' ||
*s == '#' || *s == ';')
+ {
break;
+ }
else
n++;
}
if (whatfor)
{
for (l = id_defaults; l; l = l->next)
+ {
if (mutt_str_strcasecmp(whatfor, l->what) == 0)
{
mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp));
break;
}
+ }
}
while (true)
if (!(*is_subkey && option(OPT_PGP_IGNORE_SUBKEYS)) &&
mutt_str_atos(p, &tmp.keylen) < 0)
+ {
goto bail;
+ }
break;
}
case 4: /* pubkey algo */
/* If autoinline and no crypto options set, then set inline. */
if (option(OPT_PGP_AUTOINLINE) &&
!((msg->security & APPLICATION_PGP) && (msg->security & (SIGN | ENCRYPT))))
+ {
msg->security |= INLINE;
+ }
msg->security |= APPLICATION_PGP;
if (addr->mailbox && u_addr->mailbox &&
(mutt_str_strcasecmp(addr->mailbox, u_addr->mailbox) == 0))
+ {
rv |= PGP_KV_ADDR;
+ }
if (addr->personal && u_addr->personal &&
(mutt_str_strcasecmp(addr->personal, u_addr->personal) == 0))
+ {
rv |= PGP_KV_STRING;
+ }
return rv;
}
if (whatfor)
{
for (l = id_defaults; l; l = l->next)
+ {
if (mutt_str_strcasecmp(whatfor, l->what) == 0)
{
mutt_str_strfcpy(resp, NONULL(l->dflt), sizeof(resp));
break;
}
+ }
}
while (true)
}
for (t = env->to; !found && t; t = t->next)
+ {
if (mutt_addr_is_user(t))
{
found = true;
getkeys(t->mailbox);
}
+ }
for (t = env->cc; !found && t; t = t->next)
+ {
if (mutt_addr_is_user(t))
{
found = true;
getkeys(t->mailbox);
}
+ }
if (!found && (t = mutt_default_from()))
{
getkeys(t->mailbox);
if (sscanf(b, ANUM, &nntp_data->newsrc_ent[j].first) == 1 &&
sscanf(h, ANUM, &nntp_data->newsrc_ent[j].last) == 1)
+ {
j++;
+ }
}
if (j == 0)
{
if (mutt_socket_write(conn, "CAPABILITIES\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
/* no capabilities */
if (mutt_str_strncmp("101", buf, 3) != 0)
{
if (mutt_socket_write(conn, "DATE\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("500", buf, 3) != 0)
nserv->hasDATE = true;
if (mutt_socket_write(conn, "LISTGROUP\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("500", buf, 3) != 0)
nserv->hasLISTGROUP = true;
if (mutt_socket_write(conn, "LIST NEWSGROUPS +\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("500", buf, 3) != 0)
nserv->hasLIST_NEWSGROUPS = true;
if (mutt_str_strncmp("215", buf, 3) == 0)
{
if (mutt_socket_write(conn, "XGTITLE\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("500", buf, 3) != 0)
nserv->hasXGTITLE = true;
}
{
if (mutt_socket_write(conn, "XOVER\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("500", buf, 3) != 0)
nserv->hasXOVER = true;
}
{
if (mutt_socket_write(conn, "LIST OVERVIEW.FMT\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("215", buf, 3) != 0)
nserv->overview_fmt = OverviewFmt;
else
/* get login and password */
if ((mutt_account_getuser(&conn->account) < 0) || (conn->account.user[0] == '\0') ||
(mutt_account_getpass(&conn->account) < 0) || (conn->account.pass[0] == '\0'))
+ {
break;
+ }
/* get list of authenticators */
if (NntpAuthenticators && *NntpAuthenticators)
snprintf(buf, sizeof(buf), "AUTHINFO USER %s\r\n", conn->account.user);
if (mutt_socket_write(conn, buf) < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
break;
+ }
/* authenticated, password is not required */
if (mutt_str_strncmp("281", buf, 3) == 0)
snprintf(buf, sizeof(buf), "AUTHINFO PASS %s\r\n", conn->account.pass);
if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
break;
+ }
/* authenticated */
if (mutt_str_strncmp("281", buf, 3) == 0)
client_len = 0;
if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln_d(inbuf, sizeof(inbuf), conn, MUTT_SOCK_LOG_FULL) < 0)
+ {
break;
+ }
if ((mutt_str_strncmp(inbuf, "283 ", 4) != 0) &&
(mutt_str_strncmp(inbuf, "383 ", 4) != 0))
{
{
if (mutt_socket_write(conn, "*\r\n") < 0 ||
mutt_socket_readln(inbuf, sizeof(inbuf), conn) < 0)
+ {
break;
+ }
}
/* server doesn't support AUTHINFO SASL, trying next method */
{
if (mutt_socket_write(conn, "MODE READER\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("200", buf, 3) == 0)
posting = true;
{
if (mutt_socket_write(conn, "STARTTLS\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("382", buf, 3) != 0)
{
nserv->use_tls = 0;
{
if (mutt_socket_write(conn, "STAT\r\n") < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
if (mutt_str_strncmp("480", buf, 3) != 0)
auth = false;
}
snprintf(buf, sizeof(buf), "GROUP %s\r\n", nntp_data->group);
if (mutt_socket_write(nserv->conn, buf) < 0 ||
mutt_socket_readln(buf, sizeof(buf), nserv->conn) < 0)
+ {
return nntp_connect_error(nserv);
+ }
}
if (!*line)
break;
{
if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) &&
!rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0)
+ {
break;
+ }
}
if (i < rd.last_line)
{
if ((!rd.hide_quoted || (rd.has_types && rd.line_info[i].type != MT_COLOR_QUOTED)) &&
!rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0)
+ {
break;
+ }
}
if (i >= 0)
{
if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) &&
!rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0)
+ {
break;
+ }
}
if (i < rd.last_line)
{
if ((!rd.hide_quoted || rd.line_info[i].type != MT_COLOR_QUOTED) &&
!rd.line_info[i].continuation && rd.line_info[i].search_cnt > 0)
+ {
break;
+ }
}
if (i >= 0)
CHECK_ATTACH;
if (extra->ctx && extra->ctx->magic == MUTT_NNTP &&
!((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ {
break;
+ }
ci_send_message(SENDNEWS, NULL, NULL, extra->ctx, NULL);
pager_menu->redraw = REDRAW_FULL;
break;
CHECK_ATTACH;
if (extra->ctx && extra->ctx->magic == MUTT_NNTP &&
!((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ {
break;
+ }
if (IsMsgAttach(extra))
mutt_attach_forward(extra->fp, extra->hdr, extra->actx, extra->bdy, SENDNEWS);
else
{
if (extra->ctx && extra->ctx->magic == MUTT_NNTP &&
!((struct NntpData *) extra->ctx->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ {
break;
+ }
if (IsMsgAttach(extra))
mutt_attach_reply(extra->fp, extra->hdr, extra->actx, extra->bdy,
SENDNEWS | SENDREPLY);
return ENCBINARY;
else if (mutt_str_strncasecmp("quoted-printable", c,
sizeof("quoted-printable") - 1) == 0)
+ {
return ENCQUOTEDPRINTABLE;
+ }
else if (mutt_str_strncasecmp("base64", c, sizeof("base64") - 1) == 0)
return ENCBASE64;
else if (mutt_str_strncasecmp("x-uuencode", c, sizeof("x-uuencode") - 1) == 0)
case 'e':
if ((mutt_str_strcasecmp("xpires", line + 1) == 0) && hdr &&
mutt_date_parse_date(p, NULL) < time(NULL))
+ {
hdr->expired = true;
+ }
break;
case 'f':
if (bp->disposition == DISPINLINE && bp->type != TYPEMULTIPART &&
bp->type != TYPEMESSAGE && bp == body)
+ {
shallcount = false; /* ignore fundamental inlines */
+ }
/* If this body isn't scheduled for enumeration already, don't bother
* profiling it further.
return a;
if (right && t->parent &&
(a = match_threadcomplete(pat, flags, ctx, t->next, 0, 0, 1, 1)))
+ {
return a;
+ }
if (left && t->parent &&
(a = match_threadcomplete(pat, flags, ctx, t->prev, 1, 0, 0, 1)))
+ {
return a;
+ }
if (down && (a = match_threadcomplete(pat, flags, ctx, t->child, 1, 0, 1, 1)))
return a;
return 0;
/* convert old tokens into the new format */
if ((mutt_str_strcasecmp("all", s) == 0) || (mutt_str_strcmp("^", s) == 0) ||
(mutt_str_strcmp(".", s) == 0)) /* ~A is more efficient */
+ {
mutt_str_strfcpy(s, "~A", len);
+ }
else if (mutt_str_strcasecmp("del", s) == 0)
mutt_str_strfcpy(s, "~D", len);
else if (mutt_str_strcasecmp("flag", s) == 0)
{
if (sig->sigtype == 0x10 || sig->sigtype == 0x11 || sig->sigtype == 0x12 ||
sig->sigtype == 0x13)
+ {
printf("sig::::%08lX%08lX::::::%X:\n", sig->sid1, sig->sid2, sig->sigtype);
+ }
else if (sig->sigtype == 0x20)
+ {
printf("rev::::%08lX%08lX::::::%X:\n", sig->sid1, sig->sid2, sig->sigtype);
+ }
}
}
#endif
for (int i = 0; i < ctx->msgcount; i++)
+ {
/* if the id we get is known for a header: done (i.e. keep in cache) */
if (ctx->hdrs[i]->data && (mutt_str_strcmp(ctx->hdrs[i]->data, id) == 0))
return 0;
+ }
/* message not found in context -> remove it from cache
* return the result of bcache, so we stop upon its first error
if ((mutt_account_getuser(acct) < 0) || (acct->user[0] == '\0') ||
(mutt_account_getpass(acct) < 0) || (acct->pass[0] == '\0'))
+ {
return -3;
+ }
if (PopAuthenticators && *PopAuthenticators)
{
attempts++;
if (ret == POP_A_SUCCESS || ret == POP_A_SOCKET ||
(ret == POP_A_FAILURE && !option(OPT_POP_AUTH_TRY_ALL)))
+ {
break;
+ }
authenticator++;
}
if ((WithCrypto & APPLICATION_PGP) && (crypt_app == APPLICATION_PGP) &&
(flags & SIGN) && (set_empty_signas || *sign_as))
+ {
mutt_str_replace(&PgpSignAs, sign_as);
+ }
if ((WithCrypto & APPLICATION_SMIME) && (crypt_app == APPLICATION_SMIME) &&
(flags & SIGN) && (set_empty_signas || *sign_as))
+ {
mutt_str_replace(&SmimeDefaultKey, sign_as);
+ }
return flags;
}
{
if (table[n].data->addr->personal &&
!regexec(re, table[n].data->addr->personal, 0, NULL, 0))
+ {
return 0;
+ }
if (table[n].data->addr->mailbox &&
!regexec(re, table[n].data->addr->mailbox, 0, NULL, 0))
+ {
return 0;
+ }
}
return REG_NOMATCH;
struct Address *naddr = NULL;
for (i = 0; i < menu->max; i++)
+ {
if (QueryTable[i].tagged)
{
struct Address *a = result_to_addr(QueryTable[i].data);
rfc822_append(&naddr, a, 0);
rfc822_free_address(&a);
}
+ }
mutt_create_alias(NULL, naddr);
rfc822_free_address(&naddr);
{
if (mutt_is_text_part(aptr->content) &&
mutt_get_body_charset(charset, sizeof(charset), aptr->content))
+ {
mutt_format_s(dest, destlen, prefix, charset);
+ }
else
mutt_format_s(dest, destlen, prefix, "");
}
else if (!mutt_is_text_part(aptr->content) ||
!mutt_get_body_charset(charset, sizeof(charset), aptr->content))
+ {
optional = 0;
+ }
break;
case 'c':
/* XXX */
}
else if (body->hdr && body->encoding != ENCBASE64 && body->encoding != ENCQUOTEDPRINTABLE &&
mutt_is_message_type(body->type, body->subtype))
+ {
mutt_default_save(buf, sizeof(buf), body->hdr);
+ }
else
buf[0] = 0;
if (mutt_get_field(_("Save to file: "), buf, sizeof(buf), MUTT_FILE | MUTT_CLEAR) != 0 ||
!buf[0])
+ {
return;
+ }
mutt_expand_path(buf, sizeof(buf));
if (mutt_check_overwrite(top->filename, buf, tfile, sizeof(tfile), &append, NULL))
return;
{
if ((mutt_str_strcasecmp("text/plain", top->subtype) == 0) ||
(mutt_str_strcasecmp("application/postscript", top->subtype) == 0))
+ {
pipe_attachment(fp, top, state);
+ }
else if (mutt_can_decode(top))
{
/* decode and print */
{
if (option(OPT_DIGEST_COLLAPSE) && actx->idx[rindex]->content->type == TYPEMULTIPART &&
!mutt_str_strcasecmp(actx->idx[rindex]->content->subtype, "digest"))
+ {
actx->idx[rindex]->content->collapsed = true;
+ }
else
+ {
actx->idx[rindex]->content->collapsed = false;
+ }
rindex++;
}
}
if ((!cur || mutt_can_decode(cur)) &&
(rc = query_quadoption(OPT_MIME_FORWARD, _("Forward as attachments?"))) == MUTT_YES)
+ {
mime_fwd_all = true;
+ }
else if (rc == -1)
+ {
goto bail;
+ }
/*
* shortcut MIMEFWDREST when there is only one attachment. Is
else
{
for (short i = 0; i < actx->idxlen; i++)
+ {
if (actx->idx[i]->content->tagged)
{
curhdr = actx->idx[i]->content->hdr;
break;
}
+ }
}
tmphdr = mutt_new_header();
else
{
for (short i = 0; i < actx->idxlen; i++)
+ {
if (actx->idx[i]->content->tagged)
{
mutt_copy_body(actx->idx[i]->fp, last, actx->idx[i]->content);
last = &((*last)->next);
}
+ }
}
}
else
/* in case followup set Newsgroups: with Followup-To: if it present */
if (!env->newsgroups && curenv &&
(mutt_str_strcasecmp(curenv->followup_to, "poster") != 0))
+ {
env->newsgroups = mutt_str_strdup(curenv->followup_to);
+ }
}
else
#endif
{
if (actx->idx[i]->content->tagged &&
mutt_fetch_recips(env, actx->idx[i]->content->hdr->env, flags) == -1)
+ {
return -1;
+ }
}
}
t++;
if (!try_block(t0, t - t0, icode, tocode, &encoder, &wlen) &&
col + (t0 - u) + wlen <= ENCWORD_LEN_MAX + 1)
+ {
break;
+ }
}
/* Adjust t1 until we can encode a character before a space. */
t--;
if (!try_block(t, t1 - t, icode, tocode, &encoder, &wlen) &&
1 + wlen + (u + ulen - t1) <= ENCWORD_LEN_MAX + 1)
+ {
break;
+ }
}
/* We shall encode the region [t0,t1). */
{
if (a->personal &&
((strstr(a->personal, "=?") != NULL) || (AssumedCharset && *AssumedCharset)))
+ {
rfc2047_decode(&a->personal);
+ }
else if (a->group && a->mailbox && (strstr(a->mailbox, "=?") != NULL))
rfc2047_decode(&a->mailbox);
a = a->next;
sprintf(e, "%s''", charset);
t = e + strlen(e);
for (s = d, slen = dlen; slen; s++, slen--)
+ {
if (*s < 0x20 || *s >= 0x7f || strchr(MimeSpecials, *s) || strchr("*'%", *s))
{
sprintf(t, "%%%02X", (unsigned char) *s);
t += 3;
}
else
+ {
*t++ = *s;
+ }
+ }
*t = '\0';
if (d != *pd)
char *p = NULL;
for (; addr; addr = addr->next)
+ {
if (!addr->group && addr->mailbox && strchr(addr->mailbox, '@') == NULL)
{
p = mutt_mem_malloc(mutt_str_strlen(addr->mailbox) + mutt_str_strlen(host) + 2);
FREE(&addr->mailbox);
addr->mailbox = p;
}
+ }
}
/**
buf[0] = 0;
if (option(OPT_ASK_FOLLOW_UP) &&
mutt_get_field("Followup-To: ", buf, sizeof(buf), 0) != 0)
+ {
return -1;
+ }
FREE(&en->followup_to);
en->followup_to = mutt_str_strdup(buf);
buf[0] = 0;
if (option(OPT_X_COMMENT_TO) && option(OPT_ASK_X_COMMENT_TO) &&
mutt_get_field("X-Comment-To: ", buf, sizeof(buf), 0) != 0)
+ {
return -1;
+ }
FREE(&en->x_comment_to);
en->x_comment_to = mutt_str_strdup(buf);
}
if (in->mail_followup_to && hmfupto == MUTT_YES &&
default_to(&out->cc, in, flags & SENDLISTREPLY, hmfupto) == MUTT_ABORT)
+ {
return -1; /* abort */
+ }
}
else
{
discouraged by RFC2822, sect. 3.6.4 */
if (ctx->tagged > 0 && !STAILQ_EMPTY(&env->in_reply_to) &&
STAILQ_NEXT(STAILQ_FIRST(&env->in_reply_to), entries))
+ {
mutt_list_free(&env->references);
+ }
}
static int envelope_defaults(struct Envelope *env, struct Context *ctx,
/* in case followup set Newsgroups: with Followup-To: if it present */
if (!env->newsgroups &&
(mutt_str_strcasecmp(curenv->followup_to, "poster") != 0))
+ {
env->newsgroups = mutt_str_strdup(curenv->followup_to);
+ }
}
else
#endif
{
if ((flags & (SENDREPLY | SENDFORWARD)) && ctx &&
envelope_defaults(msg->env, ctx, cur, flags) == -1)
+ {
goto cleanup;
+ }
if (option(OPT_HDRS))
process_user_recips(msg->env);
{
if (option(OPT_TEXT_FLOWED) && msg->content->type == TYPETEXT &&
(mutt_str_strcasecmp(msg->content->subtype, "plain") == 0))
+ {
mutt_set_parameter("format", "flowed", &msg->content->parameter);
+ }
}
/* $use_from and/or $from might have changed in a send-hook */
if (option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
Editor && (mutt_str_strcmp(Editor, "builtin") != 0))
+ {
append_signature(tempfp);
+ }
/* include replies/forwarded messages, unless we are given a template */
if (!tempfile && (ctx || !(flags & (SENDREPLY | SENDFORWARD))) &&
generate_body(tempfp, msg, flags, ctx, cur) == -1)
+ {
goto cleanup;
+ }
if (!option(OPT_SIG_ON_TOP) && !(flags & (SENDMAILX | SENDKEY | SENDBATCH)) &&
Editor && (mutt_str_strcmp(Editor, "builtin") != 0))
+ {
append_signature(tempfp);
+ }
}
/*
{
if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP) &&
(cur->security & APPLICATION_PGP))
+ {
msg->security |= APPLICATION_PGP;
+ }
else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) &&
(cur->security & APPLICATION_SMIME))
+ {
msg->security |= APPLICATION_SMIME;
+ }
}
/*
{
if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME) &&
option(OPT_SMIME_IS_DEFAULT))
+ {
msg->security |= APPLICATION_SMIME;
+ }
else if ((WithCrypto & APPLICATION_PGP) && option(OPT_CRYPT_AUTOPGP))
+ {
msg->security |= APPLICATION_PGP;
+ }
else if ((WithCrypto & APPLICATION_SMIME) && option(OPT_CRYPT_AUTOSMIME))
+ {
msg->security |= APPLICATION_SMIME;
+ }
}
}
char *chsname = mutt_get_body_charset(send_charset, sizeof(send_charset), b);
if ((info->lobin && (mutt_str_strncasecmp(chsname, "iso-2022", 8) != 0)) ||
info->linemax > 990 || (info->from && option(OPT_ENCODE_FROM)))
+ {
b->encoding = ENCQUOTEDPRINTABLE;
+ }
else if (info->hibin)
+ {
b->encoding = option(OPT_ALLOW_8BIT) ? ENC8BIT : ENCQUOTEDPRINTABLE;
+ }
else
+ {
b->encoding = ENC7BIT;
+ }
}
else if (b->type == TYPEMESSAGE || b->type == TYPEMULTIPART)
{
}
else if (b->type == TYPEAPPLICATION &&
(mutt_str_strcasecmp(b->subtype, "pgp-keys") == 0))
+ {
b->encoding = ENC7BIT;
+ }
else
{
/* Determine which encoding is smaller */
if (1.33 * (float) (info->lobin + info->hibin + info->ascii) <
3.0 * (float) (info->lobin + info->hibin) + (float) info->ascii)
+ {
b->encoding = ENCBASE64;
+ }
else
+ {
b->encoding = ENCQUOTEDPRINTABLE;
+ }
}
}
if (!att->subtype && MimeTypeQueryCommand && *MimeTypeQueryCommand &&
!option(OPT_MIME_TYPE_QUERY_FIRST))
+ {
run_mime_type_query(att);
+ }
info = mutt_get_content_info(path, att);
if (!info)
if ((p = mutt_get_parameter("boundary", b->parameter)) &&
(mutt_str_strcmp(p, boundary) == 0))
+ {
return true;
+ }
return false;
}
if ((i == OpnIndex) || (sbe->buffy->msg_unread > 0) || sbe->buffy->new ||
(sbe->buffy->msg_flagged > 0))
+ {
continue;
+ }
if (Context && (mutt_str_strcmp(sbe->buffy->realpath, Context->realpath) == 0))
+ {
/* Spool directory */
continue;
+ }
if (mutt_list_find(&SidebarWhitelist, sbe->buffy->path) ||
mutt_list_find(&SidebarWhitelist, sbe->buffy->desc))
+ {
/* Explicitly asked to be visible */
continue;
+ }
sbe->is_hidden = true;
}
SETCOLOR(MT_COLOR_FLAGGED);
else if ((ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) &&
(mutt_str_strcmp(b->path, SpoolFile) == 0))
+ {
SETCOLOR(MT_COLOR_SB_SPOOLFILE);
+ }
else
{
if (ColorDefs[MT_COLOR_ORDINARY] != 0)
/* send the recipient list */
if ((ret = smtp_rcpt_to(conn, to)) || (ret = smtp_rcpt_to(conn, cc)) ||
(ret = smtp_rcpt_to(conn, bcc)))
+ {
break;
+ }
/* send the message data */
if ((ret = smtp_data(conn, msgfile)))
{
if (!tree->visible && tree->deep && tree->subtree_visible < 2 &&
((tree->message && hide_top_limited) || (!tree->message && hide_top_missing)))
+ {
tree->deep = false;
+ }
if (!tree->deep && tree->child && tree->subtree_visible)
tree = tree->child;
else if (tree->next)