From: Vsevolod Stakhov Date: Sat, 25 May 2013 12:44:33 +0000 (+0100) Subject: Initial version of centos/rhel spec file. X-Git-Tag: 0.5.5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2114c11f5b9954b3d93e80f4abb4cf894e503383;p=thirdparty%2Frspamd.git Initial version of centos/rhel spec file. --- diff --git a/centos/rspamd.spec b/centos/rspamd.spec new file mode 100644 index 0000000000..da9354e6a6 --- /dev/null +++ b/centos/rspamd.spec @@ -0,0 +1,112 @@ +%define rspamd_user rspamd +%define rspamd_group %{rspamd_user} +%define rspamd_home %{_localstatedir}/lib/rspamd +%define rspamd_logdir %{_localstatedir}/log/rspamd +%define rspamd_confdir %{_sysconfdir}/rspamd + +Name: rspamd +Version: 0.5.5 +Release: 1 +Summary: Rapid spam filtering system +Group: System Environment/Daemons + +# BSD License (two clause) +# http://www.freebsd.org/copyright/freebsd-license.html +License: BSD +URL: https://bitbucket.org/vstakhov/rspamd/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +BuildRequires: cmake,glib2-devel,gmime-devel,openssl-devel,lua-devel +Requires: glib2,gmime,lua +# for /user/sbin/useradd +Requires(pre): shadow-utils +Requires(post): chkconfig +# for /sbin/service +Requires(preun): chkconfig, initscripts +Requires(postun): initscripts + +Source0: http://cdn.bitbucket.org/vstakhov/rspamd/downloads/%{name}-%{version}.tar.gz +Source1: %{name}.init +Source2: %{name}.logrotate +Source3: %{name}.xml + +%description +Rspamd is a rapid, modular and lightweight spam filter. It is designed to work +with big amount of mail and can be easily extended with own filters written in +lua. + +%prep +%setup -q + +%build +cmake %{_sourcedir} \ + -DETC_PREFIX=%{_sysconfdir} + -DMAN_PREFIX=%{_mandir} \ + -DLOCALSTATES_PREFIX=%{_localstatedir}/lib \ + -DLIBDIR=%{_libdir} \ + -DINCLUDEDIR=%{_includedir} \ + -DNO_SHARED=ON \ + -DDEBIAN_BUILD=1 \ + -DRSPAMD_GROUP=%{rspamd_group} \ + -DRSPAMD_USER=%{rspamd_user} + +%{__make} %{?_smp_mflags} + +%install +rm -rf %{buildroot} +%{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor + +%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name} +%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} + +%clean +rm -rf %{buildroot} + +%pre +%{_sbindir}/useradd -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || : + +%post +/sbin/chkconfig --add %{name} + +%preun +if [ $1 = 0 ]; then + /sbin/service %{name} stop >/dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%postun +if [ $1 -ge 1 ]; then + /sbin/service %{name} condrestart > /dev/null 2>&1 || : +fi + +%files +%defattr(-,root,root,-) +%{_initrddir}/%{name} +%{_mandir}/man8/%{name}.* +%{_mandir}/man1/rspamc.* +%{_bindir}/rspamd +%{_bindir}/rspamc +%dir %{rspamd_confdir} +%config(noreplace) %{rspamd_confdir}/2tld.inc +%config(noreplace) %{rspamd_confdir}/2tld.inc.orig +%config(noreplace) %{rspamd_confdir}/surbl-whitelist.inc +%config(noreplace) %{rspamd_confdir}/plugins/lua/forged_recipients.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/maillist.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/multimap.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/once_received.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/received_rbl.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/ratelimit.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/whitelist.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/phishing.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/trie.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/emails.lua +%config(noreplace) %{rspamd_confdir}/plugins/lua/ip_score.lua +%config(noreplace) %{rspamd_confdir}/lua/regexp/drugs.lua +%config(noreplace) %{rspamd_confdir}/lua/regexp/fraud.lua +%config(noreplace) %{rspamd_confdir}/lua/regexp/headers.lua +%config(noreplace) %{rspamd_confdir}/lua/regexp/lotto.lua +%config(noreplace) %{rspamd_confdir}/lua/rspamd.lua +%config(noreplace) %{rspamd_confdir}/lua/rspamd.classifiers.lua + +%changelog +* Sat May 25 2013 Vsevolod Stakhov 0.5.5-1 +- Initial spec version. diff --git a/centos/sources/rspam.logrotate b/centos/sources/rspam.logrotate new file mode 100644 index 0000000000..0b93591d4c --- /dev/null +++ b/centos/sources/rspam.logrotate @@ -0,0 +1,11 @@ +/var/log/rspamd/*log { + daily + rotate 10 + missingok + notifempty + compress + sharedscripts + postrotate + [ ! -f /var/run/rspamd.pid ] || kill -USR1 `cat /var/run/rspamd.pid` + endscript +} diff --git a/centos/sources/rspamd.init b/centos/sources/rspamd.init new file mode 100644 index 0000000000..56cea96519 --- /dev/null +++ b/centos/sources/rspamd.init @@ -0,0 +1,120 @@ +#!/bin/sh +# +# rspamd - this script starts and stops the rspamd daemon +# +# chkconfig: - 85 15 +# description: rspamd is a spam filtering system +# processname: rspamd +# config: /etc/rspamd/rspamd.xml +# config: /etc/sysconfig/rspamd +# pidfile: /var/run/rspamd/rspamd.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "$NETWORKING" = "no" ] && exit 0 + +rspamd="/usr/bin/rspamd" +prog=$(basename $rspamd) + +RSPAMD_CONF_FILE="/etc/rspamd/rspamd" +RSPAMD_USER="rspamd" +RSPAMD_GROUP="rspamd" + +[ -f /etc/sysconfig/rspamd ] && . /etc/sysconfig/rspamd + +lockfile=/var/lock/subsys/rspamd + +start() { + [ -x $rspamd ] || exit 5 + [ -f $rspamd_CONF_FILE ] || exit 6 + echo -n $"Starting $prog: " + daemon $rspamd -c $RSPAMD_CONF_FILE -u $RSPAMD_USER -g $RSPAMD_GROUP + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog -QUIT + retval=$? + if [ $retval -eq 0 ]; then + if [ "$CONSOLETYPE" != "serial" ]; then + echo -en "\\033[16G" + fi + while rh_status_q + do + sleep 1 + echo -n $"." + done + rm -f $lockfile + fi + echo + return $retval +} + +restart() { + configtest || return $? + stop + start +} + +reload() { + configtest || return $? + echo -n $"Reloading $prog: " + killproc $rspamd -HUP + RETVAL=$? + echo +} + +force_reload() { + restart +} + +configtest() { + $rspamd -t -c $RSPAMD_CONF_FILE +} + +rh_status() { + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart|configtest) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" + exit 2 +esac diff --git a/centos/sources/rspamd.xml b/centos/sources/rspamd.xml new file mode 100644 index 0000000000..f83947d129 --- /dev/null +++ b/centos/sources/rspamd.xml @@ -0,0 +1,752 @@ + + + + + + + + + /tmp + + /var/run/rspamd.pid + + regexp,surbl,chartable,fuzzy_check,spf,dkim + + 250M + + no + + no + + yes + + 1s + + 5 + + /var/lib/rspamd/symbols.cache + + 10.0s + + /var/lib/rspamd/rspamd_dynamic + + no + + + + + + info + no + file + + + + + + + + + default + + 15.0 + + reject + greylist:4 + add_header:8 + + + + + MISSING_SUBJECT + + FORGED_OUTLOOK_TAGS + + FORGED_SENDER + + SUSPICIOUS_RECIPS + + FAKE_REPLY_C + + MIME_HTML_ONLY + + FORGED_MSGID_YAHOO + + FORGED_MUA_THEBAT_BOUN + + R_MISSING_CHARSET + + RCVD_DOUBLE_IP_SPAM + + FORGED_OUTLOOK_HTML + + R_UNDISC_RCPT + + R_WHITE_ON_WHITE + + HTML_SHORT_LINK_IMG_2 + + FORGED_MUA_OUTLOOK + + FORGED_MUA_OUTLOOK_MAILLIST + + + SUSPICIOUS_BOUNDARY + + SUSPICIOUS_BOUNDARY2 + + SUSPICIOUS_BOUNDARY3 + + SUSPICIOUS_BOUNDARY4 + + + FORGED_MUA_THEBAT_MSGID + + FORGED_MUA_THEBAT_MSGID_UNKNOWN + + + FORGED_MUA_KMAIL_MSGID + + FORGED_MUA_KMAIL_MSGID_UNKNOWN + + + FORGED_MUA_OPERA_MSGID + + SUSPICIOUS_OPERA_10W_MSGID + + + FORGED_MUA_MOZILLA_MAIL_MSGID + + FORGED_MUA_MOZILLA_MAIL_MSGID_UNKNOWN + + FORGED_MUA_THUNDERBIRD_MSGID + + FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN + + FORGED_MUA_SEAMONKEY_MSGID + + FORGED_MUA_SEAMONKEY_MSGID_UNKNOWN + + + FM_FAKE_HELO_VERIZON + + REPTO_QUOTE_YAHOO + + MISSING_MIMEOLE + + MISSING_TO + + + FROM_EXCESS_BASE64 + + FROM_EXCESS_QP + + TO_EXCESS_BASE64 + + TO_EXCESS_QP + + REPLYTO_EXCESS_BASE64 + + REPLYTO_EXCESS_QP + + CC_EXCESS_BASE64 + + CC_EXCESS_QP + + + R_MIXED_CHARSET + + SORTED_RECIPS + + R_RCVD_SPAMBOTS + + R_TO_SEEMS_AUTO + + SUBJECT_NEEDS_ENCODING + + TRACKER_ID + + R_NO_SPACE_IN_FROM + + R_SAJDING + + R_BAD_CTE_7BIT + + R_FLASH_REDIR_IMGSHACK + + INVALID_MSGID + + MISSING_MID + + FORGED_RECIPIENTS + + FORGED_RECIPIENTS_MAILLIST + + RATWARE_MS_HASH + + STOX_REPLY_TYPE + + R_IP_PBL + + ONCE_RECEIVED + + ONCE_RECEIVED_STRICT + + RECEIVED_RBL + + R_PARTS_DIFFER + + MIME_HEADER_CTYPE_ONLY + + R_EMPTY_IMAGE + + + DRUGS_MANYKINDS + + DRUGS_ANXIETY + DRUGS_MUSCLE + DRUGS_ANXIETY_EREC + DRUGS_DIET + DRUGS_ERECTILE + + + ADVANCE_FEE_2 + ADVANCE_FEE_3 + + + R_LOTTO + + + BAYES_SPAM + BAYES_HAM + + + R_FUZZY + R_FUZZY1 + R_FUZZY2 + R_FUZZY3 + + + R_DKIM_REJECT + R_DKIM_TEMPFAIL + R_DKIM_ALLOW + + + R_SPF_FAIL + R_SPF_SOFTFAIL + R_SPF_ALLOW + + + MAILLIST + + + + PH_SURBL_MULTI + + OB_SURBL_MULTI + + AB_SURBL_MULTI + + SC_SURBL_MULTI + + JP_SURBL_MULTI + + WS_SURBL_MULTI + + + RAMBLER_URIBL + + + DBL + + + RAMBLER_EMAILBL + + + PHISHING + + + HEADER_FROM_DELIMITER_TAB + HEADER_TO_DELIMITER_TAB + HEADER_CC_DELIMITER_TAB + HEADER_REPLYTO_DELIMITER_TAB + HEADER_DATE_DELIMITER_TAB + + + HEADER_FROM_EMPTY_DELIMITER + HEADER_TO_EMPTY_DELIMITER + HEADER_CC_EMPTY_DELIMITER + HEADER_REPLYTO_EMPTY_DELIMITER + HEADER_DATE_EMPTY_DELIMITER + + + RCVD_ILLEGAL_CHARS + FAKE_RECEIVED_mail_ru + FAKE_RECEIVED_smtp_yandex_ru + FORGED_GENERIC_RECEIVED + FORGED_GENERIC_RECEIVED2 + FORGED_GENERIC_RECEIVED3 + FORGED_GENERIC_RECEIVED4 + FORGED_GENERIC_RECEIVED5 + INVALID_POSTFIX_RECEIVED + INVALID_EXIM_RECEIVED + INVALID_EXIM_RECEIVED2 + + + DATE_IN_FUTURE + DATE_IN_PAST + + + + +FORGED_RECIPIENTS & -MAILLIST +FORGED_MUA_OUTLOOK & -MAILLIST + + + + + fuzzy + localhost:11335 + 1 + 2048 + + /var/lib/rspamd/fuzzy.db + yes + + + controller + localhost:11334 + 1 + 2048 + + q1 + + + normal + *:11333 + 2048 + + + + + webui + 1 + localhost:11336 + + q1 + + + + + + + + localhost:11335 + R_FUZZY + 300 + 10 + application/pdf + 1:R_FUZZY1:10,2:R_FUZZY2:5,3:R_FUZZY3:-2.1 + + + + + + FORGED_SENDER + FORGED_RECIPIENTS + + + + + MAILLIST + + + + + file:///etc/rspamd/surbl-whitelist.inc + file:///etc/rspamd/2tld.inc + JP + AB + OB + PH + WS + SC + uribl.rambler.ru + + dbl.spamhaus.org + + noip + + + + + + + RECEIVED_RBL + pbl.spamhaus.org + xbl.spamhaus.org + insecure-bl.rambler.ru + + + + + + + + + 0.3 + R_MIXED_CHARSET + + + + + mail + static + dynamic + ONCE_RECEIVED_STRICT + ONCE_RECEIVED + + + + + + type = dnsbl, map = pbl.spamhaus.org, symbol = R_IP_PBL, description = PBL dns block list + + + + + PHISHING + + + + + + + + + + symbol = RAMBLER_EMAILBL, dnsbl = email-bl.rambler.ru, domain_only = false + + + + + + 2048 + 1d + + + + + + 2048 + 1d + + + + + + + + 1m + + + no + + + no + + + + + + + + + + + to:100:0.033333333 + + to_ip:30:0.025 + + to_ip_from:20:0.01666666667 + + + bounce_to:10:0.000555556 + + bounce_to_ip:5:0.000277778 + + + + + + postmaster,mailer-daemon + + + 5 + + + + + + 1M + + + + + + + + + + + + + + osb-text + default + 10 + 1000 + + BAYES_HAM + 20M + /var/lib/rspamd/bayes.ham + + + BAYES_SPAM + 20M + /var/lib/rspamd/bayes.spam + + + + + + + + + + + /etc/rspamd/plugins/lua/ + + + + diff --git a/linux/rspamd_rh.in b/linux/rspamd_rh.in index 09dae24b87..56cea96519 100644 --- a/linux/rspamd_rh.in +++ b/linux/rspamd_rh.in @@ -22,8 +22,8 @@ rspamd="/usr/bin/rspamd" prog=$(basename $rspamd) RSPAMD_CONF_FILE="/etc/rspamd/rspamd" -RSPAMD_USER="nobody" -RSPAMD_GROUP="nobody" +RSPAMD_USER="rspamd" +RSPAMD_GROUP="rspamd" [ -f /etc/sysconfig/rspamd ] && . /etc/sysconfig/rspamd