comparison dnsbl.spec.in @ 43:acbe44bbba22

seems to drop root privs ok now
author carl
date Mon, 05 Jul 2004 22:24:22 -0700
parents d95af8129dfa
children 9f2971c692d0
comparison
equal deleted inserted replaced
42:afcf403709ef 43:acbe44bbba22
1 Summary: DNSBL Sendmail Milter 1 Summary: DNSBL Sendmail Milter
2 Name: dnsbl 2 Name: dnsbl
3 Version: 3.1 3 Version: 3.1
4 Release: 1 4 Release: 2
5 Copyright: GPL 5 Copyright: GPL
6 Group: System Environment/Daemons 6 Group: System Environment/Daemons
7 Source: http://www.five-ten-sg.com/util/dnsbl.tar.gz 7 Source: http://www.five-ten-sg.com/util/dnsbl.tar.gz
8 Patch0: dnsbl.rc.patch
8 BuildRoot: %{_tmppath}/%{name}-%{version} 9 BuildRoot: %{_tmppath}/%{name}-%{version}
9 10
10 BuildRequires: sendmail-devel >= 8.12.1
11 Requires(pre): /usr/sbin/groupadd 11 Requires(pre): /usr/sbin/groupadd
12 Requires(pre): /usr/sbin/useradd 12 Requires(pre): /usr/sbin/useradd
13 Requires(pre): /usr/bin/getent 13 Requires(pre): /usr/bin/getent
14 Requires(postun): /usr/sbin/userdel 14 Requires(postun): /usr/sbin/userdel
15 Requires(postun): /usr/sbin/groupdel 15 Requires(postun): /usr/sbin/groupdel
16 Requires(post,preun): /sbin/chkconfig 16 Requires(post,preun): /sbin/chkconfig
17 Requires: sendmail 17 BuildRequires: sendmail-devel >= 8.12.1
18 Requires: sendmail >= 8.12.1
19 Requires: sendmail-cf
18 20
19 21
20 %description 22 %description
21 We present here a mechanism whereby the backup mail server can use the correct set of DNSBLs for each recipient for each message. As a side-effect, it gives us the ability to customize the set of DNSBLs on a per-recipient basis, so that fred@example.com could use SPEWS and the SBL, where all other users @example.com use only the SBL. 23 We present here a mechanism whereby the backup mail server can use the correct set of DNSBLs for each recipient for each message. As a side-effect, it gives us the ability to customize the set of DNSBLs on a per-recipient basis, so that fred@example.com could use SPEWS and the SBL, where all other users @example.com use only the SBL.
22 24
23 This milter will also decode (base64, mime, html entity, url encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the body of the mail. If any of those host names have A or NS records on the SBL (or a single configurable DNSBL), the mail will be rejected unless previously whitelisted. This milter also counts the number of invalid HTML tags, and can reject mail if that count exceeds your specified limit. 25 This milter will also decode (base64, mime, html entity, url encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the body of the mail. If any of those host names have A or NS records on the SBL (or a single configurable DNSBL), the mail will be rejected unless previously whitelisted. This milter also counts the number of invalid HTML tags, and can reject mail if that count exceeds your specified limit.
24 26
25 The DNSBL milter reads a text configuration file (dnsbl.conf) on startup, and whenever the config file (or any of the referenced include files) is changed. The entire configuration file is case insensitive. 27 The DNSBL milter reads a text configuration file (dnsbl.conf) on startup, and whenever the config file (or any of the referenced include files) is changed. The entire configuration file is case insensitive.
26 28
27 %prep 29 %prep
28 # %setup -q -n Zope-%{zope_version}
29 # %patch0 -p1
30 # %patch1 -p1
31 30
32 %setup 31 %setup
33 32 %patch0 -p1
34 33
35 %build 34 %build
36 pwd 35 pwd
37 g++ -c $CXXFLAGS -pthread dnsbl.cpp 36 g++ -c $CXXFLAGS -pthread dnsbl.cpp
38 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread 37 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
39 38
40 %install 39 %install
41 # hoisted from install.bash
42 #DST=/var/dnsbl
43 DST=%{buildroot} 40 DST=%{buildroot}
44 if [ "%{buildroot}" = "/" -o -z "%{buildroot}" ] ; then 41 if [ "%{buildroot}" = "/" -o -z "%{buildroot}" ] ; then
45 echo sorry, you probably do not want me to delete the old buildroot at %{buildroot} 42 echo sorry, you probably do not want me to delete the old buildroot at %{buildroot}
46 exit 1 43 exit 1
47 fi 44 fi
62 mkdir -p %{buildroot}/var/run/dnsbl 59 mkdir -p %{buildroot}/var/run/dnsbl
63 60
64 %pre 61 %pre
65 /usr/bin/getent passwd dnsbl || 62 /usr/bin/getent passwd dnsbl ||
66 useradd -r -d /etc/dnsbl -M -c "dnsbl pseudo-user" -s /sbin/nologin dnsbl 63 useradd -r -d /etc/dnsbl -M -c "dnsbl pseudo-user" -s /sbin/nologin dnsbl
64
65 #[JOG] Attempt to migrate an existing, non-rpm install.
66 # WARNING! This may cause blindness, loss of appetite, and a general
67 # feeling of ill will towards the author of this script. Please refer
68 # to the Licence file for warranty information...
69 if [ -f "/var/dnsbl/dnsbl.conf" -a ! -f "/etc/dnsbl/dnsbl.conf" ] ; then
70 echo Existing installation found at /var/dnsbl/ Migrating configuation...
71 # create the conf directory so rpm can find it in a minute...
72 mkdir /etc/dnsbl/
73 # and try to copy all of the relavent config files that are below this directory
74 cd /var/dnsbl/
75 grep '^include ' /var/dnsbl/dnsbl.conf | cut -d ' ' -f 2 | grep -v '^/' | xargs cp --target-directory=/etc/dnsbl/ /var/dnsbl/dnsbl.conf
76 fi
77
78
67 %post 79 %post
68 /sbin/chkconfig --add dnsbl 80 /sbin/chkconfig --add dnsbl
69 /sbin/chkconfig dnsbl on 81 /sbin/chkconfig dnsbl on
70 /sbin/service dnsbl start 82 /sbin/service dnsbl start
71 83
72 # [JOG] TODO: spew out a message indicating what should be added to sendmail.mc 84 echo Remember to edit /etc/dnsbl.conf and add the following line to your sendmail.mc:
85 echo "INPUT_MAIL_FILTER(\`dnsbl\', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:2m;R:2m;E:5m\')"
86 echo
87
73 88
74 %preun 89 %preun
75 if [ $1 -eq 0 ]; then 90 if [ $1 -eq 0 ]; then
76 /sbin/service dnsbl stop || : 91 /sbin/service dnsbl stop || :
77 /sbin/chkconfig --del dnsbl 92 /sbin/chkconfig --del dnsbl
88 /etc/init.d/dnsbl 103 /etc/init.d/dnsbl
89 /usr/sbin/dnsbl 104 /usr/sbin/dnsbl
90 %dir %attr(0750,dnsbl,root) /var/run/dnsbl 105 %dir %attr(0750,dnsbl,root) /var/run/dnsbl
91 106
92 %changelog 107 %changelog
93 Revision 1.1 2004/06/30 10:08:48 jgunkel@palliser.ca 108 * Mon Jul 05 2004 John Gunkel <jgunkel@palliser.ca> 1.2
94 Initial revision of spec file. Need to add a better description, docs and a sendmail.mc message 109 - Fixed some typos
110 - removed patch into separate file
111 - added config migration as suggested by Carl
112 - Added reminder to edit sendmail.mc
95 113
114 * Wed Jun 30 2004 John Gunkel <jgunkel@palliser.ca> 1.1
115 - Initial revision of spec file. Need to add a better description, docs and a sendmail.mc message
116