Commit 64952c09 64952c0906e656ac1f6f676d5f16f9149eae1544 by Alain Magloire

* mailbox/folder_imap.c: If authority is null default to

	user/passwd.
	* mailbox/folder_pop.c: If authority is null default to
	user/passwd.
	* mailbox/mbx_pop.c(pop_open): Do not try to reconnect.
1 parent e51d1d1d
2001-11-02 Alain Magloire
* mailbox/folder_imap.c: If authority is null default to
user/passwd.
* mailbox/folder_pop.c: If authority is null default to
user/passwd.
* mailbox/mbx_pop.c(pop_open): Do not try to reconnect.
2001-11-02 Sergey Poznyakoff
* comsat/comsat.c: Restart on sighup when in daemon mode.
......
......@@ -36,6 +36,7 @@
#endif
#include <imap0.h>
#include <url0.h>
#include <mailutils/error.h>
/* For dbg purposes set to one to see different level of traffic. */
......@@ -173,33 +174,28 @@ folder_imap_get_authority (folder_t folder, authority_t *pauth)
int status = 0;
if (folder->authority == NULL)
{
char *auth;
size_t n = 0;
url_get_auth (folder->url, NULL, 0, &n);
auth = calloc (n + 1, 1);
if (auth == NULL)
return ENOMEM;
url_get_auth (folder->url, auth, n + 1, NULL);
if (strcasecmp (auth, "*") == 0)
/* assert (folder->url); */
if (folder->url == NULL)
return EINVAL;
if (folder->url->auth == NULL
|| strcasecmp (folder->url->auth, "*") == 0)
{
status = authority_create (&folder->authority, NULL, folder);
if (status == 0)
authority_set_authenticate (folder->authority,
authenticate_imap_login, folder);
authority_set_authenticate (folder->authority,
authenticate_imap_login, folder);
}
else if (strcasecmp (auth, "anon") == 0)
else if (strcasecmp (folder->url->auth, "anon") == 0)
{
status = authority_create (&folder->authority, NULL, folder);
if (status == 0)
authority_set_authenticate (folder->authority,
authenticate_imap_sasl_anon, folder);
authority_set_authenticate (folder->authority,
authenticate_imap_sasl_anon, folder);
}
else
{
/* Not a supported authentication mechanism. */
status = ENOSYS;
}
free (auth);
}
if (pauth)
*pauth = folder->authority;
......
......@@ -24,6 +24,7 @@
#include <errno.h>
#include <folder0.h>
#include <url0.h>
#include <registrar0.h>
/* We export url parsing and the initialisation of
......@@ -90,14 +91,12 @@ folder_pop_get_authority (folder_t folder, authority_t *pauth)
int status = 0;
if (folder->authority == NULL)
{
char *auth;
size_t n = 0;
url_get_auth (folder->url, NULL, 0, &n);
auth = calloc (n + 1, 1);
if (auth == NULL)
return ENOMEM;
if (strcasecmp (auth, "*") == 0)
/* assert (folder->url); */
if (folder->url == NULL)
return EINVAL;
if (folder->url->auth == NULL
|| strcasecmp (folder->url->auth, "*") == 0)
{
status = authority_create (&folder->authority, NULL, folder);
authority_set_authenticate (folder->authority, _pop_user, folder);
......
......@@ -511,7 +511,8 @@ pop_open (mailbox_t mbox, int flags)
mbox->flags = flags;
CHECK_BUSY (mbox, mpd, func, 0);
/* Do not check for reconnect here. */
/* CHECK_BUSY (mbox, mpd, func, 0); */
/* Enter the pop state machine, and boogy: AUTHORISATION State. */
switch (mpd->state)
......