diff --git a/src/config.h b/src/config.h index 9483c641..6cc3c6ee 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "1.2.0-master" -#define BUILD 936 +#define BUILD 937 #define HOSTID "mailarchiver" diff --git a/src/import.c b/src/import.c index 62ab31fc..621dd2fc 100644 --- a/src/import.c +++ b/src/import.c @@ -19,7 +19,7 @@ int import_message(char *filename, struct session_data *sdata, struct __data *data, struct __config *cfg){ - int rc=ERR, fd; + int rc=ERR; char *rule; struct stat st; struct parser_state state; @@ -57,21 +57,19 @@ int import_message(char *filename, struct session_data *sdata, struct __data *da return rc; } - fd = open(filename, O_RDONLY); - if(fd == -1){ - printf("cannot open %s\n", filename); - return rc; - } - close(fd); - snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename); sdata->tot_len = st.st_size; - - data->import->total_size += st.st_size; } + if(sdata->tot_len < 30){ + printf("%s is too short: %d bytes\n", sdata->filename, sdata->tot_len); + return rc; + } + + data->import->total_size += sdata->tot_len; + sdata->delivered = 0;