Commit 60de6c90 60de6c90e3db9989db069bdd9abb7b4c1df9b3c2 by Sam Roberts

Look for passwd in the url before prompting.

1 parent 7028d328
......@@ -167,7 +167,16 @@ imap_user (authority_t auth)
f_imap->user = calloc (1, n + 1);
url_get_user (folder->url, f_imap->user, n + 1, NULL);
}
ticket_pop (ticket, "Imap Passwd: ", &f_imap->passwd);
/* Was it in the URL? */
status = url_get_passwd (folder->url, NULL, 0, &n);
if (status != 0 || n == 0)
ticket_pop (ticket, "Imap Passwd: ", &f_imap->passwd);
else
{
f_imap->passwd = calloc (1, n + 1);
url_get_passwd (folder->url, f_imap->passwd, n + 1, NULL);
}
if (f_imap->user == NULL || f_imap->passwd == NULL)
{
CHECK_ERROR_CLOSE (folder, f_imap, EINVAL);
......