annotate dnsbl.spec.in @ 108:1c7677042b78

move to autoconf/automake/docbook
author carl
date Sun, 18 Dec 2005 12:05:05 -0800
parents d9c64bafbf60
children 96b2eb7f25f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
1 Summary: DNSBL Sendmail Milter
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
2 Name: dnsbl
102
d9c64bafbf60 fix compile error on fc3
carl
parents: 101
diff changeset
3 Version: 5.10
94
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
4 Release: 2
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
5 Copyright: GPL
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
6 Group: System Environment/Daemons
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
7 Source: http://www.five-ten-sg.com/util/dnsbl.tar.gz
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
8 BuildRoot: %{_tmppath}/%{name}-%{version}
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
9
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
10 Requires(pre): /usr/sbin/groupadd
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
11 Requires(pre): /usr/sbin/useradd
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
12 Requires(pre): /usr/bin/getent
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
13 Requires(postun): /usr/sbin/userdel
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
14 Requires(postun): /usr/sbin/groupdel
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
15 Requires(post,preun): /sbin/chkconfig
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
16 BuildRequires: sendmail-devel >= 8.12.1
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
17 Requires: sendmail >= 8.12.1
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
18 Requires: sendmail-cf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
19
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
20
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
21 %description
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
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.
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
23
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
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.
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
25
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
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.
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
27
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
28 %prep
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
29
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
30 %setup
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
31
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
32 %build
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
33 pwd
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
34 g++ -c $CXXFLAGS -pthread dnsbl.cpp
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
35 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
36
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
37 %install
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
38 DST=%{buildroot}
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
39 if [ "%{buildroot}" = "/" -o -z "%{buildroot}" ] ; then
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
40 echo sorry, you probably do not want me to delete the old buildroot at %{buildroot}
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
41 exit 1
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
42 fi
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
43
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
44 rm -rf %{buildroot}
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
45 mkdir -p %{buildroot}/etc/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
46
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
47 install -m 644 dnsbl.conf %{buildroot}/etc/dnsbl/dnsbl.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
48 install -m 644 hosts-ignore.conf %{buildroot}/etc/dnsbl/hosts-ignore.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
49 install -m 644 html-tags.conf %{buildroot}/etc/dnsbl/html-tags.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
50 install -m 644 tld.conf %{buildroot}/etc/dnsbl/tld.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
51 install -m 644 sample.conf %{buildroot}/etc/dnsbl/sample.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
52
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
53 mkdir -p %{buildroot}/usr/sbin
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
54 install -m 755 dnsbl %{buildroot}/usr/sbin/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
55
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
56 mkdir -p %{buildroot}/etc/rc.d/init.d
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
57 install -m 755 dnsbl.rc %{buildroot}/etc/rc.d/init.d/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
58
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
59 mkdir -p %{buildroot}/var/run/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
60
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
61 %pre
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
62 /usr/bin/getent passwd dnsbl ||
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
63 useradd -r -d /etc/dnsbl -M -c "dnsbl pseudo-user" -s /sbin/nologin dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
64
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
65 #[JOG] Attempt to migrate an existing, non-rpm install.
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
66 # WARNING! This may cause blindness, loss of appetite, and a general
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
67 # feeling of ill will towards the author of this script. Please refer
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
68 # to the Licence file for warranty information...
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
69 if [ -f "/var/dnsbl/dnsbl.conf" -a ! -f "/etc/dnsbl/dnsbl.conf" ] ; then
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
70 echo Existing installation found at /var/dnsbl/ Migrating configuation...
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
71 # create the conf directory so rpm can find it in a minute...
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
72 mkdir /etc/dnsbl/
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
73 # and try to copy all of the relavent config files that are below this directory
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
74 cd /var/dnsbl/
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
75 grep '^include ' /var/dnsbl/dnsbl.conf | cut -d ' ' -f 2 | grep -v '^/' | xargs cp --target-directory=/etc/dnsbl/ /var/dnsbl/dnsbl.conf
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
76 fi
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
77
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
78
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
79 %post
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
80 /sbin/chkconfig --add dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
81 /sbin/chkconfig dnsbl on
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
82 /sbin/service dnsbl start
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
83
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
84 echo Remember to edit /etc/dnsbl.conf and add the following line to your sendmail.mc:
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
85 echo "INPUT_MAIL_FILTER(\`dnsbl\', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m\')"
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
86 echo
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
87
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
88
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
89 %preun
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
90 if [ $1 -eq 0 ]; then
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
91 /sbin/service dnsbl stop || :
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
92 /sbin/chkconfig --del dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
93 userdel dnsbl || :
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
94 fi
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
95
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
96 %postun
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
97
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
98 %clean
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
99
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
100 %files
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
101 %defattr(-,root,root)
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
102 %config(noreplace) /etc/dnsbl/
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
103 %doc RELEASE_NOTES LICENSE sample.conf test.cpp
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
104 /etc/rc.d/init.d/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
105 /usr/sbin/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
106 %dir %attr(0750,dnsbl,root) /var/run/dnsbl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
107
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
108 %changelog
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
109 * Tue Jan 03 2005 Carl Byington 1.4
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
110 - added hosts-ignore conf file
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
111 - see RELEASE_NOTES
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
112
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
113 * Thu Jul 15 2004 John Gunkel <antispam@boing.ca> 1.3
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
114 - patch to rc file no longer needed
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
115 - see RELEASE_NOTES
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
116
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
117 * Mon Jul 05 2004 John Gunkel <jgunkel@palliser.ca> 1.2
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
118 - Fixed some typos
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
119 - removed patch into separate file
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
120 - added config migration as suggested by Carl
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
121 - Added reminder to edit sendmail.mc
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
122
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
123 * Wed Jun 30 2004 John Gunkel <jgunkel@palliser.ca> 1.1
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
124 - Initial revision of spec file. Need to add a better description, docs and a sendmail.mc message
e107ade3b1c0 fix dos line terminators
carl
parents: 92
diff changeset
125