annotate dnsbl.spec.in @ 57:419e00901570

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