mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:40:12 +01:00
imap login fix
This commit is contained in:
parent
f3742a5a86
commit
53739b7f71
@ -286,7 +286,7 @@ int connect_to_imap_server(int sd, int *seq, char *username, char *password, int
|
|||||||
write1(sd, buf, strlen(buf), use_ssl, data->ssl);
|
write1(sd, buf, strlen(buf), use_ssl, data->ssl);
|
||||||
read_response(sd, buf, sizeof(buf), tagok, data, use_ssl);
|
read_response(sd, buf, sizeof(buf), tagok, data, use_ssl);
|
||||||
|
|
||||||
if(strncmp(buf, tagok, strlen(tagok))){
|
if(!strstr(buf, tagok)){
|
||||||
printf("login failed, server reponse: %s\n", buf);
|
printf("login failed, server reponse: %s\n", buf);
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
@ -311,6 +311,8 @@ int list_folders(int sd, int *seq, int use_ssl, struct __data *data){
|
|||||||
char *p, *q, *buf, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], puf[MAXBUFSIZE];
|
char *p, *q, *buf, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], puf[MAXBUFSIZE];
|
||||||
int len=MAXBUFSIZE+3, pos=0, n, rc=ERR;;
|
int len=MAXBUFSIZE+3, pos=0, n, rc=ERR;;
|
||||||
|
|
||||||
|
printf("List of IMAP folders:\n");
|
||||||
|
|
||||||
buf = malloc(len);
|
buf = malloc(len);
|
||||||
if(!buf) return rc;
|
if(!buf) return rc;
|
||||||
|
|
||||||
@ -362,6 +364,9 @@ int list_folders(int sd, int *seq, int use_ssl, struct __data *data){
|
|||||||
if(q[strlen(q)-1] == '"') q[strlen(q)-1] = '\0';
|
if(q[strlen(q)-1] == '"') q[strlen(q)-1] = '\0';
|
||||||
|
|
||||||
addnode(data->imapfolders, q);
|
addnode(data->imapfolders, q);
|
||||||
|
|
||||||
|
printf("=> '%s'\n", q);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user