From 9fb28304cde41c5e3e4bd17daaad715337a6878c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 2 Feb 2013 23:27:55 +0400 Subject: [PATCH] Final update for 0.5.4. --- CMakeLists.txt | 60 +-- conf/rspamd-basic.xml.in | 24 +- debian/changelog | 7 + debian/control | 4 +- debian/postrm | 91 ++++ debian/preinst | 82 ++++ debian/rspamd.init | 8 +- debian/rspamd.install | 1 + debian/rspamd.xml | 752 ++++++++++++++++++++++++++++++++++ debian/rules | 5 +- src/plugins/lua/multimap.lua | 9 +- src/plugins/lua/phishing.lua | 2 +- src/plugins/lua/ratelimit.lua | 5 +- 13 files changed, 980 insertions(+), 70 deletions(-) create mode 100644 debian/postrm create mode 100644 debian/preinst create mode 100644 debian/rspamd.install create mode 100644 debian/rspamd.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index 0432fc3c1..3ea4e2ea1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,16 @@ PROJECT(rspamd C) SET(RSPAMD_VERSION_MAJOR 0) SET(RSPAMD_VERSION_MINOR 5) -SET(RSPAMD_VERSION_PATCH 3) +SET(RSPAMD_VERSION_PATCH 4) SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}") SET(RSPAMD_MASTER_SITE_URL "http://bitbucket.org/vstakhov/rspamd") -SET(RSPAMD_USER "nobody") -SET(RSPAMD_GROUP "nobody") + +IF(NOT RSPAMD_USER) + SET(RSPAMD_USER "nobody") + SET(RSPAMD_GROUP "nobody") +ENDIF(NOT RSPAMD_USER) CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) @@ -1060,7 +1063,9 @@ IF(NOT EXISTS ${ETC_PREFIX}/rspamd/surbl-whitelist.inc OR BUILD_PORT) INSTALL(FILES conf/surbl-whitelist.inc DESTINATION ${ETC_PREFIX}/rspamd) ENDIF(NOT EXISTS ${ETC_PREFIX}/rspamd/surbl-whitelist.inc OR BUILD_PORT) -INSTALL(FILES ${CMAKE_BINARY_DIR}/conf/rspamd.xml.sample DESTINATION ${ETC_PREFIX}) +IF(NOT DEBIAN_BUILD) + INSTALL(FILES ${CMAKE_BINARY_DIR}/conf/rspamd.xml.sample DESTINATION ${ETC_PREFIX}) +ENDIF(NOT DEBIAN_BUILD) # Lua plugins INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${ETC_PREFIX}/rspamd/plugins/lua)") @@ -1094,51 +1099,8 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT BUILD_PORT) INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/${LOCALSTATES_PREFIX})") INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} \$ENV{DESTDIR}/${LOCALSTATES_PREFIX})") ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT BUILD_PORT) -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") +IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT DEBIAN_BUILD) INSTALL(PROGRAMS "linux/${LINUX_START_SCRIPT}" DESTINATION ${ETC_PREFIX}/init.d RENAME rspamd) INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/${LOCALSTATES_PREFIX})") INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} \$ENV{DESTDIR}/${LOCALSTATES_PREFIX})") -ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -# CPack section -SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libevent-1.4-2, libgmime-2.0-2a") -SET(CPACK_PACKAGE_CONTACT "vsevolod@highsecure.ru") -SET(CPACK_PACKAGE_NAME rspamd) -SET(CPACK_SOURCE_IGNORE_FILES "\\\\.swp$" "/\\\\.hg/") -SET(CPACK_PACKAGE_VERSION_MAJOR ${RSPAMD_VERSION_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${RSPAMD_VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${RSPAMD_VERSION_PATCH}) -INCLUDE(CPack) - -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - INCLUDE("linux/cmake/DpkgDeb.cmake") -ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - INCLUDE("freebsd/cmake/PkgCreate.cmake") -ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - -SET(RPMNAME "rspamd") -SET(PACKAGE_NAME "rspamd") -SET(PACKAGE_RELEASE "1") -SET(PACKAGE_SECTION "mail") -SET(PACKAGE_PRIORITY "optional") -SET(PACKAGE_HOMEPAGE "http://bitbucket.org/vstakhov/rspamd") -SET(PACKAGE_MAINTAINER_NAME "vstakhov") -SET(PACKAGE_MAINTAINER_EMAIL "vsevolod@highsecure.ru") -SET(PACKAGE_DESCRIPTION_SUMMARY "rspamd - fast and modular antispam system written in C") -SET(PACKAGE_DESCRIPTION "Fast and modular antispam system written in C") -IF(GMIME24) - SET(PACKAGE_DEPENDS "libc6, libevent-1.4-2, libgmime-2.4-2, liblua5.1-0, libxml-parser-perl, libterm-readkey-perl, libglib2.0-0") -ELSE(GMIME24) - SET(PACKAGE_DEPENDS "libc6, libevent-1.4-2, libgmime-2.0-2, libxml-parser-perl, libterm-readkey-perl, libglib2.0-0") -ENDIF(GMIME24) - -SET(PACKAGE_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}") - -IF(DPKG_FOUND STREQUAL "YES") - ADD_DEBIAN_PACKAGE("rspamd") -ENDIF(DPKG_FOUND STREQUAL "YES") -IF(PKGCREATE_FOUND STREQUAL "YES") - ADD_FREEBSD_PACKAGE("rspamd" "freebsd/rspamd.plist") -ENDIF(PKGCREATE_FOUND STREQUAL "YES") +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT DEBIAN_BUILD) diff --git a/conf/rspamd-basic.xml.in b/conf/rspamd-basic.xml.in index fbeee898a..6e347f762 100644 --- a/conf/rspamd-basic.xml.in +++ b/conf/rspamd-basic.xml.in @@ -27,6 +27,10 @@ @LOCALSTATES_PREFIX@/symbols.cache 10.0s + + @LOCALSTATES_PREFIX@/rspamd_dynamic + + no @@ -326,10 +330,18 @@ normal *:11333 - 2 2048 + + + webui + 1 + localhost:11336 + + q1 + + @@ -413,10 +425,10 @@ - type = dnsbl, map = pbl.spamhaus.org, symbol = R_IP_PBL + type = dnsbl, map = pbl.spamhaus.org, symbol = R_IP_PBL, description = PBL dns block list @@ -593,12 +605,12 @@ 1000 BAYES_HAM - 10M + 20M @LOCALSTATES_PREFIX@/bayes.ham BAYES_SPAM - 10M + 20M @LOCALSTATES_PREFIX@/bayes.spam diff --git a/debian/changelog b/debian/changelog index 1d76c6c89..4814f47c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +rspamd (0.5.4-1) unstable; urgency=low + + * Upgrade to 0.5.4 + * Use specific user instead of nobody + + -- Vsevolod Stakhov Sat, 02 Fed 2013 15:50:00 +0000 + rspamd (0.5.3-1) unstable; urgency=low * Upgrade to 0.5.3 diff --git a/debian/control b/debian/control index d1fac97c3..4f0b8f5d1 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,6 @@ Package: rspamd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Fast spam filtering system - Rspamd is fast, modular and lightweight spam filter. It is designed to work - with big ammount of mail and can be easily extended with own filters written in + Rspamd is 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. diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 000000000..4af96e131 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,91 @@ +#!/bin/sh +# postrm script for rspamd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|abort-install|disappear) + # find first and last SYSTEM_UID numbers + for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"` + do + case $LINE in + FIRST_SYSTEM_UID*) + FIRST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='` + ;; + LAST_SYSTEM_UID*) + LAST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='` + ;; + *) + ;; + esac + done + # Remove system account if necessary + CREATEDUSER="rspamd" + if [ -n "$FIRST_SYSTEM_UID" ] && [ -n "$LAST_SYSTEM_UID" ] + then + if USERID=`getent passwd $CREATEDUSER | cut -f 3 -d ':'` + then + if [ -n "$USERID" ] + then + if [ "$FIRST_SYSTEM_UID" -le "$USERID" ] && [ "$USERID" -le "$LAST_SYSTEM_UID" ] + then + echo -n "Removing $CREATEDUSER system user.." + deluser --quiet $CREATEDUSER || true + echo "..done" + fi + fi + fi + fi + # Remove system group if necessary + CREATEDGROUP="rspamd" + FIRST_USER_GID=`grep ^USERS_GID /etc/adduser.conf | cut -f2 -d '='` + if [ -n "$FIRST_USER_GID" ] + then + if GROUPGID=`getent group $CREATEDGROUP | cut -f 3 -d ':'` + then + if [ -n "$GROUPGID" ] + then + if [ "$FIRST_USER_GID" -gt "$GROUPGID" ] + then + echo -n "Removing $CREATEDGROUP group.." + delgroup --only-if-empty $CREATEDGROUP || true + echo "..done" + fi + fi + fi + fi + ;; + + upgrade|failed-upgrade|abort-upgrade) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 000000000..df0404b10 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,82 @@ +#!/bin/sh +# preinst script for rmilter +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install) + SERVER_HOME=/var/lib/rspamd + SERVER_LOG=/var/log/rspamd + SERVER_USER=rspamd + SERVER_NAME="Rspamd spam filtering system" + SERVER_GROUP=rspamd + + # create user to avoid running server as root + # 1. create group if not existing + if ! getent group | grep -q "^$SERVER_GROUP:" ; then + echo -n "Adding group $SERVER_GROUP.." + addgroup --quiet --system $SERVER_GROUP 2>/dev/null ||true + echo "..done" + fi + # 2. create homedir if not existing + test -d $SERVER_HOME || mkdir $SERVER_HOME + test -d $SERVER_LOG || mkdir $SERVER_LOG + # 3. create user if not existing + if ! getent passwd | grep -q "^$SERVER_USER:"; then + echo -n "Adding system user $SERVER_USER.." + adduser --quiet \ + --system \ + --ingroup $SERVER_GROUP \ + --no-create-home \ + --disabled-password \ + $SERVER_USER 2>/dev/null || true + echo "..done" + fi + # 4. adjust passwd entry + usermod -c "$SERVER_NAME" \ + -d $SERVER_HOME \ + -g $SERVER_GROUP \ + $SERVER_USER + # 5. adjust file and directory permissions + if ! dpkg-statoverride --list $SERVER_HOME >/dev/null + then + chown -R $SERVER_USER:$SERVER_GROUP $SERVER_HOME $SERVER_LOG + chmod u=rwx,g=rx,o= $SERVER_HOME + chmod u=rwx,g=rx,o=rx $SERVER_LOG + fi + # 6. Add the user to the ADDGROUP group + if test -n $ADDGROUP + then + if ! groups $SERVER_USER | cut -d: -f2 | \ + grep -qw $SERVER_GROUP; then + adduser $SERVER_USER $SERVER_GROUP + fi + fi + ;; + + abort-upgrade|upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rspamd.init b/debian/rspamd.init index 8af5866e4..1ac3ea6d2 100755 --- a/debian/rspamd.init +++ b/debian/rspamd.init @@ -17,11 +17,11 @@ DESC="Rspamd" NAME=rspamd DAEMON=/usr/bin/$NAME DAEMON_ARGS="-c /etc/rspamd.xml" -DESC="spam filtering system" -PIDFILE=/var/run/rspamd/$NAME.pid +DESC="rapid spam filtering system" +PIDFILE=/var/lib/rspamd/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -RSPAMD_USERNAME=nobody -RSPAMD_GROUPNAME=nogroup +RSPAMD_USERNAME=rspamd +RSPAMD_GROUPNAME=rspamd # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 diff --git a/debian/rspamd.install b/debian/rspamd.install new file mode 100644 index 000000000..ca75f0579 --- /dev/null +++ b/debian/rspamd.install @@ -0,0 +1 @@ +debian/rspamd.xml etc diff --git a/debian/rspamd.xml b/debian/rspamd.xml new file mode 100644 index 000000000..17e04e4c4 --- /dev/null +++ b/debian/rspamd.xml @@ -0,0 +1,752 @@ + + + + + + + + + /tmp + + /var/lib/rspamd/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/debian/rules b/debian/rules index 36b16de7d..54b8a8407 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,6 @@ include /usr/share/dpkg/buildflags.mk include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/cmake.mk -DEB_CMAKE_NORMAL_ARGS+= -DETC_PREFIX=/etc -DMAN_PREFIX=/usr/share/man -DLOCALSTATES_PREFIX=/var/run -DLIBDIR=/usr/lib -DINCLUDEDIR=/usr/include -DNO_SHARED=ON -DDEBIAN_BUILD=1 -DRSPAMD_GROUP=nobody +DEB_CMAKE_NORMAL_ARGS+= -DETC_PREFIX=/etc -DMAN_PREFIX=/usr/share/man -DLOCALSTATES_PREFIX=/var/lib -DLIBDIR=/usr/lib -DINCLUDEDIR=/usr/include -DNO_SHARED=ON -DDEBIAN_BUILD=1 -DRSPAMD_GROUP=rspamd -DRSPAMD_USER=rspamd clean:: - rm -f src/modules.c - + rm -f src/modules.c \ No newline at end of file diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index fe213b8e6..0366d4843 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -241,7 +241,8 @@ local function add_multimap_rule(params) header = nil, pattern = nil, map = nil, - symbol = nil + symbol = nil, + description = 'undefined multimap map' } for _,param in ipairs(params) do local _,_,name,value = string.find(param, '(%w+)%s*=%s*(.+)') @@ -272,6 +273,8 @@ local function add_multimap_rule(params) newrule['map'] = value elseif name == 'symbol' then newrule['symbol'] = value + elseif name == 'description' then + newrule['description'] = value else rspamd_logger.err('invalid rule option: '.. name) return nil @@ -295,7 +298,7 @@ local function add_multimap_rule(params) end else if newrule['type'] == 'ip' then - newrule['ips'] = rspamd_config:add_radix_map (newrule['map']) + newrule['ips'] = rspamd_config:add_radix_map (newrule['map'], newrule['description']) if newrule['ips'] then table.insert(rules, newrule) return newrule @@ -303,7 +306,7 @@ local function add_multimap_rule(params) rspamd_logger.warn('Cannot add rule: map doesn\'t exists: ' .. newrule['map']) end elseif newrule['type'] == 'header' or newrule['type'] == 'rcpt' or newrule['type'] == 'from' then - newrule['hash'] = rspamd_config:add_hash_map (newrule['map']) + newrule['hash'] = rspamd_config:add_hash_map (newrule['map'], newrule['description']) if newrule['hash'] then table.insert(rules, newrule) return newrule diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index e3def6fd9..4d72ff806 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -76,7 +76,7 @@ if opts then if type(rspamd_config.get_api_version) ~= 'nil' then rspamd_config:register_virtual_symbol(sym, 1) end - local rmap = rspamd_config:add_hash_map (map) + local rmap = rspamd_config:add_hash_map (map, 'Phishing strict domains map') if rmap then local rule = {symbol = sym, map = rmap} table.insert(strict_domains, rule) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 39bac5534..787f9fc94 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -305,7 +305,7 @@ if opts then end if opts['whitelisted_ip'] then - whitelisted_ip = rspamd_config:add_hash_map (opts['whitelisted_ip']) + whitelisted_ip = rspamd_config:add_hash_map (opts['whitelisted_ip'], 'Ratelimit whitelist ip map') end if opts['max_rcpt'] then @@ -323,4 +323,5 @@ if opts then rspamd_config:register_post_filter(rate_set) end end -end \ No newline at end of file +end + -- 2.39.5