[balsa] Fix access to local POP3 server



commit b311eb00d03e13ff1e4dc21d9e876a523abdf1d4
Author: Albrecht Dreß <albrecht dress arcor de>
Date:   Sat Apr 22 21:04:59 2017 -0400

    Fix access to local POP3 server
    
        * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_startup):
          allow all auth methods, in order to allow connections to
          localhost;
        * libnetclient/net-client-pop.c (net_client_pop_get_capa):
          cosmetics
    
    Signed-off-by: Peter Bloomfield <PeterBloomfield bellsouth net>

 ChangeLog                     |   10 ++++++++++
 libbalsa/mailbox_pop3.c       |   10 +++++++---
 libnetclient/net-client-pop.c |    3 ++-
 3 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a6c4b46..9ff94d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-04-22  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Fix access to local POP3 server
+
+       * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_startup):
+         allow all auth methods, in order to allow connections to
+         localhost;
+       * libnetclient/net-client-pop.c (net_client_pop_get_capa):
+         cosmetics
+
 2017-04-20  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * configure.ac: replace --with-spell-checker=no with
diff --git a/libbalsa/mailbox_pop3.c b/libbalsa/mailbox_pop3.c
index 0003b32..5e79319 100644
--- a/libbalsa/mailbox_pop3.c
+++ b/libbalsa/mailbox_pop3.c
@@ -465,6 +465,7 @@ libbalsa_mailbox_pop3_startup(LibBalsaServer            *server,
 {
        NetClientPop *pop;
        GError *error = NULL;
+       guint allow_auth;
 
        /* create the mailbox connection */
        if (server->security == NET_CLIENT_CRYPT_ENCRYPTED) {
@@ -476,11 +477,14 @@ libbalsa_mailbox_pop3_startup(LibBalsaServer            *server,
                return NULL;
        }
 
-       /* configure the mailbox connection */
+       /* configure the mailbox connection; allow all (including plain text) auth methods even for 
unencrypted connections so using
+        * e.g. popfile on localhost is possible, i.e. the user is responsible for choosing a proper security 
mode */
+       allow_auth = NET_CLIENT_POP_AUTH_ALL;
        if (mbox->disable_apop) {
-               net_client_pop_allow_auth(pop, TRUE, NET_CLIENT_POP_AUTH_ALL & ~NET_CLIENT_POP_AUTH_APOP);
-               net_client_pop_allow_auth(pop, FALSE, NET_CLIENT_POP_AUTH_SAFE & ~NET_CLIENT_POP_AUTH_APOP);
+               allow_auth &= ~NET_CLIENT_POP_AUTH_APOP;
        }
+       net_client_pop_allow_auth(pop, TRUE, allow_auth);
+       net_client_pop_allow_auth(pop, FALSE, allow_auth);
        net_client_set_timeout(NET_CLIENT(pop), 60U);
 
        /* load client certificate if configured */
diff --git a/libnetclient/net-client-pop.c b/libnetclient/net-client-pop.c
index 07f799f..ccd4076 100644
--- a/libnetclient/net-client-pop.c
+++ b/libnetclient/net-client-pop.c
@@ -696,7 +696,8 @@ net_client_pop_get_capa(NetClientPop *client, guint *auth_supported)
         * at least support USER/PASS... */
        if (*auth_supported == 0U) {
                *auth_supported = NET_CLIENT_POP_AUTH_USER_PASS;
-       }client->priv->can_pipelining = TRUE;
+       }
+       client->priv->can_pipelining = TRUE;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]