aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in18
-rwxr-xr-xconfigure115
-rw-r--r--perl/rspamd.xs10
-rw-r--r--rspamd.conf.sample13
-rw-r--r--src/cfg_file.h (renamed from cfg_file.h)0
-rw-r--r--src/cfg_file.l (renamed from cfg_file.l)0
-rw-r--r--src/cfg_file.y (renamed from cfg_file.y)3
-rw-r--r--src/cfg_utils.c (renamed from cfg_utils.c)0
-rw-r--r--src/controller.c (renamed from controller.c)0
-rw-r--r--src/filter.c (renamed from filter.c)0
-rw-r--r--src/filter.h (renamed from filter.h)0
-rw-r--r--src/fstring.c (renamed from fstring.c)0
-rw-r--r--src/fstring.h (renamed from fstring.h)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/main.h (renamed from main.h)0
-rw-r--r--src/mem_pool.c (renamed from mem_pool.c)0
-rw-r--r--src/mem_pool.h (renamed from mem_pool.h)0
-rw-r--r--src/memcached-test.c (renamed from memcached-test.c)0
-rw-r--r--src/memcached.c (renamed from memcached.c)0
-rw-r--r--src/memcached.h (renamed from memcached.h)0
-rw-r--r--src/perl.c (renamed from perl.c)0
-rw-r--r--src/perl.h (renamed from perl.h)0
-rw-r--r--src/plugins/regexp.c (renamed from plugins/regexp.c)0
-rw-r--r--src/plugins/surbl.c (renamed from plugins/surbl.c)0
-rw-r--r--src/protocol.c (renamed from protocol.c)0
-rw-r--r--src/protocol.h (renamed from protocol.h)0
-rw-r--r--src/upstream.c (renamed from upstream.c)0
-rw-r--r--src/upstream.h (renamed from upstream.h)0
-rw-r--r--src/url.c (renamed from url.c)0
-rw-r--r--src/url.h (renamed from url.h)0
-rw-r--r--src/util.c (renamed from util.c)0
-rw-r--r--src/util.h (renamed from util.h)0
-rw-r--r--src/worker.c (renamed from worker.c)0
-rw-r--r--test/.depends10
-rw-r--r--test/rspamd_expression_test.c6
-rw-r--r--test/rspamd_mem_pool_test.c5
-rw-r--r--test/rspamd_memcached_test.c8
-rw-r--r--test/rspamd_test_suite.c6
-rw-r--r--test/rspamd_url_test.c8
-rw-r--r--utils/.depends10
-rw-r--r--utils/url_extracter.c8
41 files changed, 128 insertions, 92 deletions
diff --git a/Makefile.in b/Makefile.in
index 8dc6e597f..6eb3b5a40 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,9 @@
.PHONY: perl clean $(SUBDIRS)
-all: perl $(TARGETS)
+all: $(OBJDIR) perl $(TARGETS)
+
+$(OBJDIR):
+ mkdir -p $(OBJDIR)
perl: perl/Makefile
cd perl && make && cd ..
@@ -8,12 +11,6 @@ perl: perl/Makefile
perl/Makefile:
cd perl && perl Makefile.PL && cd ..
-memctest: upstream.c memcached.c memcached-test.c
- $(CC) $(OPT_FLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) -c upstream.c
- $(CC) $(OPT_FLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) -c memcached.c
- $(CC) $(OPT_FLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) -c memcached-test.c
- $(CC) $(OPT_FLAGS) $(PTHREAD_LDFLAGS) $(LD_PATH) upstream.o memcached.o memcached-test.o $(LIBS) -o memcached-test
-
install: $(EXEC)
cd perl && make install && cd ..
$(INSTALL) -b $(EXEC) $(PREFIX)/sbin/$(EXEC)
@@ -23,15 +20,16 @@ install: $(EXEC)
$(MKDIR) -o $(RSPAMD_USER) -g $(RSPAMD_GROUP) /var/run/rspamd
clean: clean-subdirs perl/Makefile
- rm -f *.o $(EXEC) *.core
- rm -f cfg_lex.c cfg_yacc.c cfg_yacc.h
+ rm -f $(OBJDIR)/*.o $(EXEC) *core
+ rm -fr $(OBJDIR)
+ rm -f $(SRCDIR)/cfg_lex.c $(SRCDIR)/cfg_yacc.c $(SRCDIR)/cfg_yacc.h
cd perl && make clean && cd ..
dist-clean: clean dist-clean-subdirs
rm -f Makefile
rm -f test/Makefile
rm -f config.log
- rm -f md5.h md5.c strlcpy.h strlcpy.c queue.h config.h modules.c modules.h
+ rm -f $(SRCDIR)/md5.h $(SRCDIR)/md5.c $(SRCDIR)/strlcpy.h $(SRCDIR)/strlcpy.c $(SRCDIR)/queue.h $(SRCDIR)/config.h $(SRCDIR)/modules.c $(SRCDIR)/modules.h
cd perl && rm -f Makefile.old && rm -f Makefile.PL && cd ..
creategroup:
diff --git a/configure b/configure
index bdaffc1c5..3e37eeb3f 100755
--- a/configure
+++ b/configure
@@ -21,6 +21,8 @@ YACC_OUTPUT="cfg_yacc.c"
LEX_OUTPUT="cfg_lex.c"
CONFIG="config.h"
+SRCDIR="src"
+OBJDIR="src/.obj"
SOURCES="upstream.c cfg_utils.c memcached.c main.c util.c controller.c worker.c fstring.c url.c perl.c protocol.c mem_pool.c filter.c plugins/regexp.c plugins/surbl.c ${LEX_OUTPUT} ${YACC_OUTPUT}"
MODULES="surbl regexp"
@@ -30,7 +32,7 @@ CFLAGS="$CFLAGS -Wunused-value -ggdb -I${LOCALBASE}/include"
CFLAGS="$CFLAGS "
LDFLAGS="$LDFLAGS -L/usr/lib -L${LOCALBASE}/lib"
OPT_FLAGS="-O -pipe -fno-omit-frame-pointer"
-DEPS="config.h cfg_file.h memcached.h util.h main.h upstream.h fstring.h url.h perl.h mem_pool.h protocol.h filter.h ${LEX_OUTPUT} ${YACC_OUTPUT}"
+DEPS="$SRCDIR/config.h $SRCDIR/cfg_file.h $SRCDIR/memcached.h $SRCDIR/util.h $SRCDIR/main.h $SRCDIR/upstream.h $SRCDIR/fstring.h $SRCDIR/url.h $SRCDIR/perl.h $SRCDIR/mem_pool.h $SRCDIR/protocol.h $SRCDIR/filter.h $SRCDIR/${LEX_OUTPUT} $SRCDIR/${YACC_OUTPUT}"
EXEC=rspamd
USER=postfix
GROUP=postfix
@@ -52,14 +54,14 @@ TARGETS="${EXEC}"
prepare_config()
{
- echo "#ifndef CONFIG_H_IN" > $CONFIG
- echo "#define CONFIG_H_IN" >> $CONFIG
- cat "$CONFIG.in" >> $CONFIG
+ echo "#ifndef CONFIG_H_IN" > $SRCDIR/$CONFIG
+ echo "#define CONFIG_H_IN" >> $SRCDIR/$CONFIG
+ cat "$CONFIG.in" >> $SRCDIR/$CONFIG
}
finish_config()
{
- echo "#endif" >> $CONFIG
+ echo "#endif" >> $SRCDIR/$CONFIG
}
cleanup()
@@ -71,7 +73,7 @@ cleanup()
have_opt()
{
- echo "#define HAVE_$1" >> $CONFIG
+ echo "#define HAVE_$1" >> $SRCDIR/$CONFIG
OPTS="$OPTS HAVE_$1"
}
@@ -130,6 +132,20 @@ check_yacc()
}
+check_util()
+{
+ UTIL=`PATH="$PATH:$PREFIX/bin:$LOCALBASE/bin" which $1`
+ echo -n "Testing for $1: "
+ if [ -x $UTIL ] ; then
+ echo "found -> $UTIL"
+ return 0
+ else
+ echo "not found"
+ exit 1
+ fi
+
+}
+
check_function()
{
FUNCTION=$1
@@ -371,11 +387,11 @@ check_os()
INSTALL="/usr/bin/install -C -S -v"
MKDIR="/usr/bin/install -d -v"
MANPATH="${PREFIX}/man"
- echo "#define FREEBSD" >> $CONFIG ;;
+ echo "#define FREEBSD" >> $SRCDIR/$CONFIG ;;
Linux*) OS="linux" CFLAGS="${CFLAGS} -D_GNU_SOURCE"
- echo "#define LINUX" >> $CONFIG ;;
+ echo "#define LINUX" >> $SRCDIR/$CONFIG ;;
Solaris*) OS="solaris" CFLAGS="${CFLAGS}"
- echo "#define SOLARIS" >> $CONFIG ;;
+ echo "#define SOLARIS" >> $SRCDIR/$CONFIG ;;
*) OS="unknown" ;;
esac
}
@@ -452,23 +468,22 @@ END
write_modules()
{
# Write modules init function
- echo "#ifndef MODULES_H" > modules.h
- echo "#include \"config.h\"" >> modules.h
- echo "#include \"modules.h\"" > modules.c
- echo "module_t modules[] = {" >> modules.c;
+ echo "#ifndef MODULES_H" > $SRCDIR/modules.h
+ echo "#include \"config.h\"" >> $SRCDIR/modules.h
+ echo "#include \"modules.h\"" > $SRCDIR/modules.c
+ echo "module_t modules[] = {" >> $SRCDIR/modules.c;
modules_num=0
for m in $MODULES ; do
- echo "{\"${m}\", ${m}_module_init, ${m}_module_config, ${m}_module_reconfig}," >> modules.c
- echo "int ${m}_module_init(struct config_file *cfg, struct module_ctx **ctx);" >> modules.h
- echo "int ${m}_module_config(struct config_file *cfg);" >> modules.h
- echo "int ${m}_module_reconfig(struct config_file *cfg);" >> modules.h
+ echo "{\"${m}\", ${m}_module_init, ${m}_module_config, ${m}_module_reconfig}," >> $SRCDIR/modules.c
+ echo "int ${m}_module_init(struct config_file *cfg, struct module_ctx **ctx);" >> $SRCDIR/modules.h
+ echo "int ${m}_module_config(struct config_file *cfg);" >> $SRCDIR/modules.h
+ echo "int ${m}_module_reconfig(struct config_file *cfg);" >> $SRCDIR/modules.h
modules_num=`expr $modules_num + 1`
done
- echo "};" >> modules.c
- echo "#endif" >> modules.h
- echo "#define MODULES_NUM $modules_num" >> $CONFIG
+ echo "};" >> $SRCDIR/modules.c
+ echo "#endif" >> $SRCDIR/modules.h
+ echo "#define MODULES_NUM $modules_num" >> $SRCDIR/$CONFIG
SOURCES="$SOURCES modules.c"
- OBJECTS=`echo $SOURCES | sed -e 's/\.c/\.o/g'`
}
@@ -494,8 +509,8 @@ write_subdirs()
for sub in $SUBDIRS ; do
cp $MAKEFILE $sub/$MAKEFILE
saved_pwd=`pwd`
- old_objs=`echo $OBJECTS | sed -e 's/\([^. ]*\.o\)/..\/\1/g'`
- old_srcs=`echo $SOURCES | sed -e 's/\([^. ]*\.c\)/..\/\1/g'`
+ old_objs=`echo $OBJECTS | sed -e 's/\([^. ]*\.o\)/..\/%%OBJDIR%%\/\1/g' | sed -e "s,%%OBJDIR%%,${OBJDIR},g"`
+ old_srcs=`echo $SOURCES | sed -e 's/\([^. ]*\.c\)/..\/%%SRCDIR%%\/\1/g' | sed -e "s,%%SRCDIR%%,${SRCDIR},g"`
cd $sub
sub_src="`echo *.c`"
sub_obj="`echo $sub_src | sed -e 's/\.c/\.o/g'`"
@@ -547,10 +562,15 @@ write_result()
echo "Cflags: $CFLAGS" >> config.log
echo "Ldflags: $LDFLAGS" >> config.log
echo "Libs: $LIBS" >> config.log
- echo "#define RVERSION \"${VERSION}\"" >> $CONFIG
- echo "#define HASH_COMPAT" >> $CONFIG
+ echo "#define RVERSION \"${VERSION}\"" >> $SRCDIR/$CONFIG
+ echo "#define HASH_COMPAT" >> $SRCDIR/$CONFIG
write_modules
+ for _s in $SOURCES ; do
+ _o=`echo $_s | awk -F '/' '{split($NF, A, "."); print "%%OBJDIR%%/"A[1]".o"}' | sed -e "s,%%OBJDIR%%,${OBJDIR},"`
+ OBJECTS="$OBJECTS $_o"
+ SRC_OBJ="$SRC_OBJ $_s#$_o"
+ done
write_perl
# Make CFLAGS more readable
CFLAGS="$CFLAGS $PERLCFLAGS"
@@ -571,6 +591,9 @@ CFLAGS=$CFLAGS
LDFLAGS=$LDFLAGS
# Libraries to link
LIBS=$LIBS
+# Directories for sources and objects
+SRCDIR=$SRCDIR
+OBJDIR=$OBJDIR
# ${EXEC} sources
SOURCES=$SOURCES
# ${EXEC} objects
@@ -615,20 +638,21 @@ END
${EXEC}: \$(OBJECTS)
\$(CC) \$(PTHREAD_LDFLAGS) \$(LDFLAGS) \$(OBJECTS) \$(LIBS) -o \$(EXEC)
END
- for o in $OBJECTS ; do
- SO=`echo $o | sed -e 's/\.o/\.c/g'`
+ for o in $SRC_OBJ ; do
+ SO=`echo $o | cut -d '#' -f 1`
+ O=`echo $o | cut -d '#' -f 2`
cat >> $MAKEFILE << END
-${o}: \$(DEPS) ${SO}
- \$(CC) \$(OPT_FLAGS) \$(CFLAGS) \$(PTHREAD_CFLAGS) -o ${o} -c ${SO}
+${O}: \$(DEPS) ${SRCDIR}/${SO}
+ \$(CC) \$(OPT_FLAGS) \$(CFLAGS) \$(PTHREAD_CFLAGS) -o ${O} -c ${SRCDIR}/${SO}
END
done
cat >> $MAKEFILE << END
-${LEX_OUTPUT}: cfg_file.h ${LEX_SRC} ${YACC_OUTPUT}
- \$(LEX) -o${LEX_OUTPUT} ${LEX_SRC}
+${SRCDIR}/${LEX_OUTPUT}: \$(SRCDIR)/cfg_file.h \$(SRCDIR)/${LEX_SRC} \$(SRCDIR)/${YACC_OUTPUT}
+ \$(LEX) -o\$(SRCDIR)/${LEX_OUTPUT} \$(SRCDIR)/${LEX_SRC}
-${YACC_OUTPUT}: cfg_file.h ${YACC_SRC}
- \$(YACC) -d -o ${YACC_OUTPUT} ${YACC_SRC}
+${SRCDIR}/${YACC_OUTPUT}: \$(SRCDIR)/cfg_file.h \$(SRCDIR)/${YACC_SRC}
+ \$(YACC) -d -o \$(SRCDIR)/${YACC_OUTPUT} \$(SRCDIR)/${YACC_SRC}
END
}
@@ -707,6 +731,9 @@ check_compiler
check_make
check_lex
check_yacc
+check_util "sed"
+check_util "awk"
+check_util "cut"
check_os
check_lib "event" "event.h"
@@ -725,10 +752,10 @@ check_lib "m"
check_lib "pcre"
check_lib "md"
if [ $? -eq 1 ] ; then
- cp $COMPAT_DIR/md5.c .
- cp $COMPAT_DIR/md5.h .
+ cp $COMPAT_DIR/md5.c $SRCDIR
+ cp $COMPAT_DIR/md5.h $SRCDIR
SOURCES="$SOURCES md5.c"
- DEPS="$DEPS md5.h"
+ DEPS="$DEPS $SRCDIR/md5.h"
have_opt "OWN_MD5"
fi
@@ -744,10 +771,10 @@ fi
check_function "strlcpy" "string.h"
if [ $? -eq 1 ] ; then
- cp $COMPAT_DIR/strlcpy.c .
- cp $COMPAT_DIR/strlcpy.h .
+ cp $COMPAT_DIR/strlcpy.c $SRCDIR
+ cp $COMPAT_DIR/strlcpy.h $SRCDIR
SOURCES="$SOURCES strlcpy.c"
- DEPS="$DEPS strlcpy.h"
+ DEPS="$DEPS $SRCDIR/strlcpy.h"
have_opt "STRLCPY_H"
fi
check_function "bzero" "string.h"
@@ -790,13 +817,13 @@ check_include "strlcpy.h"
check_include "md5.h"
check_include "sys/queue.h"
if [ $? -eq 1 ] ; then
- cp $COMPAT_DIR/queue.h .
- DEPS="$DEPS queue.h"
+ cp $COMPAT_DIR/queue.h $SRCDIR
+ DEPS="$DEPS $SRCDIR/queue.h"
fi
check_macro "SLIST_FOREACH_SAFE" "sys/queue.h"
if [ $? -eq 1 ] ; then
- cp $COMPAT_DIR/queue.h .
- DEPS="$DEPS queue.h"
+ cp $COMPAT_DIR/queue.h $SRCDIR
+ DEPS="$DEPS $SRCDIR/queue.h"
have_opt "OWN_QUEUE_H"
fi
@@ -805,7 +832,7 @@ if [ $? -eq 1 ] ; then
check_macro "MAXPATHLEN" "sys/param.h"
if [ $? -eq 1 ] ; then
have_opt "MAXPATHLEN"
- echo "#define MAXPATHLEN 4096" >> $CONFIG
+ echo "#define MAXPATHLEN 4096" >> $SRCDIR/$CONFIG
else
have_opt "MAXPATHLEN"
fi
diff --git a/perl/rspamd.xs b/perl/rspamd.xs
index b22dc849f..1c36b06e0 100644
--- a/perl/rspamd.xs
+++ b/perl/rspamd.xs
@@ -10,11 +10,11 @@
#include <perl.h>
#include <XSUB.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
-#include "../perl.h"
-#include "../mem_pool.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
+#include "../src/perl.h"
+#include "../src/mem_pool.h"
#define perl_set_session(r) \
r = INT2PTR(struct worker_task *, SvIV((SV *) SvRV(ST(0))))
diff --git a/rspamd.conf.sample b/rspamd.conf.sample
new file mode 100644
index 000000000..c146ce629
--- /dev/null
+++ b/rspamd.conf.sample
@@ -0,0 +1,13 @@
+# Sample config file for rspamd
+# $Id$
+#
+
+
+# pidfile - path to pid file
+# Default: pidfile = /var/run/rspamd.pid
+
+pidfile = "./rspamd.pid";
+
+workers = 1;
+
+bind_socket = localhost:11333;
diff --git a/cfg_file.h b/src/cfg_file.h
index 1eb71476d..1eb71476d 100644
--- a/cfg_file.h
+++ b/src/cfg_file.h
diff --git a/cfg_file.l b/src/cfg_file.l
index fefd11237..fefd11237 100644
--- a/cfg_file.l
+++ b/src/cfg_file.l
diff --git a/cfg_file.y b/src/cfg_file.y
index 1838c0f6e..dbbdd4e63 100644
--- a/cfg_file.y
+++ b/src/cfg_file.y
@@ -486,9 +486,6 @@ loggingfacility:
if (strncasecmp ($3, "LOG_AUTH", sizeof ("LOG_AUTH") - 1) == 0) {
cfg->log_facility = LOG_AUTH;
}
- else if (strncasecmp ($3, "LOG_CONSOLE", sizeof ("LOG_CONSOLE") - 1) == 0) {
- cfg->log_facility = LOG_CONSOLE;
- }
else if (strncasecmp ($3, "LOG_CRON", sizeof ("LOG_CRON") - 1) == 0) {
cfg->log_facility = LOG_CRON;
}
diff --git a/cfg_utils.c b/src/cfg_utils.c
index 9fa7aac47..9fa7aac47 100644
--- a/cfg_utils.c
+++ b/src/cfg_utils.c
diff --git a/controller.c b/src/controller.c
index 1efb8c35c..1efb8c35c 100644
--- a/controller.c
+++ b/src/controller.c
diff --git a/filter.c b/src/filter.c
index d1edbb930..d1edbb930 100644
--- a/filter.c
+++ b/src/filter.c
diff --git a/filter.h b/src/filter.h
index ce8be7ecd..ce8be7ecd 100644
--- a/filter.h
+++ b/src/filter.h
diff --git a/fstring.c b/src/fstring.c
index ad0be7d78..ad0be7d78 100644
--- a/fstring.c
+++ b/src/fstring.c
diff --git a/fstring.h b/src/fstring.h
index c3087b2c5..c3087b2c5 100644
--- a/fstring.h
+++ b/src/fstring.h
diff --git a/main.c b/src/main.c
index d2dec7e47..d2dec7e47 100644
--- a/main.c
+++ b/src/main.c
diff --git a/main.h b/src/main.h
index efb716ab0..efb716ab0 100644
--- a/main.h
+++ b/src/main.h
diff --git a/mem_pool.c b/src/mem_pool.c
index f116fff73..f116fff73 100644
--- a/mem_pool.c
+++ b/src/mem_pool.c
diff --git a/mem_pool.h b/src/mem_pool.h
index 4027b5de2..4027b5de2 100644
--- a/mem_pool.h
+++ b/src/mem_pool.h
diff --git a/memcached-test.c b/src/memcached-test.c
index c258673bd..c258673bd 100644
--- a/memcached-test.c
+++ b/src/memcached-test.c
diff --git a/memcached.c b/src/memcached.c
index 05ae16617..05ae16617 100644
--- a/memcached.c
+++ b/src/memcached.c
diff --git a/memcached.h b/src/memcached.h
index 46bcae465..46bcae465 100644
--- a/memcached.h
+++ b/src/memcached.h
diff --git a/perl.c b/src/perl.c
index 870283835..870283835 100644
--- a/perl.c
+++ b/src/perl.c
diff --git a/perl.h b/src/perl.h
index 9a37634e3..9a37634e3 100644
--- a/perl.h
+++ b/src/perl.h
diff --git a/plugins/regexp.c b/src/plugins/regexp.c
index f82543a7e..f82543a7e 100644
--- a/plugins/regexp.c
+++ b/src/plugins/regexp.c
diff --git a/plugins/surbl.c b/src/plugins/surbl.c
index c90a8419e..c90a8419e 100644
--- a/plugins/surbl.c
+++ b/src/plugins/surbl.c
diff --git a/protocol.c b/src/protocol.c
index b259f6cd9..b259f6cd9 100644
--- a/protocol.c
+++ b/src/protocol.c
diff --git a/protocol.h b/src/protocol.h
index 6c750e91f..6c750e91f 100644
--- a/protocol.h
+++ b/src/protocol.h
diff --git a/upstream.c b/src/upstream.c
index 87aab8535..87aab8535 100644
--- a/upstream.c
+++ b/src/upstream.c
diff --git a/upstream.h b/src/upstream.h
index a6c6b2200..a6c6b2200 100644
--- a/upstream.h
+++ b/src/upstream.h
diff --git a/url.c b/src/url.c
index 83ee0195a..83ee0195a 100644
--- a/url.c
+++ b/src/url.c
diff --git a/url.h b/src/url.h
index 6987c38d1..6987c38d1 100644
--- a/url.h
+++ b/src/url.h
diff --git a/util.c b/src/util.c
index 90a536359..90a536359 100644
--- a/util.c
+++ b/src/util.c
diff --git a/util.h b/src/util.h
index 1791f4635..1791f4635 100644
--- a/util.h
+++ b/src/util.h
diff --git a/worker.c b/src/worker.c
index 268e8123b..268e8123b 100644
--- a/worker.c
+++ b/src/worker.c
diff --git a/test/.depends b/test/.depends
index 52848a04a..2c4e7865e 100644
--- a/test/.depends
+++ b/test/.depends
@@ -1,7 +1,7 @@
#if HAVE_STRLCPY_H
-../strlcpy.c
+../src/strlcpy.c
#endif
-../mem_pool.c
-../url.c
-../util.c
-../memcached.c
+../src/mem_pool.c
+../src/url.c
+../src/util.c
+../src/memcached.c
diff --git a/test/rspamd_expression_test.c b/test/rspamd_expression_test.c
index 5d8e2a6f2..e5d0456ea 100644
--- a/test/rspamd_expression_test.c
+++ b/test/rspamd_expression_test.c
@@ -12,9 +12,9 @@
#include <string.h>
#include <stdio.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
#include "tests.h"
/* Vector of test expressions */
diff --git a/test/rspamd_mem_pool_test.c b/test/rspamd_mem_pool_test.c
index 97ee03604..2e28a0f8a 100644
--- a/test/rspamd_mem_pool_test.c
+++ b/test/rspamd_mem_pool_test.c
@@ -1,11 +1,12 @@
-#include "../mem_pool.h"
-#include "tests.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
+#include "../src/mem_pool.h"
+#include "tests.h"
+
#define TEST_BUF "test bufffer"
#define TEST2_BUF "test bufffertest bufffer"
diff --git a/test/rspamd_memcached_test.c b/test/rspamd_memcached_test.c
index 60ae1d3eb..467641897 100644
--- a/test/rspamd_memcached_test.c
+++ b/test/rspamd_memcached_test.c
@@ -12,10 +12,10 @@
#include <string.h>
#include <event.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
-#include "../memcached.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
+#include "../src/memcached.h"
#include "tests.h"
u_char *buf = "test";
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c
index dba448a2c..08de6fcf4 100644
--- a/test/rspamd_test_suite.c
+++ b/test/rspamd_test_suite.c
@@ -8,9 +8,9 @@
#include <fcntl.h>
#include <stdlib.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
#include "tests.h"
int
diff --git a/test/rspamd_url_test.c b/test/rspamd_url_test.c
index 7526435c8..d73e80707 100644
--- a/test/rspamd_url_test.c
+++ b/test/rspamd_url_test.c
@@ -11,10 +11,10 @@
#include <stdlib.h>
#include <string.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
-#include "../url.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
+#include "../src/url.h"
#include "tests.h"
const char *test_text =
diff --git a/utils/.depends b/utils/.depends
index 52848a04a..2c4e7865e 100644
--- a/utils/.depends
+++ b/utils/.depends
@@ -1,7 +1,7 @@
#if HAVE_STRLCPY_H
-../strlcpy.c
+../src/strlcpy.c
#endif
-../mem_pool.c
-../url.c
-../util.c
-../memcached.c
+../src/mem_pool.c
+../src/url.c
+../src/util.c
+../src/memcached.c
diff --git a/utils/url_extracter.c b/utils/url_extracter.c
index eadf922c2..f92c76381 100644
--- a/utils/url_extracter.c
+++ b/utils/url_extracter.c
@@ -13,10 +13,10 @@
#include <gmime/gmime.h>
-#include "../config.h"
-#include "../main.h"
-#include "../cfg_file.h"
-#include "../url.h"
+#include "../src/config.h"
+#include "../src/main.h"
+#include "../src/cfg_file.h"
+#include "../src/url.h"
static void
mime_foreach_callback (GMimeObject *part, gpointer user_data)