commit 1a707ab1563c8651e5ced0babf344baab6dad039
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Dec 3 19:18:12 2016 +0100

    inform user if LOGIN was skipped because of missing SSL
    
    'AuthMechs *' technically includes LOGIN, so it is a bit unintuitive
    when it's still not used.

 src/drv_imap.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index e91ca36..686faef 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1943,6 +1943,7 @@ imap_open_store_authenticate2( imap_store_t *ctx )
        imap_server_conf_t *srvc = cfg->server;
        string_list_t *mech, *cmech;
        int auth_login = 0;
+       int skipped_login = 0;
 #ifdef HAVE_LIBSASL
        const char *saslavail;
        char saslmechs[1024], *saslend = saslmechs;
@@ -1960,6 +1961,8 @@ imap_open_store_authenticate2( imap_store_t *ctx )
                                        if (!any)
 #endif
                                                auth_login = 1;
+                                       else
+                                               skipped_login = 1;
 #ifdef HAVE_LIBSASL
                                } else {
                                        int len = strlen( cmech->string );
@@ -2030,7 +2033,7 @@ imap_open_store_authenticate2( imap_store_t *ctx )
                if (!auth_login) {
                        error( "IMAP error: selected SASL mechanism(s) not 
available;\n"
                               "   selected:%s\n   available: %s\n", saslmechs, 
saslavail );
-                       goto bail;
+                       goto skipnote;
                }
                info( "NOT using available SASL mechanism(s): %s\n", saslavail 
);
                sasl_dispose( &ctx->sasl );
@@ -2048,6 +2051,12 @@ imap_open_store_authenticate2( imap_store_t *ctx )
                return;
        }
        error( "IMAP error: server supports no acceptable authentication 
mechanism\n" );
+#ifdef HAVE_LIBSASL
+  skipnote:
+#endif
+       if (skipped_login)
+               error( "Note: not using LOGIN because connection is not 
encrypted;\n"
+                      "      use 'AuthMechs LOGIN' explicitly to force it.\n" 
);
 
   bail:
        imap_open_store_bail( ctx, FAIL_FINAL );

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to