Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debianization fix #135

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b5f1115
Debianization fix
vitalyisaev2 Jul 26, 2016
5a672ff
[Feature] Optimize sending data to rspamd
vstakhov Jul 26, 2016
9150654
[Fix] Fix sdsnewlen usage
vstakhov Jul 26, 2016
ac95ecb
[Fix] Fix usage of magic constants
vstakhov Jul 26, 2016
89bcbbd
[Fix] Fix detection of sendfile on FreeBSD
vstakhov Jul 26, 2016
f6b1f16
[Fix] Avoid using of LTS as it seems to be broken on FreeBSD
vstakhov Jul 26, 2016
c1cadb5
[Fix] Fix probability setup
vstakhov Jul 27, 2016
8df46a1
[Feature] Allow to disable greylisting and ratelimit globally
vstakhov Jul 27, 2016
7819082
Partial rework of configuration file
moisseev Jul 28, 2016
22987be
[Rework] Remove systemd socket activation
fatalbanana Jul 28, 2016
590bc1b
Gather global options into one place
moisseev Jul 29, 2016
6ab5dba
Indent defaults
moisseev Jul 29, 2016
8e22f0d
Merge pull request #141 from moisseev/config
vstakhov Jul 29, 2016
7c8d3a7
Merge pull request #142 from fatalbanana/no-more-socket-activation
vstakhov Jul 29, 2016
45480bf
[Minor] Update version to 1.9.1
vstakhov Jul 29, 2016
7ab2134
Release 1.9.1
vstakhov Aug 1, 2016
d2c81ed
[Minor] Update version to 1.9.2
vstakhov Aug 1, 2016
2b86b22
[Fix] Treat connections from unix socket as local connections
vstakhov Aug 2, 2016
83275e0
[Fix] Unbroke 'spamd_greylist = no' config option
citrin Aug 10, 2016
623e6e1
[Fix] Fix adding headers from rspamd
fatalbanana Aug 11, 2016
e4ca3b7
Merge pull request #149 from fatalbanana/headers
vstakhov Aug 11, 2016
4924891
[Rework] Process all flag config file options in same way
citrin Aug 12, 2016
e8608d8
Merge pull request #150 from citrin/master
vstakhov Aug 12, 2016
8ae9fd3
[Fix] Do not fold dkim signature received from Rspamd
vstakhov Aug 15, 2016
356bc36
[Feature] Allow adding/overriding options for rmilter
vstakhov Aug 22, 2016
058bcad
[Rework] Remove old and deprecated rules
vstakhov Aug 22, 2016
a8b0395
[Minor] Remove some more garbadge
vstakhov Aug 22, 2016
66e7acd
[Rework] Use lc-btrie code for radix trie
vstakhov Aug 22, 2016
ad1bf1f
[Fix] Fix adding of IP addresses to the lists
vstakhov Aug 22, 2016
43758e6
[Fix] Allow empty sections in the config
vstakhov Aug 22, 2016
5bad2eb
[Feature] Allow to disable dkim signing completely
vstakhov Aug 22, 2016
e0b202d
[Minor] Update configuration file
moisseev Aug 23, 2016
8e434bb
Merge pull request #151 from moisseev/config
vstakhov Aug 23, 2016
55b98b5
[Minor] Read /etc/default/rmilter in Debian init script
fatalbanana Aug 23, 2016
23910f3
Merge pull request #153 from fatalbanana/debinit
vstakhov Aug 23, 2016
c310c74
Release 1.9.2
vstakhov Aug 23, 2016
ddf425f
[Minor] Update to 1.9.3
vstakhov Aug 23, 2016
7dc37e1
[Minor] Update version to 1.10.0
vstakhov Sep 9, 2016
5c07654
[Minor] Fix support of gcc 4.2
vstakhov Sep 9, 2016
567e775
[Feature] Add ZSTD compression support
vstakhov Sep 9, 2016
98ca604
[Fix] Do not assert on empty radix trie
vstakhov Sep 9, 2016
1c79dd9
[Feature] Add compression option for spamd section
vstakhov Sep 9, 2016
701cfd2
[Feature] Implement protocol compression for Rspamd
vstakhov Sep 9, 2016
d323812
[Minor] Add content type for rspamd requests
vstakhov Sep 10, 2016
4fcba99
[Fix] Fix compression for Rspamd
vstakhov Sep 12, 2016
e4f9f2b
[Fix] Fix decompressed scans
vstakhov Sep 12, 2016
6d9a1f8
Debianization fix
vitalyisaev2 Jul 26, 2016
a885c9d
Merge branch 'master' of github.com:vitalyisaev2/rmilter
Sep 19, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PROJECT(rmilter C)

