initial release

This commit is contained in:
SJ
2011-11-14 15:57:52 +01:00
commit 57f172c1b1
58 changed files with 13880 additions and 0 deletions

48
etc/Makefile Normal file
View File

@ -0,0 +1,48 @@
SHELL = /bin/bash
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
srcdir = .
sysconfdir = ${prefix}/etc
mandir = ${datarootdir}/man
datarootdir = ${prefix}/share
localstatedir = /var
CC = gcc
CFLAGS = -O2 -Wall -g
DEFS = -DHAVE_MYSQL -D_GNU_SOURCE -DHAVE_ANTISPAM -DUSERS_IN_MYSQL -DHAVE_USERS -DNEED_MYSQL
INCDIR = -I. -I../.. -I../../src -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX
LIBDIR = -L. -L../../src
LIBS = -lm -ldl -rdynamic -L/usr/lib/mysql -lmysqlclient_r
LDAP_LIBS =
CLAPF_USER = clapf
CLAPF_GROUP = `id -gn $(CLAPF_USER)`
INSTALL = /usr/bin/install -c
all:
sed -e 's%pidfile=.*%pidfile=$(localstatedir)/run/clapf/clapf.pid%g' \
-e 's%sqlite3=.*%sqlite3=$(localstatedir)/lib/clapf/data/tokens.sdb%g' \
-e 's%workdir=.*%workdir=$(localstatedir)/spool/clapf/tmp%g' \
-e 's%queuedir=.*%queuedir=$(localstatedir)/lib/clapf/queue%g' \
-e 's%mydbfile=.*%mydbfile=$(localstatedir)/lib/clapf/tokens.mydb%g' < $(srcdir)/example.conf > $(srcdir)/clapf.conf
sed -e 's%LOCALSTATEDIR%$(localstatedir)%g' \
-e 's%LIBEXECDIR%$(libexecdir)%g' \
-e 's%SYSCONFDIR%$(sysconfdir)%g' \
-e 's%SBINDIR%$(sbindir)%g' \
-e 's%DATAROOTDIR%$(datarootdir)%g' < $(srcdir)/cron.jobs.in > $(srcdir)/cron.jobs
install:
if [ ! -f "$(DESTDIR)$(sysconfdir)/clapf.conf" ]; then $(INSTALL) -m 0640 $(srcdir)/clapf.conf $(DESTDIR)$(sysconfdir)/clapf.conf; chgrp $(CLAPF_GROUP) $(DESTDIR)$(sysconfdir)/clapf.conf; fi
clean:
rm -f clapf.conf cron.jobs
distclean: clean
rm -f Makefile

39
etc/Makefile.in Normal file
View File

@ -0,0 +1,39 @@
SHELL = @SHELL@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
includedir = @includedir@
libdir = @libdir@
libexecdir = @libexecdir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
mandir = @mandir@
datarootdir = @datarootdir@
localstatedir = @localstatedir@
CC = @CC@
CFLAGS = @CFLAGS@ @CPPFLAGS@
DEFS = @defs@
INCDIR = -I. -I../.. -I../../src @INCDIR@ @mysql_includes@
LIBDIR = -L. @LIBDIR@ @LDFLAGS@ -L../../src
LIBS = @LIBS@ @mysql_libs@
RUNNING_USER = @RUNNING_USER@
RUNNING_GROUP = `@id_bin@ -gn $(RUNNING_USER)`
INSTALL = @INSTALL@
all:
sed -e 's%pidfile=.*%pidfile=$(localstatedir)/run/piler/piler.pid%g' \
-e 's%workdir=.*%workdir=$(localstatedir)/spool/piler/tmp%g' \
-e 's%queuedir=.*%queuedir=$(localstatedir)/piler/queue%g' < $(srcdir)/example.conf > $(srcdir)/piler.conf
install:
if [ ! -f "$(DESTDIR)$(sysconfdir)/piler.conf" ]; then $(INSTALL) -m 0640 $(srcdir)/piler.conf $(DESTDIR)$(sysconfdir)/piler.conf; chgrp $(CLAPF_GROUP) $(DESTDIR)$(sysconfdir)/piler.conf; fi
clean:
rm -f piler.conf cron.jobs
distclean: clean
rm -f Makefile

