** methods if the previous methods are unavailable. If a method is
** available but authentication fails, NeoMutt will not connect to the POP server.
*/
- { "pop_authenticators", DT_STRING, &C_PopAuthenticators, 0 },
+ { "pop_authenticators", DT_SLIST|SLIST_SEP_COLON, &C_PopAuthenticators, 0 },
/*
** .pp
** This is a colon-delimited list of authentication methods NeoMutt may
extern bool C_PopLast;
/* These Config Variables are only used in pop/pop_auth.c */
-extern char *C_PopAuthenticators;
+extern struct Slist *C_PopAuthenticators;
extern bool C_PopAuthTryAll;
/* These Config Variables are only used in pop/pop_lib.c */
#endif
/* These Config Variables are only used in pop/pop_auth.c */
-char *C_PopAuthenticators; ///< Config: (pop) List of allowed authentication methods
+struct Slist *C_PopAuthenticators; ///< Config: (pop) List of allowed authentication methods
bool C_PopAuthTryAll; ///< Config: (pop) Try all available authentication methods
#ifdef USE_SASL
{
struct ConnAccount *acct = &adata->conn->account;
const struct PopAuth *authenticator = NULL;
- char *methods = NULL;
- char *comma = NULL;
- char *method = NULL;
int attempts = 0;
int ret = POP_A_UNAVAIL;
if (C_PopAuthenticators)
{
/* Try user-specified list of authentication methods */
- methods = mutt_str_strdup(C_PopAuthenticators);
- method = methods;
-
- while (method)
+ struct ListNode *np = NULL;
+ STAILQ_FOREACH(np, &C_PopAuthenticators->head, entries)
{
- comma = strchr(method, ':');
- if (comma)
- *comma++ = '\0';
- mutt_debug(LL_DEBUG2, "Trying method %s\n", method);
+ mutt_debug(LL_DEBUG2, "Trying method %s\n", np->data);
authenticator = pop_authenticators;
while (authenticator->authenticate)
{
if (!authenticator->method ||
- (mutt_str_strcasecmp(authenticator->method, method) == 0))
+ (mutt_str_strcasecmp(authenticator->method, np->data) == 0))
{
- ret = authenticator->authenticate(adata, method);
+ ret = authenticator->authenticate(adata, np->data);
if (ret == POP_A_SOCKET)
{
switch (pop_connect(adata))
{
case 0:
{
- ret = authenticator->authenticate(adata, method);
+ ret = authenticator->authenticate(adata, np->data);
break;
}
case -2:
if ((ret == POP_A_SUCCESS) || (ret == POP_A_SOCKET) ||
((ret == POP_A_FAILURE) && !C_PopAuthTryAll))
{
- comma = NULL;
break;
}
}
authenticator++;
}
-
- method = comma;
}
-
- FREE(&methods);
}
else
{