Skip to content

Commit

Permalink
Removed non-working clamd code (#169)
Browse files Browse the repository at this point in the history
* Removed non-working clamd code

Signed-off-by: Janos SUTO <[email protected]>

* Fixed piler.h

Signed-off-by: Janos SUTO <[email protected]>

* Fixed Makefile.in

Signed-off-by: Janos SUTO <[email protected]>

---------

Signed-off-by: Janos SUTO <[email protected]>
  • Loading branch information
jsuto authored Aug 22, 2024
1 parent 98faef3 commit 9b52e0d
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 212 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ piler is an open source email archival application. Please visit https://www.mai
Features:

- built-in smtp server
- clamd support
- archival rules
- retention rules
- legal hold
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

- Display svg images in preview pane (#97)

- Removed non-functioning clamd support
I suggest to run an anti-virus software on your MX


1.4.6:
Expand All @@ -26,6 +28,9 @@
Note that it requires real-time (rt) index. When using plain index,
then no audit record is written

When using piler in docker, be sure to update /etc/piler/manticore.conf
to include the index audit1 {} block

- Added support for path prefix, ie. when the archive can be accessed
at https://example.com/archive/ (instead of using a dedicated hostname,
eg. https://archive.example.com).
Expand Down
1 change: 0 additions & 1 deletion build/piler.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
archive_emails_not_having_message_id=0
backlog=20
cipher_list=ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
clamd_socket=/var/run/clamav/clamd.ctl
default_retention_days=2557
enable_chunking=1
enable_cjk=0
Expand Down
35 changes: 0 additions & 35 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ CFGDIR
MYSQL_CONFIG
iv
id_bin
libclamav_extra_libs
sql_obj
sql_libs
sql_includes
Expand Down Expand Up @@ -720,7 +719,6 @@ ac_user_opts='
enable_option_checking
enable_static_build
enable_compat_layout
enable_clamd
enable_memcached
enable_tweak_sent_time
with_piler_user
Expand Down Expand Up @@ -1351,7 +1349,6 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-static-build build statically linked executables (default: dynamically linked)
--enable-compat-layout support for older storage layout (default: no)
--enable-clamd build clamd antivirus support
--enable-memcached build memcached support
--tweak-sent-time tweak sent time
Expand Down Expand Up @@ -3566,12 +3563,8 @@ fi
have_libclamav="no"
have_libtool="no"
have_clamd="no"
have_antivirus="no"
have_mysql="no"
have_psql="no"
have_tre="no"
Expand Down Expand Up @@ -3647,22 +3640,6 @@ fi
# Check whether --enable-clamd was given.
if test ${enable_clamd+y}
then :
enableval=$enable_clamd; want_clamd=$enableval
else $as_nop
want_clamd="no"
fi
if test "$want_clamd" = "yes"; then
have_clamd="yes"
have_antivirus="yes"
fi
# Check whether --enable-memcached was given.
if test ${enable_memcached+y}
then :
Expand Down Expand Up @@ -4517,12 +4494,6 @@ printf "%s\n" "#define HAVE_DAEMON 0" >>confdefs.h
if test -x /usr/xpg4/bin/id; then id_bin="/usr/xpg4/bin/id"; fi
fi
if test "$have_clamd" = "yes" ; then
defs="$defs -DHAVE_ANTIVIRUS"
objs="$objs avir.o"
fi
echo; echo
echo "run as user: $RUNNING_USER"
Expand Down Expand Up @@ -4569,12 +4540,6 @@ fi
echo
if test "$have_clamd" = "yes"; then
echo "clamd support: yes"
objs="$objs clamd.o"
defs="$defs -DHAVE_CLAMD"
fi
if test "$want_memcached" = "yes"; then
echo "memcached support: yes"
objs="$objs memc.o"
Expand Down
28 changes: 0 additions & 28 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ AC_SUBST(MAKE)
AC_SUBST(sql_includes)
AC_SUBST(sql_libs)
AC_SUBST(sql_obj)
AC_SUBST(libclamav_extra_libs)
AC_SUBST(id_bin)
AC_SUBST(iv)

have_libclamav="no"
have_libtool="no"
have_clamd="no"

have_antivirus="no"
have_mysql="no"
have_psql="no"
have_tre="no"
Expand Down Expand Up @@ -101,17 +97,6 @@ AC_ARG_ENABLE(compat-layout,
[ --enable-compat-layout support for older storage layout (default: no)], have_compat_storage_layout=$enableval, have_compat_storage_layout="no")


dnl clamd


AC_ARG_ENABLE(clamd,
[ --enable-clamd build clamd antivirus support], want_clamd=$enableval, want_clamd="no")
if test "$want_clamd" = "yes"; then
have_clamd="yes"
have_antivirus="yes"
fi


AC_ARG_ENABLE(memcached,
[ --enable-memcached build memcached support], want_memcached=$enableval, want_memcached="no")

Expand Down Expand Up @@ -326,13 +311,6 @@ if test "$os" = "SunOS"; then
if test -x /usr/xpg4/bin/id; then id_bin="/usr/xpg4/bin/id"; fi
fi

dnl whether we have antivirus support

if test "$have_clamd" = "yes" ; then
defs="$defs -DHAVE_ANTIVIRUS"
objs="$objs avir.o"
fi

echo; echo

echo "run as user: $RUNNING_USER"
Expand Down Expand Up @@ -375,12 +353,6 @@ fi

echo

if test "$have_clamd" = "yes"; then
echo "clamd support: yes"
objs="$objs clamd.o"
defs="$defs -DHAVE_CLAMD"
fi

if test "$want_memcached" = "yes"; then
echo "memcached support: yes"
objs="$objs memc.o"
Expand Down
2 changes: 1 addition & 1 deletion cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -o nounset
set -o errexit
set -o pipefail

cppcheck -DHAVE_PDFTOTEXT -DHAVE_PPTHTML -DHAVE_TNEF -DHAVE_UNRTF -DHAVE_XLS2CSV -DHAVE_CATPPT -DHAVE_CATDOC -DHAVE_ZIP -D_GNU_SOURCE -DHAVE_DAEMON -DHAVE_TRE -DHAVE_CLAMD -DHAVE_LIBCLAMAV -DNEED_MYSQL --error-exitcode=1 --enable=all --suppressions-list=suppressions.txt --force src/ unit_tests/
cppcheck -DHAVE_PDFTOTEXT -DHAVE_PPTHTML -DHAVE_TNEF -DHAVE_UNRTF -DHAVE_XLS2CSV -DHAVE_CATPPT -DHAVE_CATDOC -DHAVE_ZIP -D_GNU_SOURCE -DHAVE_DAEMON -DHAVE_TRE -DNEED_MYSQL --error-exitcode=1 --enable=all --suppressions-list=suppressions.txt --force src/ unit_tests/
3 changes: 1 addition & 2 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install: install-piler


piler: piler.c libpiler.a
$(CC) $(CFLAGS) $(INCDIR) $(DEFS) -o $@ $< -lpiler $(LIBS) $(LIBDIR) @LDFLAGS@ @libclamav_extra_libs@
$(CC) $(CFLAGS) $(INCDIR) $(DEFS) -o $@ $< -lpiler $(LIBS) $(LIBDIR) @LDFLAGS@

libpiler.a: $(OBJS) $(SQL_OBJS)
ar cr libpiler.a $(OBJS) $(SQL_OBJS)
Expand Down Expand Up @@ -100,4 +100,3 @@ clean:

distclean: clean
rm -f Makefile

25 changes: 0 additions & 25 deletions src/av.h

This file was deleted.

21 changes: 0 additions & 21 deletions src/avir.c

This file was deleted.

3 changes: 0 additions & 3 deletions src/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ struct _parse_rule config_parse_rules[] =
{ "backlog", "integer", (void*) int_parser, offsetof(struct config, backlog), "20", sizeof(int)},
{ "check_for_client_timeout_interval", "integer", (void*) int_parser, offsetof(struct config, check_for_client_timeout_interval), "20", sizeof(int)},
{ "cipher_list", "string", (void*) string_parser, offsetof(struct config, cipher_list), "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS", MAXVAL-1},
{ "clamd_addr", "string", (void*) string_parser, offsetof(struct config, clamd_addr), "", MAXVAL-1},
{ "clamd_port", "integer", (void*) int_parser, offsetof(struct config, clamd_port), "0", sizeof(int)},
{ "clamd_socket", "string", (void*) string_parser, offsetof(struct config, clamd_socket), CLAMD_SOCKET, MAXVAL-1},
{ "debug", "integer", (void*) int_parser, offsetof(struct config, debug), "0", sizeof(int)},
{ "default_retention_days", "integer", (void*) int_parser, offsetof(struct config, default_retention_days), "2557", sizeof(int)},
{ "enable_chunking", "integer", (void*) int_parser, offsetof(struct config, enable_chunking), "0", sizeof(int)},
Expand Down
4 changes: 0 additions & 4 deletions src/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ struct config {
char listen_addr[MAXVAL];
int listen_port;

char clamd_addr[MAXVAL];
int clamd_port;
char clamd_socket[MAXVAL];

int encrypt_messages;

int enable_chunking;
Expand Down
75 changes: 0 additions & 75 deletions src/clamd.c

This file was deleted.

2 changes: 0 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ typedef unsigned long long uint64;
#define QUEUE_DIR DATADIR "/piler/store"
#define ERROR_DIR DATADIR "/piler/error"

#define CLAMD_SOCKET "/tmp/clamd"

#define PIDFILE "/var/run/piler/piler.pid"
#define QUARANTINELEN 255
#define TIMEOUT 60
Expand Down
4 changes: 0 additions & 4 deletions src/dirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ void check_and_create_directories(struct config *cfg){

for(i=0; i<cfg->number_of_worker_processes; i++){
snprintf(s, sizeof(s)-1, "%s/%d", cfg->workdir, i);
#ifdef HAVE_ANTIVIRUS
createdir(s, 0711);
#else
createdir(s, 0700);
#endif
}

}
7 changes: 0 additions & 7 deletions src/piler.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,

bzero(&counters, sizeof(counters));

#ifdef HAVE_ANTIVIRUS
if(do_av_check(filename, cfg) == AVIR_VIRUS){
unlink(filename);
return OK;
}
#endif

init_session_data(sdata, cfg);

sdata->tot_len = size;
Expand Down
3 changes: 0 additions & 3 deletions src/piler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <defs.h>
#include <tai.h>
#include <sig.h>
#include <av.h>
#include <rules.h>
#include <screen.h>
#include <sql.h>
Expand All @@ -33,8 +32,6 @@ void insert_offset(struct session_data *sdata, int server_id);

void tear_down_client(int n);

int do_av_check(char *filename, struct config *cfg);

int make_digests(struct session_data *sdata, struct config *cfg);
void digest_file(char *filename, char *digest);
void digest_string(char *digestname, char *s, char *digest);
Expand Down

0 comments on commit 9b52e0d

Please sign in to comment.