Compact zip feature to pileraget

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-09-01 20:35:25 +02:00
parent ae97f52adf
commit f195c5eb6c
2 changed files with 2 additions and 6 deletions

View File

@ -54,6 +54,7 @@ void check_and_create_directories(struct config *cfg, uid_t uid, gid_t gid);
void update_counters(struct session_data *sdata, struct data *data, struct counters *counters, struct config *cfg);
int retrieve_email_from_archive(struct session_data *sdata, FILE *dest, struct config *cfg);
void assemble_attachment_filename(char *filename, int len, char *s, int attachment_id, struct config *cfg);
int file_from_archive_to_network(char *filename, int sd, int tls_enable, struct data *data, struct config *cfg);
int get_folder_id(struct session_data *sdata, char *foldername, int parent_id);

View File

@ -46,13 +46,8 @@ int main(int argc, char **argv){
return 1;
}
snprintf(filename, sizeof(filename)-1, "%s/%02x/%c%c%c/%c%c/%c%c/%s.a%d", cfg.queuedir, cfg.server_id, argv[1][8], argv[1][9], argv[1][10], argv[1][RND_STR_LEN-4], argv[1][RND_STR_LEN-3], argv[1][RND_STR_LEN-2], argv[1][RND_STR_LEN-1], argv[1], atoi(argv[2]));
#ifdef HAVE_SUPPORT_FOR_COMPAT_STORAGE_LAYOUT
if(stat(filename, &st)){
snprintf(filename, sizeof(filename)-1, "%s/%02x/%c%c/%c%c/%c%c/%s.a%d", cfg.queuedir, cfg.server_id, argv[1][RND_STR_LEN-6], argv[1][RND_STR_LEN-5], argv[1][RND_STR_LEN-4], argv[1][RND_STR_LEN-3], argv[1][RND_STR_LEN-2], argv[1][RND_STR_LEN-1], argv[1], atoi(argv[2]));
}
#endif
assemble_attachment_filename(filename, sizeof(filename), argv[1], atoi(argv[2]), &cfg);
retrieve_file_from_archive(filename, WRITE_TO_STDOUT, NULL, stdout, &cfg);
return 0;