mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 07:40:12 +01:00
do not transform imap folder names
This commit is contained in:
parent
fa9ce0f715
commit
12c1c62a35
25
src/imap.c
25
src/imap.c
@ -94,25 +94,12 @@ END:
|
|||||||
|
|
||||||
|
|
||||||
int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sdata, struct __data *data, int use_ssl, int dryrun, struct __config *cfg){
|
int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sdata, struct __data *data, int use_ssl, int dryrun, struct __config *cfg){
|
||||||
int rc=ERR, i, n, messages=0, len, readlen, fd, nreads, readpos, finished, msglen, msg_written_len, tagoklen, tagbadlen, result, fpos=0;
|
int rc=ERR, i, n, messages=0, len, readlen, fd, nreads, readpos, finished, msglen, msg_written_len, tagoklen, tagbadlen, result;
|
||||||
char *p, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], tagbad[SMALLBUFSIZE], buf[MAXBUFSIZE], puf[MAXBUFSIZE], filename[SMALLBUFSIZE], __folder[SMALLBUFSIZE];
|
char *p, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], tagbad[SMALLBUFSIZE], buf[MAXBUFSIZE], puf[MAXBUFSIZE], filename[SMALLBUFSIZE];
|
||||||
|
|
||||||
/* imap cmd: SELECT */
|
/* imap cmd: SELECT */
|
||||||
|
|
||||||
memset(__folder, 0, sizeof(__folder));
|
snprintf(buf, sizeof(buf)-1, "A%d SELECT %s\r\n", *seq, folder);
|
||||||
|
|
||||||
for(; *folder; folder++){
|
|
||||||
if(fpos < sizeof(__folder)-2){
|
|
||||||
if(*folder == '"'){
|
|
||||||
__folder[fpos] = '\\';
|
|
||||||
fpos++;
|
|
||||||
}
|
|
||||||
__folder[fpos] = *folder;
|
|
||||||
fpos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf)-1, "A%d SELECT \"%s\"\r\n", *seq, __folder);
|
|
||||||
|
|
||||||
n = write1(sd, buf, strlen(buf), use_ssl, data->ssl);
|
n = write1(sd, buf, strlen(buf), use_ssl, data->ssl);
|
||||||
if(read_response(sd, buf, sizeof(buf), seq, data, use_ssl) == 0){
|
if(read_response(sd, buf, sizeof(buf), seq, data, use_ssl) == 0){
|
||||||
@ -436,10 +423,10 @@ int list_folders(int sd, int *seq, int use_ssl, struct __data *data){
|
|||||||
q++;
|
q++;
|
||||||
fldrlen = strtol(q, NULL, 10);
|
fldrlen = strtol(q, NULL, 10);
|
||||||
} else {
|
} else {
|
||||||
if(*q == '"') q++;
|
//if(*q == '"') q++;
|
||||||
|
|
||||||
if(q[strlen(q)-1] == ' ') q[strlen(q)-1] = '\0';
|
//if(q[strlen(q)-1] == ' ') q[strlen(q)-1] = '\0';
|
||||||
if(q[strlen(q)-1] == '"') q[strlen(q)-1] = '\0';
|
//if(q[strlen(q)-1] == '"') q[strlen(q)-1] = '\0';
|
||||||
|
|
||||||
if(fldrlen) {
|
if(fldrlen) {
|
||||||
ruf = malloc(strlen(q) * 2 + 1);
|
ruf = malloc(strlen(q) * 2 + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user