From 2595e6cf221e900586c0298a15e78b3bdb38a927 Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 May 2014 22:29:27 +0200 Subject: [PATCH] improved pilerimport imap skipfolder handling --- src/pilerimport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pilerimport.c b/src/pilerimport.c index 1c0e09a9..3e446dd9 100644 --- a/src/pilerimport.c +++ b/src/pilerimport.c @@ -257,7 +257,7 @@ int import_from_maildir(char *directory, struct session_data *sdata, struct __da int import_from_imap_server(char *server, char *username, char *password, int port, struct session_data *sdata, struct __data *data, char *skiplist, int dryrun, struct __config *cfg){ int i, rc=ERR, ret=OK, sd, seq=1, skipmatch, use_ssl=0; - char port_string[6]; + char port_string[6], puf[SMALLBUFSIZE]; struct addrinfo hints, *res; struct node *q; @@ -310,7 +310,8 @@ int import_from_imap_server(char *server, char *username, char *password, int po skipmatch = 0; if(skiplist && strlen(skiplist) > 0){ - if(strstr(skiplist, q->str)) skipmatch = 1; + snprintf(puf, sizeof(puf)-1, "%s,", (char *)q->str); + if(strstr(skiplist, puf)) skipmatch = 1; } if(folder_imap && strstr(q->str, folder_imap) == NULL){ @@ -461,7 +462,7 @@ ENDE: void usage(){ - printf("usage: pilerimport [-c ] -e | -m | -d | -i | -K | -u -p -P [-F ] [-R] [-r] [-q]\n"); + printf("usage: pilerimport [-c ] -e | -m | -d | -i | -K | -u -p -P [-x ] [-F ] [-R] [-r] [-q]\n"); exit(0); }