mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:40:12 +01:00
pilerimport fixes
This commit is contained in:
parent
8798ea7921
commit
2a49299c82
19
src/imap.c
19
src/imap.c
@ -87,12 +87,25 @@ 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;
|
int rc=ERR, i, n, messages=0, len, readlen, fd, nreads, readpos, finished, msglen, msg_written_len, tagoklen, tagbadlen, result, fpos=0;
|
||||||
char *p, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], tagbad[SMALLBUFSIZE], buf[MAXBUFSIZE], puf[MAXBUFSIZE], filename[SMALLBUFSIZE];
|
char *p, tag[SMALLBUFSIZE], tagok[SMALLBUFSIZE], tagbad[SMALLBUFSIZE], buf[MAXBUFSIZE], puf[MAXBUFSIZE], filename[SMALLBUFSIZE], __folder[SMALLBUFSIZE];
|
||||||
|
|
||||||
/* imap cmd: SELECT */
|
/* imap cmd: SELECT */
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf)-1, "A%d SELECT \"%s\"\r\n", *seq, folder);
|
memset(__folder, 0, sizeof(__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){
|
||||||
|
@ -351,7 +351,7 @@ ENDE_IMAP:
|
|||||||
|
|
||||||
int import_from_pop3_server(char *server, char *username, char *password, int port, struct session_data *sdata, struct __data *data, int dryrun, struct __config *cfg){
|
int import_from_pop3_server(char *server, char *username, char *password, int port, struct session_data *sdata, struct __data *data, int dryrun, struct __config *cfg){
|
||||||
int rc, ret=OK, sd, use_ssl=0;
|
int rc, ret=OK, sd, use_ssl=0;
|
||||||
char port_string[6];
|
char port_string[8];
|
||||||
struct addrinfo hints, *res;
|
struct addrinfo hints, *res;
|
||||||
|
|
||||||
snprintf(port_string, sizeof(port_string)-1, "%d", port);
|
snprintf(port_string, sizeof(port_string)-1, "%d", port);
|
||||||
|
Loading…
Reference in New Issue
Block a user