From f72a8fa8d21feb20d48d5b6e3c4a06cd9710467b Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 1 Mar 2000 00:12:09 +0000 Subject: [PATCH] Add $imap_servernoise option to suppress IMAP server messages. From Brendan Cully. --- README.SECURITY | 2 +- configure.in | 22 +++++++++++++--------- imap/command.c | 2 +- init.h | 9 +++++++++ mutt.h | 1 + 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.SECURITY b/README.SECURITY index 40b8f60a..90616328 100644 --- a/README.SECURITY +++ b/README.SECURITY @@ -44,7 +44,7 @@ The most basic rule is this one: Don't quote them with single or double quotes. Mutt does this for you, the right way, as should any other program which interprets mailcap. Don't put them into backtick expansions - as you have seen -above, this is a recipe for desaster. Be highly careful with eval +above, this is a recipe for disaster. Be highly careful with eval statements, and avoid them if possible at all. If you have to use the %-expandos' values in context where you need diff --git a/configure.in b/configure.in index 97604998..ccbeb600 100644 --- a/configure.in +++ b/configure.in @@ -492,18 +492,22 @@ AC_ARG_WITH(ssl, [ --with-ssl[=PFX] Compile in SSL socket support for AC_MSG_ERROR([SSL support is only for IMAP, but IMAP is not enabled]) fi - if test "x$withval" != "x"; then + if test "$with_ssl" != "no" + then + if test "$with_ssl" != "yes" + then LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" + fi + saved_LIBS="$LIBS" + + AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library])) + AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto) + AC_DEFINE(USE_SSL) + LIBS="$saved_LIBS" + MUTTLIBS="$MUTTLIBS -lssl -lcrypto" + need_ssl=yes fi - saved_LIBS="$LIBS" - - AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library])) - AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto) - AC_DEFINE(USE_SSL) - LIBS="$saved_LIBS" - MUTTLIBS="$MUTTLIBS -lssl -lcrypto" - need_ssl=yes ]) AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes) diff --git a/imap/command.c b/imap/command.c index 3fab7abe..6ba52fb7 100644 --- a/imap/command.c +++ b/imap/command.c @@ -259,7 +259,7 @@ int imap_handle_untagged (IMAP_DATA *idata, char *s) mx_fastclose_mailbox (idata->selected_ctx); return (-1); } - else if (mutt_strncasecmp ("NO", s, 2) == 0) + else if (option (OPTIMAPSERVERNOISE) && (mutt_strncasecmp ("NO", s, 2) == 0)) { /* Display the warning message from the server */ mutt_error (s+3); diff --git a/init.h b/init.h index a015f7f0..afc4ed16 100644 --- a/init.h +++ b/init.h @@ -675,6 +675,15 @@ struct option_t MuttVars[] = { ** user/password pairs on mutt invocation, or if opening the connection ** is slow. */ + { "imap_servernoise", DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, 1 }, + /* + ** .pp + ** When set, mutt will display warning messages from the IMAP + ** server as error messages. Since these messages are often + ** harmless, or generated due to configuration problems on the + ** server which are out of the users' hands, you may wish to suppress + ** them at some point. + */ { "imap_home_namespace", DT_STR, R_NONE, UL &ImapHomeNamespace, UL 0}, /* ** .pp diff --git a/mutt.h b/mutt.h index c04a7452..72171b85 100644 --- a/mutt.h +++ b/mutt.h @@ -300,6 +300,7 @@ enum #ifdef USE_IMAP OPTIMAPLSUB, OPTIMAPPASSIVE, + OPTIMAPSERVERNOISE, #endif #ifdef USE_SSL OPTSSLV2, -- 2.40.0