SET(RMILTER_VERSION_MAJOR 1)
SET(RMILTER_VERSION_MINOR 9)
SET(RMILTER_VERSION_MINOR 10)
SET(RMILTER_VERSION_PATCH 0)

IF(GIT_ID)
Expand Down Expand Up @@ -39,7 +39,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
OPTION(ENABLE_DEBUG "Enable debug output [default: OFF]" OFF)
OPTION(ENABLE_OPTIMIZATION "Enable optimization [default: OFF]" OFF)
OPTION(ENABLE_DKIM "Enable dkim signatures [default: ON]" ON)
OPTION(ENABLE_MEMCACHED "Enable memcached storage [default: ON]" ON)
OPTION(ENABLE_MEMCACHED "Enable memcached storage [default: OFF]" OFF)
OPTION(WANT_SYSTEMD_UNITS "Install systemd unit files on Linux [default: OFF]" OFF)

############################# INCLUDE SECTION #############################################
Expand Down Expand Up @@ -330,7 +330,6 @@ CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
CHECK_INCLUDE_FILES(sys/endian.h HAVE_SYS_ENDIAN_H)
CHECK_INCLUDE_FILES(machine/endian.h HAVE_MACHINE_ENDIAN_H)
CHECK_INCLUDE_FILES(sys/queue.h HAVE_SYS_QUEUE_H)
CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES(sys/mman.h HAVE_SYS_MMAN_H)
CHECK_INCLUDE_FILES(sys/un.h HAVE_SYS_UN_H)
Expand All @@ -353,7 +352,7 @@ IF(HAVE_SYS_SENDFILE_H)
CHECK_SYMBOL_EXISTS(sendfile sys/sendfile.h HAVE_SENDFILE)
ELSE()
# BSD version
CHECK_SYMBOL_EXISTS(sendfile sys/types.h;sys/socket.h;sys/uio.h HAVE_SENDFILE)
CHECK_SYMBOL_EXISTS(sendfile "sys/types.h;sys/socket.h;sys/uio.h" HAVE_SENDFILE)
ENDIF()
CHECK_SYMBOL_EXISTS(mkstemp unistd.h HAVE_MKSTEMP)
CHECK_SYMBOL_EXISTS(PATH_MAX limits.h HAVE_PATH_MAX)
Expand All @@ -364,10 +363,10 @@ CHECK_SYMBOL_EXISTS(MAP_NOCORE sys/mman.h HAVE_MMAP_NOCORE)

