diff --git a/configure b/configure index 07d0aa12..34793f20 100755 --- a/configure +++ b/configure @@ -4889,7 +4889,7 @@ echo; echo CFLAGS="$static -O2 -Wall -g" LIBS="$antispam_libs $sunos_libs " -OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o retr.o $objs" +OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o $objs" ac_config_files="$ac_config_files Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile" diff --git a/configure.in b/configure.in index 1a4da2f2..caf66e9d 100644 --- a/configure.in +++ b/configure.in @@ -556,7 +556,7 @@ echo; echo CFLAGS="$static -O2 -Wall -g" LIBS="$antispam_libs $sunos_libs " -OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o retr.o $objs" +OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o $objs" AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile]) AC_OUTPUT diff --git a/src/Makefile.in b/src/Makefile.in index e3d4696a..4c5ef87a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -33,16 +33,13 @@ MAKE = `which make` INSTALL = @INSTALL@ -all: libpiler.a piler pilerconf pilerget pilergetd pileraget pilerimport pilerexport pilerpurge reindex test +all: libpiler.a piler pilerconf pilerget pileraget pilerimport pilerexport pilerpurge reindex test install: install-piler piler: piler.c libpiler.a $(CC) $(CFLAGS) $(INCDIR) $(DEFS) -o $@ $< -lpiler $(LIBS) $(LIBDIR) @LDFLAGS@ @libclamav_extra_libs@ -pilergetd: pilergetd.c libpiler.a - $(CC) $(CFLAGS) $(INCDIR) $(DEFS) -o $@ $< -lpiler $(LIBS) $(LIBDIR) @LDFLAGS@ @libclamav_extra_libs@ - libpiler.a: $(OBJS) $(SQL_OBJS) ar cr libpiler.a $(OBJS) $(SQL_OBJS) ranlib libpiler.a @@ -86,7 +83,6 @@ install-piler: (cd $(DESTDIR)$(libdir) && ln -sf libpiler.so.$(LIBPILER_VERSION) libpiler.so.$(PILER_VERSION)) $(INSTALL) -m 0755 piler $(DESTDIR)$(sbindir) - $(INSTALL) -m 0755 pilergetd $(DESTDIR)$(sbindir) $(INSTALL) -m 0755 pilerconf $(DESTDIR)$(sbindir) $(INSTALL) -m 6755 -o $(RUNNING_USER) -g $(RUNNING_GROUP) pilerget $(DESTDIR)$(bindir) $(INSTALL) -m 6755 -o $(RUNNING_USER) -g $(RUNNING_GROUP) pileraget $(DESTDIR)$(bindir) @@ -97,7 +93,7 @@ install-piler: $(INSTALL) -m 6755 -o $(RUNNING_USER) -g $(RUNNING_GROUP) pilertest $(DESTDIR)$(bindir) clean: - rm -f *.o *.a libpiler.so* piler pilerconf pilerget pilergetd pileraget pilerimport pilerexport pilerpurge pilertest reindex + rm -f *.o *.a libpiler.so* piler pilerconf pilerget pileraget pilerimport pilerexport pilerpurge pilertest reindex distclean: clean rm -f Makefile diff --git a/src/archive.c b/src/archive.c index d638cb31..d8d02aae 100644 --- a/src/archive.c +++ b/src/archive.c @@ -209,82 +209,6 @@ CLEANUP: } -int file_from_archive_to_network(char *filename, int sd, int tls_enable, struct __data *data, struct __config *cfg){ - int n, olen, tlen, len, fd=-1; - unsigned char *s=NULL, *addr=NULL, inbuf[REALLYBIGBUFSIZE]; - struct stat st; - EVP_CIPHER_CTX ctx; - - - if(filename == NULL) return 1; - - - fd = open(filename, O_RDONLY); - if(fd == -1){ - syslog(LOG_PRIORITY, "%s: cannot open()", filename); - return 1; - } - - - if(fstat(fd, &st)){ - syslog(LOG_PRIORITY, "%s: cannot fstat()", filename); - close(fd); - return 1; - } - - - if(cfg->encrypt_messages == 1){ - EVP_CIPHER_CTX_init(&ctx); - EVP_DecryptInit_ex(&ctx, EVP_bf_cbc(), NULL, cfg->key, cfg->iv); - - len = st.st_size+EVP_MAX_BLOCK_LENGTH; - - s = malloc(len); - - if(!s){ - syslog(LOG_PRIORITY, "error: malloc(), '%s'", filename); - goto CLEANUP2; - } - - tlen = 0; - - while((n = read(fd, inbuf, sizeof(inbuf)))){ - - if(!EVP_DecryptUpdate(&ctx, s+tlen, &olen, inbuf, n)){ - syslog(LOG_PRIORITY, "%s: EVP_DecryptUpdate()", filename); - goto CLEANUP2; - } - - tlen += olen; - } - - - if(EVP_DecryptFinal(&ctx, s + tlen, &olen) != 1){ - syslog(LOG_PRIORITY, "%s: EVP_DecryptFinal()", filename); - goto CLEANUP2; - } - - - tlen += olen; - write1(sd, s, tlen, tls_enable, data->ssl); - - } - else { - addr = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - write1(sd, addr, st.st_size, tls_enable, data->ssl); - munmap(addr, st.st_size); - } - - -CLEANUP2: - if(fd != -1) close(fd); - if(s) free(s); - if(cfg->encrypt_messages == 1) EVP_CIPHER_CTX_cleanup(&ctx); - - return 0; -} - - int retrieve_email_from_archive(struct session_data *sdata, struct __data *data, FILE *dest, struct __config *cfg){ int i, attachments; char *buffer=NULL, *saved_buffer, *p, filename[SMALLBUFSIZE], pointer[SMALLBUFSIZE]; diff --git a/src/config.h b/src/config.h index 0b4ad8b0..7c9e6b22 100644 --- a/src/config.h +++ b/src/config.h @@ -14,7 +14,7 @@ #define VERSION "1.2.0-master" -#define BUILD 926 +#define BUILD 927 #define HOSTID "mailarchiver"