Mercurial > dnsbl
annotate dnsbl.spec.in @ 100:63e8633abc34 stable-5-8
allow empty env_to at global context to remove all restrictions on child contexts
author | carl |
---|---|
date | Sun, 25 Sep 2005 08:38:29 -0700 |
parents | f8963ddf7143 |
children | 6ac7ba4a8312 |
rev | line source |
---|---|
94 | 1 Summary: DNSBL Sendmail Milter |
2 Name: dnsbl | |
100
63e8633abc34
allow empty env_to at global context to remove all restrictions on child contexts
carl
parents:
99
diff
changeset
|
3 Version: 5.8 |
94 | 4 Release: 2 |
5 Copyright: GPL | |
6 Group: System Environment/Daemons | |
7 Source: http://www.five-ten-sg.com/util/dnsbl.tar.gz | |
8 BuildRoot: %{_tmppath}/%{name}-%{version} | |
9 | |
10 Requires(pre): /usr/sbin/groupadd | |
11 Requires(pre): /usr/sbin/useradd | |
12 Requires(pre): /usr/bin/getent | |
13 Requires(postun): /usr/sbin/userdel | |
14 Requires(postun): /usr/sbin/groupdel | |
15 Requires(post,preun): /sbin/chkconfig | |
16 BuildRequires: sendmail-devel >= 8.12.1 | |
17 Requires: sendmail >= 8.12.1 | |
18 Requires: sendmail-cf | |
19 | |
20 | |
21 %description | |
22 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 | |
24 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 | |
26 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 | |
28 %prep | |
29 | |
30 %setup | |
31 | |
32 %build | |
33 pwd | |
34 g++ -c $CXXFLAGS -pthread dnsbl.cpp | |
35 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread | |
36 | |
37 %install | |
38 DST=%{buildroot} | |
39 if [ "%{buildroot}" = "/" -o -z "%{buildroot}" ] ; then | |
40 echo sorry, you probably do not want me to delete the old buildroot at %{buildroot} | |
41 exit 1 | |
42 fi | |
43 | |
44 rm -rf %{buildroot} | |
45 mkdir -p %{buildroot}/etc/dnsbl | |
46 | |
47 install -m 644 dnsbl.conf %{buildroot}/etc/dnsbl/dnsbl.conf | |
48 install -m 644 hosts-ignore.conf %{buildroot}/etc/dnsbl/hosts-ignore.conf | |
49 install -m 644 html-tags.conf %{buildroot}/etc/dnsbl/html-tags.conf | |
50 install -m 644 tld.conf %{buildroot}/etc/dnsbl/tld.conf | |
51 install -m 644 sample.conf %{buildroot}/etc/dnsbl/sample.conf | |
52 | |
53 mkdir -p %{buildroot}/usr/sbin | |
54 install -m 755 dnsbl %{buildroot}/usr/sbin/dnsbl | |
55 | |
56 mkdir -p %{buildroot}/etc/rc.d/init.d | |
57 install -m 755 dnsbl.rc %{buildroot}/etc/rc.d/init.d/dnsbl | |
58 | |
59 mkdir -p %{buildroot}/var/run/dnsbl | |
60 | |
61 %pre | |
62 /usr/bin/getent passwd 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 | |
79 %post | |
80 /sbin/chkconfig --add dnsbl | |
81 /sbin/chkconfig dnsbl on | |
82 /sbin/service dnsbl start | |
83 | |
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:5m;R:5m;E:5m\')" | |
86 echo | |
87 | |
88 | |
89 %preun | |
90 if [ $1 -eq 0 ]; then | |
91 /sbin/service dnsbl stop || : | |
92 /sbin/chkconfig --del dnsbl | |
93 userdel dnsbl || : | |
94 fi | |
95 | |
96 %postun | |
97 | |
98 %clean | |
99 | |
100 %files | |
101 %defattr(-,root,root) | |
102 %config(noreplace) /etc/dnsbl/ | |
103 %doc RELEASE_NOTES LICENSE sample.conf test.cpp | |
104 /etc/rc.d/init.d/dnsbl | |
105 /usr/sbin/dnsbl | |
106 %dir %attr(0750,dnsbl,root) /var/run/dnsbl | |
107 | |
108 %changelog | |
109 * Tue Jan 03 2005 Carl Byington 1.4 | |
110 - added hosts-ignore conf file | |
111 - see RELEASE_NOTES | |
112 | |
113 * Thu Jul 15 2004 John Gunkel <antispam@boing.ca> 1.3 | |
114 - patch to rc file no longer needed | |
115 - see RELEASE_NOTES | |
116 | |
117 * Mon Jul 05 2004 John Gunkel <jgunkel@palliser.ca> 1.2 | |
118 - Fixed some typos | |
119 - removed patch into separate file | |
120 - added config migration as suggested by Carl | |
121 - Added reminder to edit sendmail.mc | |
122 | |
123 * Wed Jun 30 2004 John Gunkel <jgunkel@palliser.ca> 1.1 | |
124 - Initial revision of spec file. Need to add a better description, docs and a sendmail.mc message | |
125 |