ProcessPackage(OPENSSL LIBRARY crypto INCLUDE err.h INCLUDE_SUFFIXES include/openssl
ROOT ${OPENSSL_ROOT_DIR} MODULES openssl)
ProcessPackage(PCRE LIBRARY pcre INCLUDE pcre.h INCLUDE_SUFFIXES include/pcre
ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
ProcessPackage(LIBMILTER LIBRARY milter INCLUDE mfapi.h INCLUDE_SUFFIXES include/libmilter
LIB_SUFFIXES lib/libmilter ROOT ${LIBMILTER_ROOT_DIR} MODULES libmilter)
ProcessPackage(PCRE LIBRARY pcre INCLUDE pcre.h INCLUDE_SUFFIXES include/pcre
ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
ProcessPackage(GLIB2 LIBRARY glib-2.0 INCLUDE glib.h
INCLUDE_SUFFIXES include/glib
ROOT ${GLIB_ROOT_DIR} MODULES glib-2.0>=2.28)
Expand All @@ -391,16 +390,19 @@ ENDIF()
################################ SOURCES SECTION ###########################
ADD_SUBDIRECTORY(hiredis)
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/hiredis")
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/lc-btrie")
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/")
ADD_SUBDIRECTORY(contrib/libucl)
ADD_SUBDIRECTORY(contrib/http-parser)
ADD_SUBDIRECTORY(contrib/xxhash)
ADD_SUBDIRECTORY(contrib/lc-btrie)
ADD_SUBDIRECTORY(contrib/zstd)

SET(RMILTERSRC
compat/blake2b-ref.c
src/upstream.c
src/util.c
src/radix.c
src/regexp.c
src/cache.c
${CMAKE_BINARY_DIR}/cfg_lex.c
${CMAKE_BINARY_DIR}/cfg_yacc.c
Expand All @@ -423,6 +425,8 @@ TARGET_LINK_LIBRARIES(rmilter rmilter-hiredis)
TARGET_LINK_LIBRARIES(rmilter ucl)
TARGET_LINK_LIBRARIES(rmilter xxhash)
TARGET_LINK_LIBRARIES(rmilter rmilter-http-parser)
TARGET_LINK_LIBRARIES(rmilter lcbtrie)
TARGET_LINK_LIBRARIES(rmilter rmilter-zstd)

##################### INSTALLATION ##########################################

Expand All @@ -437,5 +441,4 @@ ADD_CUSTOM_TARGET(dist ${CMAKE_SOURCE_DIR}/dist.sh
# systemd unit
IF(WANT_SYSTEMD_UNITS MATCHES "ON")
INSTALL(FILES "rmilter.service" DESTINATION ${SYSTEMDDIR})
INSTALL(FILES "rmilter.socket" DESTINATION ${SYSTEMDDIR})
ENDIF()
23 changes: 23 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
1.9.2:
* [Feature] Allow adding/overriding options for rmilter
* [Feature] Allow to disable dkim signing completely
* [Fix] Allow empty sections in the config
* [Fix] Do not fold dkim signature received from Rspamd
* [Fix] Fix adding headers from rspamd
* [Fix] Fix adding of IP addresses to the lists
* [Fix] Treat connections from unix socket as local connections
* [Fix] Unbroke 'spamd_greylist = no' config option
* [Rework] Process all flag config file options in same way
* [Rework] Remove old and deprecated rules
* [Rework] Use lc-btrie code for radix trie

1.9.1:
* [Feature] Allow to disable greylisting and ratelimit globally
* [Feature] Optimize sending data to rspamd
* [Fix] Avoid using of LTS as it seems to be broken on FreeBSD
* [Fix] Fix detection of sendfile on FreeBSD
* [Fix] Fix probability setup
* [Fix] Fix sdsnewlen usage
* [Fix] Fix usage of magic constants
* [Rework] Remove systemd socket activation

1.9.0:
* [CritFix] Fix spam scan
* [Feature] Add .try_include macro
Expand Down
1 change: 1 addition & 0 deletions centos/80-rmilter.preset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable rmilter.service
3 changes: 1 addition & 2 deletions centos/rmilter.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

.include /etc/rmilter/rmilter.conf.common

# rmilter is socket-activated under systemd
bind_socket = fd:3;
bind_socket = unix:/var/run/rmilter/rmilter.sock;
27 changes: 0 additions & 27 deletions centos/rmilter.conf.common
Original file line number Diff line number Diff line change
Expand Up @@ -206,40 +206,13 @@ limits {
limit_to_ip_from = 100:0.033333333;
};

beanstalk {
# List of beanstalk servers, random selected
#servers = bot01.example.com:3132;

# Address of server to which rmilter should send all messages copies
#copy_server = somehost:13333;

# Address of server to which rmilter should send spam messages copies
#spam_server = otherhost:13333;

# Beanstalk protocol
protocol = tcp;
# Time to live for task in seconds
lifetime = 172800;
# Regexp that define for which messages we should put the whole message to beanstalk
# now only In-Reply-To headers are checked
id_regexp = "/^SomeID.*$/";
# Flags for sending beanstalk copies
send_beanstalk_headers = yes;
send_beanstalk_copy = yes;
send_beanstalk_spam = yes;
};

greylisting {
timeout = 300s;
expire = 3d;
whitelist = 127.0.0.1,
192.168.1.1,
192.168.2.0/24,
[::1]/128;
awl_enable = yes;
awl_pool = 10M;
awl_hits = 10;
awl_ttl = 3600s;
};

dkim {
Expand Down
42 changes: 21 additions & 21 deletions centos/rmilter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
%define rmilter_group adm
%define rmilter_home %{_localstatedir}/run/rmilter

%define has_systemd 1
%{?el6:%undefine has_systemd}
%{?!suse_version:%define not_suse 1}

Name: rmilter
Version: 1.7.0
Release: 1
Expand All @@ -17,14 +21,12 @@ License: BSD2c
%endif
URL: https://github.com/vstakhov/rmilter
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
%if 0%{?suse_version}
BuildRequires: bison,flex
%else
%if 0%{?not_suse}
BuildRequires: sendmail-milter
%endif
BuildRequires: sendmail-devel,openssl-devel,pcre-devel,glib2-devel
BuildRequires: cmake
%if 0%{?suse_version} || 0%{?el7} || 0%{?fedora}
BuildRequires: cmake,bison,flex,libopendkim-devel
%if 0%{?has_systemd}
BuildRequires: systemd
Requires(pre): systemd
Requires(post): systemd
Expand All @@ -50,6 +52,7 @@ Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz
Source1: %{name}.conf
Source2: %{name}.conf.common
Source3: %{name}.conf.sysvinit
Source5: 80-rmilter.preset

%description
The rmilter utility is designed to act as milter for sendmail and postfix MTA.
Expand All @@ -66,11 +69,11 @@ rm -rf %{buildroot} || true
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCONFDIR=%{_sysconfdir}/rmilter \
-DMANDIR=%{_mandir} \
%if 0%{?el6}
-DWANT_SYSTEMD_UNITS=OFF \
%else
%if 0%{?has_systemd}
-DWANT_SYSTEMD_UNITS=ON \
-DSYSTEMDDIR=%{_unitdir} \
%else
-DWANT_SYSTEMD_UNITS=OFF \
%endif
%if 0%{?suse_version}
-DCMAKE_SKIP_INSTALL_RPATH=ON \
Expand All @@ -91,6 +94,8 @@ rm -rf %{buildroot} || true
%if 0%{?el6}
%{__install} -p -D -m 0755 %{SOURCE4} %{buildroot}%{_initrddir}/%{name}
%{__install} -p -D -d -m 0755 %{buildroot}%{rmilter_home}
%else
%{__install} -p -D -m 0644 %{SOURCE5} %{buildroot}%{_presetdir}/80-rmilter.preset
%endif
%{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/rmilter.conf.d/

Expand All @@ -104,18 +109,17 @@ rm -rf %{buildroot}

%if 0%{?suse_version}
%service_add_pre %{name}.service
%service_add_pre %{name}.socket
%endif

%post
%{__chown} -R %{rmilter_user}:%{rmilter_group} %{rmilter_home}
%if 0%{?suse_version}
%service_add_post %{name}.service
%service_add_post %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
%systemd_post %{name}.service
%systemd_post %{name}.socket
%if 0%{?not_suse} && 0%{?has_systemd}
#Macro is not used as we want to do this on upgrade
#%systemd_post %{name}.service
systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
%endif
%if 0%{?el6}
/sbin/chkconfig --add %{name}
Expand All @@ -124,11 +128,9 @@ rm -rf %{buildroot}
%preun
%if 0%{?suse_version}
%service_del_preun %{name}.service
%service_del_preun %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
%if 0%{?not_suse} && 0%{?has_systemd}
%systemd_preun %{name}.service
%systemd_preun %{name}.socket
%endif
%if 0%{?el6}
if [ $1 = 0 ]; then
Expand All @@ -140,11 +142,9 @@ fi
%postun
%if 0%{?suse_version}
%service_del_postun %{name}.service
%service_del_postun %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
%if 0%{?not_suse} && 0%{?has_systemd}
%systemd_postun_with_restart %{name}.service
%systemd_postun %{name}.socket
%endif
%if 0%{?el6}
if [ $1 -ge 1 ]; then
Expand All @@ -155,9 +155,9 @@ fi

%files
%defattr(-,root,root,-)
%if 0%{?suse_version} || 0%{?fedora} || 0%{?el7}
%if 0%{?has_systemd}
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_presetdir}/80-rmilter.preset
%endif
%if 0%{?el6}
%{_initrddir}/%{name}
Expand Down
Loading