84
etc/example.conf Normal file
View File

@ -0,0 +1,84 @@
; This is an example config with default values
; Attention: do _not_ use whitespace between keys and values
; verbosity level. The more logging the greater load
; 1: normal
; 3: info
; 5: debug
verbosity=1
; piler daemon will use this user (and its group)
; it it was started by root
username=piler
; number of worker processes, ie. the number of simultaneous smtp connections to piler.
number_of_worker_processes=5
; number of processed emails per each piler process
max_requests_per_child=50
; SMTP HELO identification string
hostid=av-engine.localhost
; write pid file
pidfile=/var/run/piler/piler.pid
; piler will listen here
listen_addr=0.0.0.0
listen_port=25
clamd_socket=/tmp/clamd
session_timeout=420
; the 2nd parameter of the listen() system call. Please note that this is set
; when clapf starts up and you should restart clapf if you change this variable.
; Please also note that the meaning of this variable depends on your Unix implementation
backlog=20
workdir=/var/spool/piler/tmp
;
; memcached stuff
;
; memcached server to use. Currently clapf support only 1 memcached server
memcached_servers=127.0.0.1
; ttl (in secs) of a stored object
; 0 means records don't expire
memcached_ttl=86400
piler_header_field=X-piler: ahahahahaha
;
; mysql stuff
;
;mysqlhost=127.0.0.1
;mysqlport=3306
mysqlsocket=/tmp/mysql.sock
mysqluser=piler
mysqlpwd=changeme
mysqldb=piler
mysql_connect_timeout=2
;
; sqlite3 stuff
;
; If you are using spamdrop (not the clapf daemon), you have two options:
; 1. You may specify this variable, then every user will share this token
; database (=shared database) OR
; 2. comment this variable out, and spamdrop will figure out where the users'
; individual token databases are.
sqlite3=/var/lib/piler/data/tokens.sdb
; set sqlite3 pragma, see http://www.sqlite.org/pragma.html for more details
; possible values are:
; PRAGMA synchronous = FULL
; PRAGMA synchronous = NORMAL
; PRAGMA synchronous = OFF
sqlite3_pragma=PRAGMA synchronous = OFF

86
etc/sphinx.conf Normal file
View File

@ -0,0 +1,86 @@
#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
source main
{
type = mysql
sql_host = localhost
sql_db = sphinx
sql_user = sphinx
sql_pass = sphinx
sql_query_pre = SET NAMES utf8
sql_query = SELECT id, `from`, `to`, `subject`, `date`, `body`, `piler_id`, `header_id`, `body_id`, `size` FROM sph_index \
WHERE id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 )
sql_attr_uint = size
sql_attr_uint = date
sql_attr_string = piler_id
sql_attr_string = header_id
sql_attr_string = body_id
}
source delta
{
type = mysql
sql_host = localhost
sql_db = sphinx
sql_user = sphinx
sql_pass = sphinx
sql_query_pre = SET NAMES utf8
sql_query_pre = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM sph_index
sql_query_post_index = DELETE FROM sph_index WHERE id<=(SELECT max_doc_id FROM sph_counter WHERE counter_id=1)
sql_query = SELECT id, `from`, `to`, `subject`, `date`, `body`, `piler_id`, `header_id`, `body_id`, `size` FROM sph_index \
WHERE id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1)
sql_attr_uint = size
sql_attr_uint = date
sql_attr_string = piler_id
sql_attr_string = header_id
sql_attr_string = body_id
}
index main1
{
source = main
path = /var/data/main1
docinfo = extern
charset_type = utf-8
}
index delta1
{
source = delta
path = /var/data/delta1
docinfo = extern
charset_type = utf-8
}
indexer
{
mem_limit = 32M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = /var/data/log/searchd.log
binlog_path =
query_log = /var/data/log/query.log
read_timeout = 5
max_children = 30
pid_file = /var/data/log/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
}