Mark the time of an error message.
Do not allow an error to be cleared or overwritten by a normal message
within one second.
compose.o compress.o conststrings.o copy.o curs_lib.o \
curs_main.o edit.o editmsg.o enter.o envelope.o filter.o \
flags.o from.o group.o handler.o hdrline.o \
- header.o help.o history.o hook.o init.o keymap.o main.o \
+ header.o help.o history.o hook.o init.o keymap.o mutt_logging.o main.o \
mbox.o menu.o mh.o muttlib.o \
mutt_socket.o tags.o mx.o \
newsrc.o nntp.o pager.o parse.o pattern.o pop.o \
if (mutt_addrlist_to_intl(new->addr, &err))
{
mutt_error(_("Error: '%s' is a bad IDN."), err);
- mutt_sleep(2);
continue;
}
} while (!new->addr);
mutt_debug(1, "mutt_file_fopen(%s) errno=%d %s\n", pagerfile, errno,
strerror(errno));
mutt_perror(pagerfile);
- mutt_sleep(1);
goto return_error;
}
decode_state.fpin = fp;
if (!s.fpout)
{
mutt_perror("fopen");
- mutt_sleep(2);
return -1;
}
fseeko((s.fpin = fp), m->offset, SEEK_SET);
if (mutt_file_fsync_close(&s.fpout) != 0)
{
mutt_perror("fclose");
- mutt_sleep(2);
return -1;
}
}
if (!h->env->from)
{
mutt_error(_("Warning: message contains no From: header"));
- mutt_sleep(2);
}
}
else if (Context)
if (message_is_tagged(Context, rc) && !Context->hdrs[rc]->env->from)
{
mutt_error(_("Warning: message contains no From: header"));
- mutt_sleep(2);
break;
}
}
if (rc != SASL_OK)
{
mutt_error(_("Error allocating SASL connection"));
- mutt_sleep(2);
return -1;
}
{
const int save_errno = errno;
mutt_perror(_("Preconnect command failed."));
- mutt_sleep(1);
return save_errno;
}
if (conn->available == 0)
{
mutt_error(_("Connection to %s closed"), conn->account.host);
- mutt_sleep(2);
}
if (conn->available <= 0)
{
if (rc == -1)
{
mutt_error(_("Error talking to %s (%s)"), conn->account.host, strerror(errno));
- mutt_sleep(2);
SigInt = 0;
}
mutt_sig_allow_interrupt(0);
if (SigInt)
{
mutt_error(_("Connection to %s has been aborted"), conn->account.host);
- mutt_sleep(2);
SigInt = 0;
rc = -1;
}
if (rc == -1)
{
mutt_error(_("Error talking to %s (%s)"), conn->account.host, strerror(errno));
- mutt_sleep(2);
SigInt = 0;
}
mutt_sig_allow_interrupt(0);
if (SigInt)
{
mutt_error(_("Connection to %s has been aborted"), conn->account.host);
- mutt_sleep(2);
SigInt = 0;
rc = -1;
}
if (rc)
{
mutt_error(_("Could not find the host \"%s\""), conn->account.host);
- mutt_sleep(2);
return -1;
}
{
mutt_error(_("Could not connect to %s (%s)."), conn->account.host,
(rc > 0) ? strerror(rc) : _("unknown error"));
- mutt_sleep(2);
return -1;
}
((st.st_mode & (S_IWOTH | S_IROTH)) != 0))
{
mutt_error(_("%s has insecure permissions!"), file);
- mutt_sleep(2);
return -1;
}
static int ssl_socket_open_err(struct Connection *conn)
{
mutt_error(_("SSL disabled due to the lack of entropy"));
- mutt_sleep(2);
return -1;
}
{
mutt_debug(2, "Server certificate is not yet valid\n");
mutt_error(_("Server certificate is not yet valid"));
- mutt_sleep(2);
}
return false;
}
{
mutt_debug(2, "Server certificate has expired\n");
mutt_error(_("Server certificate has expired"));
- mutt_sleep(2);
}
return false;
}
if (!HAVE_ENTROPY())
{
mutt_error(_("Failed to find enough entropy on your system"));
- mutt_sleep(2);
return -1;
}
}
if (!done)
{
mutt_error(_("Warning: Couldn't save certificate"));
- mutt_sleep(2);
}
else
{
if (!check_host(cert, host, buf, sizeof(buf)))
{
mutt_error(_("Certificate host check failed: %s"), buf);
- mutt_sleep(2);
/* we disallow (a)ccept always in the prompt, because it will have no effect
* for hostname mismatches. */
return interactive_check_cert(cert, pos, len, ssl, 0);
* TLS Server Name Indication (SNI). This allows the server to present
* the correct certificate if it supports multiple hosts. */
mutt_error(_("Warning: unable to set TLS SNI host name"));
- mutt_sleep(1);
}
ERR_clear_error();
}
mutt_error(_("SSL failed: %s"), errmsg);
- mutt_sleep(1);
return -1;
}
if (ssl_set_verify_partial(data->ctx))
{
mutt_error(_("Warning: error enabling ssl_verify_partial_chains"));
- mutt_sleep(2);
}
data->ssl = SSL_new(data->ctx);
if (ssl_set_verify_partial(ssldata->ctx))
{
mutt_error(_("Warning: error enabling ssl_verify_partial_chains"));
- mutt_sleep(2);
}
ssldata->ssl = SSL_new(ssldata->ctx);
if (err < 0)
{
mutt_error("gnutls_global_init: %s", gnutls_strerror(err));
- mutt_sleep(2);
return -1;
}
if (!data)
{
mutt_error(_("Error: no TLS socket open"));
- mutt_sleep(2);
return -1;
}
if ((rc < 0 && gnutls_error_is_fatal(rc) == 1) || rc == GNUTLS_E_INTERRUPTED)
{
mutt_error("tls_socket_read (%s)", gnutls_strerror(rc));
- mutt_sleep(2);
return -1;
}
} while (rc == GNUTLS_E_AGAIN);
if (!data)
{
mutt_error(_("Error: no TLS socket open"));
- mutt_sleep(2);
return -1;
}
if (gnutls_error_is_fatal(ret) == 1 || ret == GNUTLS_E_INTERRUPTED)
{
mutt_error("tls_socket_write (%s)", gnutls_strerror(ret));
- mutt_sleep(4);
return -1;
}
return ret;
if (status == GNUTLS_E_NO_CERTIFICATE_FOUND)
{
mutt_error(_("Unable to get certificate from peer"));
- mutt_sleep(2);
return 0;
}
if (verify_ret < 0)
{
mutt_error(_("Certificate verification error (%s)"), gnutls_strerror(status));
- mutt_sleep(2);
return 0;
}
if (gnutls_certificate_type_get(tlsstate) != GNUTLS_CRT_X509)
{
mutt_error(_("Certificate is not X.509"));
- mutt_sleep(2);
return 0;
}
if (gnutls_x509_crt_init(&cert) < 0)
{
mutt_error(_("Error initialising gnutls certificate data"));
- mutt_sleep(2);
return -1;
}
if (gnutls_x509_crt_import(cert, certdata, GNUTLS_X509_FMT_DER) < 0)
{
mutt_error(_("Error processing certificate data"));
- mutt_sleep(2);
gnutls_x509_crt_deinit(cert);
return -1;
}
{
mutt_error(_("Warning: Server certificate was signed using an insecure "
"algorithm"));
- mutt_sleep(2);
}
return 0;
}
if (gnutls_x509_crt_init(&cert) < 0)
{
mutt_error(_("Error initialising gnutls certificate data"));
- mutt_sleep(2);
return 0;
}
if (gnutls_x509_crt_import(cert, certdata, GNUTLS_X509_FMT_DER) < 0)
{
mutt_error(_("Error processing certificate data"));
- mutt_sleep(2);
gnutls_x509_crt_deinit(cert);
return 0;
}
if (!done)
{
mutt_error(_("Warning: Couldn't save certificate"));
- mutt_sleep(2);
}
else
{
if (gnutls_auth_get_type(state) != GNUTLS_CRD_CERTIFICATE)
{
mutt_error(_("Unable to get certificate from peer"));
- mutt_sleep(2);
return 0;
}
if (!cert_list)
{
mutt_error(_("Unable to get certificate from peer"));
- mutt_sleep(2);
return 0;
}
if (err < 0)
{
mutt_error("gnutls_priority_set_direct(%s): %s", priority, gnutls_strerror(err));
- mutt_sleep(2);
FREE(&priority);
return -1;
}
{
mutt_error(
_("Explicit ciphersuite selection via $ssl_ciphers not supported"));
- mutt_sleep(2);
}
/* We use default priorities (see gnutls documentation),
{
FREE(&conn->sockdata);
mutt_error("gnutls_certificate_allocate_credentials: %s", gnutls_strerror(err));
- mutt_sleep(2);
return -1;
}
if (err)
{
mutt_error("gnutls_handshake: %s", gnutls_strerror(err));
- mutt_sleep(2);
goto fail;
}
mutt_str_strlen(conn->account.host)))
{
mutt_error(_("Warning: unable to set TLS SNI host name"));
- mutt_sleep(1);
}
if (tls_set_priority(data) < 0)
{
mutt_error("gnutls_handshake: %s", gnutls_strerror(err));
}
- mutt_sleep(2);
goto fail;
}
{
mutt_error(_("Tunnel to %s returned error %d (%s)"), conn->account.host,
WEXITSTATUS(status), NONULL(mutt_str_sysexit(WEXITSTATUS(status))));
- mutt_sleep(2);
}
FREE(&conn->sockdata);
if (rc == -1)
{
mutt_error(_("Tunnel error talking to %s: %s"), conn->account.host, strerror(errno));
- mutt_sleep(1);
}
return rc;
if (rc == -1)
{
mutt_error(_("Tunnel error talking to %s: %s"), conn->account.host, strerror(errno));
- mutt_sleep(1);
}
return rc;
{
mutt_error("The length calculation was wrong by %ld bytes", fail);
new_length += fail;
- mutt_sleep(1);
}
/* Update original message if we are sync'ing a mailfolder */
#include "globals.h"
#include "header.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "opcodes.h"
#include "options.h"
return rc;
}
-void mutt_clear_error(void)
-{
- ErrorBuf[0] = 0;
- if (!OPT_NO_CURSES)
- mutt_window_clearline(MuttMessageWindow, 0);
-}
-
void mutt_edit_file(const char *editor, const char *data)
{
char cmd[LONG_STRING];
if (mutt_system(cmd) != 0)
{
mutt_error(_("Error running \"%s\"!"), cmd);
- mutt_sleep(2);
}
/* the terminal may have been resized while the editor owned it */
mutt_resize_screen();
vsnprintf(scratch, sizeof(scratch), fmt, ap);
+ /* Only pause if this is a message following an error */
+ if (!error && OPT_MSG_ERR)
+ error_pause();
+
mutt_debug(1, "%s\n", scratch);
mutt_simple_format(ErrorBuf, sizeof(ErrorBuf), 0, MuttMessageWindow->cols,
FMT_LEFT, 0, scratch, sizeof(scratch), 0);
}
if (error)
+ {
OPT_MSG_ERR = true;
+ if (gettimeofday(&LastError, NULL) < 0)
+ mutt_debug(1, "gettimeofday failed: %d\n", errno);
+ }
else
+ {
OPT_MSG_ERR = false;
+ LastError.tv_sec = 0;
+ }
}
void mutt_curses_error(const char *fmt, ...)
return true;
mutt_error(_("Can't create %s: %s."), dir, strerror(errno));
- mutt_sleep(2);
return false;
}
{
mutt_error("%s", err.data);
FREE(&token.data);
- mutt_sleep(1); /* pause a moment to let the user see the error */
current_hook_type = 0;
FREE(&err.data);
{
FREE(&token.data);
mutt_error("%s", err.data);
- mutt_sleep(1);
current_hook_type = 0;
FREE(&err.data);
FREE(&token.data);
mutt_error("%s", err.data);
FREE(&err.data);
- mutt_sleep(1);
inhook = false;
return;
if (mutt_parse_rc_line(hook->command, &token, &err) == -1)
{
mutt_error("%s", err.data);
- mutt_sleep(1);
/* The hooks should be independent of each other, so even though this on
* failed, we'll carry on with the others. */
if (mutt_parse_rc_line(hook->command, &token, &err) == -1)
{
mutt_error("%s", err.data);
- mutt_sleep(1);
}
}
FREE(&token.data);
if (r == IMAP_AUTH_UNAVAIL)
{
mutt_error(_("No authenticators available"));
- mutt_sleep(1);
}
return r;
bail:
mutt_error(_("Anonymous authentication failed."));
- mutt_sleep(2);
return IMAP_AUTH_FAILURE;
}
bail:
mutt_error(_("CRAM-MD5 authentication failed."));
- mutt_sleep(2);
return IMAP_AUTH_FAILURE;
}
bail:
mutt_error(_("GSSAPI authentication failed."));
- mutt_sleep(2);
return IMAP_AUTH_FAILURE;
}
}
mutt_error(_("Login failed."));
- mutt_sleep(2);
return IMAP_AUTH_FAILURE;
}
else if (rc == IMAP_CMD_NO)
{
mutt_error(_("Login failed."));
- mutt_sleep(2);
res = IMAP_AUTH_FAILURE;
}
}
mutt_error(_("SASL authentication failed."));
- mutt_sleep(2);
return IMAP_AUTH_FAILURE;
}
if (!mutt_str_strlen(buf))
{
mutt_error(_("Mailbox must have a name."));
- mutt_sleep(1);
goto fail;
}
if (!mutt_str_strlen(newname))
{
mutt_error(_("Mailbox must have a name."));
- mutt_sleep(1);
goto fail;
}
if (imap_rename_mailbox(idata, &mx, buf) < 0)
{
mutt_error(_("Rename failed: %s"), imap_get_qualifier(idata->buf));
- mutt_sleep(1);
goto fail;
}
mutt_socket_close(idata->conn);
mutt_error(_("Mailbox %s@%s closed"), idata->conn->account.login,
idata->conn->account.host);
- mutt_sleep(1);
idata->state = IMAP_DISCONNECTED;
}
s += 3;
SKIPWS(s);
mutt_error("%s", s);
- mutt_sleep(2);
cmd_handle_fatal(idata);
return -1;
/* Display the warning message from the server */
mutt_error("%s", s + 3);
- mutt_sleep(2);
}
return 0;
(mutt_socket_poll(idata->conn, ImapPollTimeout)) == 0)
{
mutt_error(_("Connection to %s timed out"), idata->conn->account.host);
- mutt_sleep(2);
cmd_handle_fatal(idata);
return -1;
}
if ((ImapPollTimeout > 0) && (mutt_socket_poll(idata->conn, ImapPollTimeout)) == 0)
{
mutt_error(_("Connection to %s timed out"), idata->conn->account.host);
- mutt_sleep(2);
cmd_handle_fatal(idata);
return -1;
}
{
mutt_error(
_("This IMAP server is ancient. NeoMutt does not work with it."));
- mutt_sleep(2); /* pause a moment to let the user see the error */
-
return -1;
}
if (mutt_ssl_starttls(idata->conn))
{
mutt_error(_("Could not negotiate TLS connection"));
- mutt_sleep(1);
goto err_close_conn;
}
else
if (SslForceTls && !idata->conn->ssf)
{
mutt_error(_("Encrypted connection unavailable"));
- mutt_sleep(1);
goto err_close_conn;
}
#endif
s = imap_next_word(idata->buf); /* skip seq */
s = imap_next_word(s); /* Skip response */
mutt_error("%s", s);
- mutt_sleep(2);
goto fail;
}
if (count && (imap_read_headers(idata, 1, count) < 0))
{
mutt_error(_("Error opening mailbox"));
- mutt_sleep(1);
goto fail;
}
if (rc < 0)
{
mutt_error(_("Expunge failed"));
- mutt_sleep(1);
goto out;
}
*checker == 93) // ]
{
mutt_error(_("Invalid IMAP flags"));
- mutt_sleep(2);
return 0;
}
if (msn_count >= (UINT_MAX / sizeof(struct Header *)))
{
mutt_error(_("Integer overflow -- can't allocate memory."));
- sleep(1);
mutt_exit(1);
}
else
{ /* Unable to fetch headers for lower versions */
mutt_error(_("Unable to fetch headers from this IMAP server version."));
- mutt_sleep(2); /* pause a moment to let the user see the error */
goto error_out_0;
}
if (!fp)
{
mutt_error(_("Could not create temporary file %s"), tempfile);
- mutt_sleep(2);
goto error_out_0;
}
unlink(tempfile);
SKIPWS(pc);
pc = imap_next_word(pc);
mutt_error("%s", pc);
- mutt_sleep(1);
mutt_file_fclose(&fp);
goto fail;
}
SKIPWS(pc);
pc = imap_next_word(pc);
mutt_error("%s", pc);
- mutt_sleep(1);
goto fail;
}
void imap_error(const char *where, const char *msg)
{
mutt_error("%s [%s]\n", where, msg);
- mutt_sleep(2);
}
/**
unlink(tempfile);
}
mutt_error(_("Could not create temporary file!"));
- mutt_sleep(5);
goto bail;
}
*/
mutt_error(
_("sync: mbox modified, but no modified messages! (report this bug)"));
- mutt_sleep(5); /* the mutt_error /will/ get cleared! */
mutt_debug(1, "no modified messages.\n");
unlink(tempfile);
goto bail;
if (fputs(MMDF_SEP, fp) == EOF)
{
mutt_perror(tempfile);
- mutt_sleep(5);
unlink(tempfile);
goto bail;
}
CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0)
{
mutt_perror(tempfile);
- mutt_sleep(5);
unlink(tempfile);
goto bail;
}
if (fputs(MMDF_SEP, fp) == EOF)
{
mutt_perror(tempfile);
- mutt_sleep(5);
unlink(tempfile);
goto bail;
}
if (fputs("\n", fp) == EOF)
{
mutt_perror(tempfile);
- mutt_sleep(5);
unlink(tempfile);
goto bail;
}
mutt_debug(1, "mutt_file_fclose (&) returned non-zero.\n");
unlink(tempfile);
mutt_perror(tempfile);
- mutt_sleep(5);
goto bail;
}
fp = NULL;
if (stat(ctx->path, &statbuf) == -1)
{
mutt_perror(ctx->path);
- mutt_sleep(5);
unlink(tempfile);
goto bail;
}
mx_fastclose_mailbox(ctx);
mutt_debug(1, "unable to reopen temp copy of mailbox!\n");
mutt_perror(tempfile);
- mutt_sleep(5);
FREE(&new_offset);
FREE(&old_offset);
return -1;
mx_fastclose_mailbox(ctx);
mutt_pretty_mailbox(savefile, sizeof(savefile));
mutt_error(_("Write failed! Saved partial mailbox to %s"), savefile);
- mutt_sleep(5);
FREE(&new_offset);
FREE(&old_offset);
return -1;
if (nmemb > (SIZE_MAX / size))
{
mutt_error(_("Integer overflow -- can't allocate memory!"));
- sleep(1);
mutt_exit(1);
}
if (!p)
{
mutt_error(_("Out of memory!"));
- sleep(1);
mutt_exit(1);
}
return p;
if (!p)
{
mutt_error(_("Out of memory!"));
- sleep(1);
mutt_exit(1);
}
return p;
if (!r)
{
mutt_error(_("Out of memory!"));
- sleep(1);
mutt_exit(1);
}
--- /dev/null
+/**
+ * @file
+ * Mutt Logging
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @page mutt_logging Mutt Logging
+ *
+ * Mutt Logging
+ *
+ * | File | Description
+ * | :------------------- | :-----------------------------------------------
+ * | mutt_clear_error() | Clear the message line (bottom line of screen)
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <limits.h>
+#include <sys/time.h>
+#include <time.h>
+#include "mutt/mutt.h"
+#include "globals.h"
+#include "mutt_curses.h"
+
+struct timeval LastError = { 0 };
+
+/**
+ * micro_elapsed - Number of microseconds between two timevals
+ * @param begin Begin time
+ * @param end End time
+ * @retval num Microseconds elapsed
+ * @retval LONG_MAX Begin time was zero
+ */
+static long micro_elapsed(const struct timeval *begin, const struct timeval *end)
+{
+ if ((begin->tv_sec == 0) && (end->tv_sec != 0))
+ return LONG_MAX;
+
+ return ((end->tv_sec - begin->tv_sec) * 1000000) + (end->tv_usec - begin->tv_usec);
+}
+
+/**
+ * error_pause - Wait for an error message to be read
+ *
+ * If a second hasn't elapsed since LastError, then wait.
+ */
+void error_pause(void)
+{
+ struct timeval now = { 0 };
+
+ if (gettimeofday(&now, NULL) < 0)
+ {
+ mutt_debug(1, "gettimeofday failed: %d\n", errno);
+ return;
+ }
+
+ long micro = micro_elapsed(&LastError, &now);
+ if (micro >= 1000000)
+ return;
+
+ struct timespec wait = { 0 };
+ wait.tv_nsec = 1000000000 - (micro * 10);
+
+ mutt_refresh();
+ nanosleep(&wait, NULL);
+}
+
+/**
+ * mutt_clear_error - Clear the message line (bottom line of screen)
+ */
+void mutt_clear_error(void)
+{
+ /* Make sure the error message has had time to be read */
+ if (OPT_MSG_ERR)
+ error_pause();
+
+ ErrorBuf[0] = 0;
+ if (!OPT_NO_CURSES)
+ mutt_window_clearline(MuttMessageWindow, 0);
+}
+
--- /dev/null
+/**
+ * @file
+ * Mutt Logging
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _LOGGING2_H
+#define _LOGGING2_H
+
+#include <sys/time.h>
+
+extern struct timeval LastError;
+
+void mutt_clear_error(void);
+void error_pause(void);
+
+#endif /* _LOGGING2_H */
if ((ctx->hdrmax + 25) * s < ctx->hdrmax * s)
{
mutt_error(_("Integer overflow -- can't allocate memory."));
- sleep(1);
mutt_exit(1);
}
if (err)
{
mutt_error(_("error creating gpgme context: %s\n"), gpgme_strerror(err));
- sleep(2);
mutt_exit(1);
}
if (err)
{
mutt_error(_("error enabling CMS protocol: %s\n"), gpgme_strerror(err));
- sleep(2);
mutt_exit(1);
}
}
if (err)
{
mutt_error(_("error creating gpgme data object: %s\n"), gpgme_strerror(err));
- sleep(2);
mutt_exit(1);
}
return data;
if (err)
{
mutt_error(_("error setting PKA signature notation: %s\n"), gpgme_strerror(err));
- mutt_sleep(2);
}
return err;
{
mutt_file_fclose(&in);
mutt_error(_("error allocating data object: %s\n"), gpgme_strerror(err));
- mutt_sleep(1);
return;
}
if (pgp_gpgme_extract_keys(keydata, &out, 0))
{
mutt_error(_("Error extracting key data!\n"));
- mutt_sleep(1);
}
gpgme_data_release(keydata);
mutt_file_fclose(&in);
else
{
mutt_error(_("Could not decrypt PGP message"));
- mutt_sleep(2);
rc = -1;
}
if (!i && unusable)
{
mutt_error(_("All matching keys are marked expired/revoked."));
- mutt_sleep(1);
return NULL;
}
return key;
mutt_error(_("No matching keys found for \"%s\""), resp);
- mutt_sleep(0);
}
/* not reached */
}
if (err != GPG_ERR_NO_ERROR)
{
mutt_error(_("Error exporting key: %s\n"), gpgme_strerror(err));
- mutt_sleep(1);
goto bail;
}
if (could_not_decrypt && !(s->flags & MUTT_DISPLAY))
{
mutt_error(_("Could not decrypt PGP message"));
- mutt_sleep(1);
rc = -1;
goto out;
}
else
{
mutt_error(_("Could not decrypt PGP message"));
- mutt_sleep(2);
/* void the passphrase, even if it's not necessarily the problem */
pgp_void_passphrase();
rc = -1;
if (!i && unusable)
{
mutt_error(_("All matching keys are expired, revoked, or disabled."));
- mutt_sleep(1);
return NULL;
}
return key;
mutt_error(_("No matching keys found for \"%s\""), resp);
- mutt_sleep(0);
}
/* not reached */
}
return key;
mutt_error(_("No matching keys found for \"%s\""), resp);
- mutt_sleep(0);
}
}
if (!nserv->newsrc_fp)
{
mutt_perror(nserv->newsrc_file);
- mutt_sleep(2);
return -1;
}
{
mutt_perror(nserv->newsrc_file);
nntp_newsrc_close(nserv);
- mutt_sleep(2);
return -1;
}
mutt_file_fclose(&fp);
if (*tmpfile)
unlink(tmpfile);
- if (rc)
- mutt_sleep(2);
return rc;
}
else
{
mutt_perror(nserv->newsrc_file);
- mutt_sleep(2);
}
}
FREE(&buf);
if (!server || !*server)
{
mutt_error(_("No news server defined!"));
- mutt_sleep(2);
return NULL;
}
{
url_free(&url);
mutt_error(_("%s is an invalid news server specification!"), server);
- mutt_sleep(2);
return NULL;
}
if (url.scheme == U_NNTPS)
if (mutt_file_mkdir(file, S_IRWXU) < 0)
{
mutt_error(_("Can't create %s: %s."), file, strerror(errno));
- mutt_sleep(2);
}
nserv->cacheable = true;
}
{
nserv->status = NNTP_NONE;
mutt_error(_("Server closed connection!"));
- mutt_sleep(2);
return -1;
}
mutt_socket_close(conn);
nserv->status = NNTP_BYE;
mutt_error(_("Server doesn't support reader mode."));
- mutt_sleep(2);
return -1;
}
if (!a)
{
mutt_error(_("No authenticators available"));
- mutt_sleep(2);
break;
}
}
mutt_error(_("%s authentication failed."), method);
- mutt_sleep(2);
break;
}
break;
if (conn->fd < 0)
{
mutt_error(_("Server closed connection!"));
- mutt_sleep(2);
}
else
mutt_socket_close(conn);
mutt_socket_close(conn);
mutt_str_remove_trailing_ws(buf);
mutt_error("%s", buf);
- mutt_sleep(2);
return -1;
}
{
mutt_socket_close(conn);
mutt_error(_("Could not switch to reader mode."));
- mutt_sleep(2);
return -1;
}
{
nserv->use_tls = 0;
mutt_error("STARTTLS: %s", buf);
- mutt_sleep(2);
}
else if (mutt_ssl_starttls(conn))
{
nserv->status = NNTP_NONE;
mutt_socket_close(nserv->conn);
mutt_error(_("Could not negotiate TLS connection"));
- mutt_sleep(2);
return -1;
}
else
{
mutt_socket_close(conn);
mutt_error(_("Could not switch to reader mode."));
- mutt_sleep(2);
return -1;
}
}
if (rc > 0)
{
mutt_error("%s: %s", cmd, buf);
- mutt_sleep(2);
}
return rc;
}
if (rc > 0)
{
mutt_error("LISTGROUP: %s", buf);
- mutt_sleep(2);
}
if (rc == 0)
{
if (!fp)
{
mutt_perror(tempfile);
- mutt_sleep(2);
unlink(tempfile);
rc = -1;
break;
if (mutt_str_strncmp("423", buf, 3) != 0)
{
mutt_error("HEAD: %s", buf);
- mutt_sleep(2);
break;
}
if (rc > 0)
{
mutt_error("%s: %s", cmd, buf);
- mutt_sleep(2);
}
}
{
url_free(&url);
mutt_error(_("%s is an invalid newsgroup specification!"), ctx->path);
- mutt_sleep(2);
return -1;
}
{
nntp_newsrc_close(nserv);
mutt_error(_("Newsgroup %s not found on the server."), group);
- mutt_sleep(2);
return -1;
}
nntp_delete_group_cache(nntp_data);
nntp_newsrc_update(nserv);
}
- mutt_sleep(2);
}
/* parse newsgroup info */
{
nntp_newsrc_close(nserv);
mutt_error("GROUP: %s", buf);
- mutt_sleep(2);
return -1;
}
nntp_data->first_message = first;
if (rc > 0)
{
mutt_error("LIST: %s", buf);
- mutt_sleep(2);
}
return -1;
}
if (rc > 0)
{
mutt_error("NEWGROUPS: %s", buf);
- mutt_sleep(2);
}
return -1;
}
if (deleted > 0)
{
mutt_error(_("%d messages have been lost. Try reopening the mailbox."), deleted);
- mutt_sleep(2);
}
bool hcached = false;
if (pop_parse_path(ctx->path, &acct))
{
mutt_error(_("%s is an invalid POP path"), ctx->path);
- mutt_sleep(2);
return -1;
}
return 0;
mutt_perror(cache->path);
- mutt_sleep(2);
return -1;
}
else
{
mutt_error(
_("The message index is incorrect. Try reopening the mailbox."));
- mutt_sleep(2);
return -1;
}
if (!msg->fp)
{
mutt_perror(path);
- mutt_sleep(2);
return -1;
}
}
if (ret == -2)
{
mutt_error("%s", pop_data->err_msg);
- mutt_sleep(2);
return -1;
}
if (ret == -3)
{
mutt_error(_("Can't write message to temporary file!"));
- mutt_sleep(2);
return -1;
}
}
if (ret == -2)
{
mutt_error("%s", pop_data->err_msg);
- mutt_sleep(2);
return -1;
}
}
FREE(&buf);
mutt_error(_("SASL authentication failed."));
- mutt_sleep(2);
return POP_A_FAILURE;
}
if (!mutt_addr_valid_msgid(pop_data->timestamp))
{
mutt_error(_("POP timestamp is invalid!"));
- mutt_sleep(2);
return POP_A_UNAVAIL;
}
}
mutt_error(_("APOP authentication failed."));
- mutt_sleep(2);
return POP_A_FAILURE;
}
}
mutt_error("%s %s", _("Login failed."), pop_data->err_msg);
- mutt_sleep(2);
return POP_A_FAILURE;
}
url_free(&url);
FREE(&c);
mutt_error(_("Invalid POP URL: %s\n"), path);
- mutt_sleep(1);
return -1;
}
if (rc != 0)
{
mutt_error("%s", pop_data->err_msg);
- mutt_sleep(2);
}
else if (mutt_ssl_starttls(pop_data->conn))
{
mutt_error(_("Could not negotiate TLS connection"));
- mutt_sleep(2);
return -2;
}
else
if (SslForceTls && !pop_data->conn->ssf)
{
mutt_error(_("Encrypted connection unavailable"));
- mutt_sleep(1);
return -2;
}
#endif
if (rc == -2)
{
mutt_error("%s", pop_data->err_msg);
- mutt_sleep(2);
return rc;
}
err_conn:
pop_data->status = POP_DISCONNECTED;
mutt_error(_("Server closed connection!"));
- mutt_sleep(2);
return -1;
}
if (ret == -2)
{
mutt_error("%s", pop_data->err_msg);
- mutt_sleep(2);
}
}
if (ret == 0)
if (!cur->hdr->env->from)
{
mutt_error(_("Warning: message contains no From: header"));
- mutt_sleep(2);
mutt_clear_error();
}
}
if (!actx->idx[i]->content->hdr->env->from)
{
mutt_error(_("Warning: message contains no From: header"));
- mutt_sleep(2);
mutt_clear_error();
break;
}
if (n < 0)
{
mutt_error(_("Out of memory!"));
- sleep(1);
mutt_exit(1);
}
if (idna_ok != 0)
{
mutt_error(_("Error: '%s' is a bad IDN."), err);
- mutt_refresh();
- mutt_sleep(2);
FREE(&err);
}
} while (idna_ok != 0);
{
mutt_error(_(
"No crypto backend configured. Disabling message security setting."));
- mutt_sleep(1);
msg->security = 0;
}
return 0;
mutt_error(_("SMTP session failed: %s"), buf);
- mutt_sleep(0);
return -1;
}
url_free(&url);
FREE(&urlstr);
mutt_error(_("Invalid SMTP URL: %s"), SmtpUrl);
- mutt_sleep(1);
return -1;
}
url_free(&url);
if (r == SMTP_AUTH_FAIL && delim)
{
mutt_error(_("%s authentication failed, trying next method"), method);
- mutt_sleep(1);
}
else if (r != SMTP_AUTH_UNAVAIL)
break;
if (r == SMTP_AUTH_FAIL)
{
mutt_error(_("SASL authentication failed"));
- mutt_sleep(1);
}
else if (r == SMTP_AUTH_UNAVAIL)
{
mutt_error(_("No authenticators available"));
- mutt_sleep(1);
}
return r == SMTP_AUTH_SUCCESS ? 0 : -1;
error:
mutt_error(error);
- mutt_sleep(1);
return -1;
}
#endif /* USE_SASL */
if (mutt_ssl_starttls(conn))
{
mutt_error(_("Could not negotiate TLS connection"));
- mutt_sleep(1);
return -1;
}
if (!mutt_bit_isset(Capabilities, AUTH))
{
mutt_error(_("SMTP server does not support authentication"));
- mutt_sleep(1);
return -1;
}
(AuxSort = mutt_get_sort_func(SortAux)) == NULL)
{
mutt_error(_("Could not find sorting function! [report this bug]"));
- mutt_sleep(1);
return;
}
else