From fe42f1d04f0ff9b72a8256b300fba3b41fe246e6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 5 Aug 2017 19:52:52 +0200 Subject: [PATCH] *** workaround pointless "Keyword not supported" warnings from exchange *** this is is an *untested* rebase; originally submitted against 1.3 patch by Florian Lombard : ============ > i wonder why a server would bleat about not supporting an optional > feature when it can (and probably does) announce that in a "civilized" > way, too. did these responses appear to be correlated with specific > messages, or did they always come when opening any mailbox? Well, "exchange online", that sums it all ... Tied to specific messages, I guess it happened when there was a word between bracket in the message subject (no debug log of that). Happends only one time, when the message is synced. --- src/drv_imap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index e5c3a07..3220deb 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -55,6 +55,7 @@ typedef union imap_store_conf { char delimiter; char use_namespace; char use_lsub; + char ignore_keyword_warnings; }; } imap_store_conf_t; @@ -1808,7 +1809,8 @@ imap_socket_read( void *aux ) error( "IMAP error: bogus greeting response %s\n", arg ); break; } else if (equals( arg, argl, "NO", 2 )) { - warn( "Warning from IMAP server: %s\n", cmd ); + if (!ctx->conf->ignore_keyword_warnings || strcmp( cmd, "Keywords are not supported" )) + warn( "Warning from IMAP server: %s\n", cmd ); } else if (equals( arg, argl, "BAD", 3 )) { error( "Error from IMAP server: %s\n", cmd ); } else if (equals( arg, argl, "CAPABILITY", 10 )) { @@ -3962,6 +3964,8 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep ) store->use_namespace = parse_bool( cfg ); } else if (!strcasecmp( "SubscribedOnly", cfg->cmd )) { store->use_lsub = parse_bool( cfg ); + } else if (!strcasecmp( "IgnoreKeywordWarnings", cfg->cmd )) { + store->ignore_keyword_warnings = parse_bool( cfg ); } else if (!strcasecmp( "Path", cfg->cmd )) { store->path = nfstrdup( cfg->val ); } else if (!strcasecmp( "PathDelimiter", cfg->cmd )) {