imap_check_mailbox (ctx, NULL);
conn = mutt_socket_head (); while (conn) { if (conn->account.type == M_ACCT_TYPE_IMAP) { idata = (IMAP_DATA*) conn->data;  if (idata->state >= IMAP_AUTHENTICATED && time(NULL) >= idata->lastread + ImapKeepalive) { if (idata->ctx) ctx = idata->ctx; else { ctx = safe_calloc (1, sizeof (CONTEXT)); ctx->data = idata; } imap_check_mailbox (ctx, NULL, 1); if (!idata->ctx) FREE (&ctx); } }  conn = conn->next; }
void imap_keepalive (void){  CONTEXT *ctx = Context;    if (ctx == NULL || ctx->magic != M_IMAP || CTX_DATA->ctx != ctx)    return;  imap_check_mailbox (ctx, NULL);}