* updated knights (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / mail / qmail-scanner / no_magic.diff
blobe0fdfe4457168277c3adc3b0173ed9c0e50ad010
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../qmail-scanner/no_magic.diff
5 # Copyright (C) 2005 - 2006 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- ./configure.orig 2005-12-10 01:53:05.000000000 -0300
18 +++ ./configure 2005-12-10 02:25:30.000000000 -0300
19 @@ -785,17 +785,6 @@
20 if test -x $dir/reformime
21 then
22 UNMIME_BINARY="${UNMIME_BINARY:-$dir/reformime}"
23 - DD=`reformime -s1.2 -xTEST- < ./contrib/reformime-test.eml`
24 - if [ "`grep hello TEST-hello.txt`" = "" ]; then
25 - echo "** FATAL ERROR ***"
26 - echo ""
27 - echo "$UNMIME_BINARY contains bugs. Please upgrade to a release"
28 - echo "that post-dates Mar 22 2002 (e.g. 1.3.8)"
29 - echo ""
30 - rm -f TEST-hello.txt
31 - exit 1
32 - fi
33 - rm -f TEST-hello.txt
34 fi
35 if test -x $dir/maildrop
36 then
37 @@ -806,34 +795,12 @@
38 if test -x $dir/tnef
39 then
40 TNEF_BINARY="${TNEF_BINARY:-$dir/tnef}"
41 - #There's a LOCALE bug in uudecode - workaround...
42 - if [ "`$TNEF_BINARY --help 2>&1|grep number-backups`" = "" ]; then
43 - TNEF_BINARY=""
44 - cat<<EOF
46 -Old tnef binary found on your system!
48 -Please upgrade ASAP to a version supporting the "--number-backups" option.
50 -EOF
51 - exit 1
52 - fi
55 if [ "$MIME_UNPACKER" = "ripmime" ]; then
56 if test -x $dir/ripmime
57 then
58 UNMIME_BINARY="${UNMIME_BINARY:-$dir/ripmime}"
59 - DD=`ripmime -i - < ./contrib/reformime-test.eml`
60 - if [ "`grep hello hello.txt`" = "" ]; then
61 - echo "** FATAL ERROR ***"
62 - echo ""
63 - echo "$UNMIME_BINARY contains bugs. Please upgrade to a newer release."
64 - echo ""
65 - rm -f hello.txt textfile*
66 - exit 1
67 - fi
68 - rm -f hello.txt textfile*
71 if test -x $dir/unzip
72 @@ -841,43 +808,23 @@
73 UNZIP_BINARY="${UNZIP_BINARY:-$dir/unzip}"
74 #Now check for password support
75 UNZIP_PASSWD="xx${RANDOM}$$xx"
76 - DD=`unzip -Ptest -t contrib/test_password.zip 2>&1|egrep 'testing:.*OK'`
77 - if [ "$DD" != "" ]; then
78 UNZIP_OPTIONS="-P$UNZIP_PASSWD"
79 - else
80 - UNZIP_OPTIONS=""
81 - fi
82 - #Now check we can get filesizes out
83 - EE=`unzip -Ptest -lv contrib/test_password.zip 2>&1|egrep '80688.*test/ls'`
84 - if [ "$EE" = "" ]; then
85 - echo "**FATAL ERROR ***"
86 - echo ""
87 - echo "$UNZIP_BINARY doesn't support the \"-lv\" option to view file details"
88 - echo ""
89 - echo "Please upgrade to another version of unzip"
90 - echo ""
91 - exit 1
92 - fi
93 fi
95 if test -x $dir/uvscan
96 then
97 if [ "`echo $FIND_SCANNERS|grep ' uvscan '`" != "" -a "$UVSCAN" = "" ]; then
98 - if [ "`$dir/uvscan -r --secure --fam --unzip --macro-heuristics -v $TMP_DIR 2>&1|egrep -i 'virus|test'`" != "" ]; then
99 UVSCAN="${UVSCAN:-$dir/uvscan}"
100 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
101 uvscan"
102 - fi
105 if test -x $dir/csav
106 then
107 if [ "`echo $FIND_SCANNERS|grep ' csav '`" != "" -a "$CSAV" = "" ]; then
108 - if [ "`$dir/csav -list -nomem -packed -archive -noboot $TMP_DIR 2>&1|egrep -i 'virus|test'`" != "" ]; then
109 CSAV="${CSAV:-$dir/csav}"
110 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
111 csav"
112 - fi
115 if [ "`echo $FIND_SCANNERS|grep ' sophie '`" != "" -a "$SOPHIE" = "" ]; then
116 @@ -1097,28 +1044,17 @@
117 if [ "`echo $FIND_SCANNERS|grep ' clamdscan '`" != "" -a "$CLAMDSCAN" = "" ]; then
118 if test -x $dir/clamdscan
119 then
120 - DD="`$dir/clamdscan -v $TMP_DIR 2>&1`|egrep -i 'virus|test'"
121 - if [ "$DD" != "" ]; then
122 CLAMDSCAN="${CLAMDSCAN:-$dir/clamdscan}"
123 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
124 clamdscan"
125 - else
126 - echo "
127 -Something like clamdscan for ClamAV detected - but not correctly installed.
128 -Please read Q-S FAQ if you want it - especially check that clamd daemon
129 -can read files owned by $QS_USER (i.e. make it run as $QS_USER).
131 - fi
134 if test -x $dir/clamscan
135 then
136 if [ "`echo $FIND_SCANNERS|grep ' clamscan '`" != "" -a "$CLAMSCAN" = "" ]; then
137 - if [ "`$dir/clamscan -v $TMP_DIR 2>&1|egrep -i 'virus|test'`" != "" ]; then
138 CLAMSCAN="${CLAMSCAN:-$dir/clamscan}"
139 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
140 clamscan"
141 - fi
144 if [ "`echo $FIND_SCANNERS|grep spamassassin`" != "" -a "$SPAMASSASSIN_BINARY" = "" ]; then
145 @@ -1129,126 +1065,21 @@
147 if [ "$SPAMASSASSIN_BINARY" != "" -a -x "$dir/spamc" -a "$SPAMC_BINARY" = "" ]
148 then
149 - #Test it out
150 - if [ "`$dir/spamc -h 2>&1|grep 'spamd'`" != "" ] ;then
151 SPAMC_BINARY="${SPAMC_BINARY:-$dir/spamc}"
153 - # st: is spamd running with sql per user settings?
154 - SA_SQL_AUT=`ps ax -w 2>/dev/null | egrep 'spamd.*( \-q | \-Q | \-\-sql|with\-sql)' |grep -v grep`
155 - if [ "$SA_SQL_AUT" = "" ]; then
156 - SA_SQL_AUT=`ps -ef 2>/dev/null | egrep 'spamd.*( \-q | \-Q | \-\-sql|with\-sql)' |grep -v grep`
157 - fi
158 - if [ "$SA_SQL_AUT" = "" ]; then
159 - SA_SQL_AUT=`ps aux 2>/dev/null | egrep 'spamd.*( \-q | \-Q | \-\-sql|with\-sql)' |grep -v grep`
160 - fi
162 # st: are we using spamd in unix-socket mode?
163 if [ "$SPAMD_SOCKET" != "" ] ;then
164 - if [ ! -S "$SPAMD_SOCKET" ] ;then
165 - cat<<EOF
167 - Spamd socket not found in $SPAMD_SOCKET
169 - Are you really using spamd daemon with the '--socketpath' option?
170 - Check it or allow the configure script to look for
171 - it, just omiting the configure option --sa-socket ...
173 -EOF
174 - exit
175 - fi
176 #SPAMC_BINARY="$SPAMC_BINARY -U $SPAMD_SOCKET"
177 SA_SKT=" -U $SPAMD_SOCKET"
178 - else
180 - #Test to see if spamc is calling Unix sockets instead of TCP
181 - SPAMD_SOCKET=`ps -ef 2>/dev/null|egrep 'spamd.*socketpath'|grep -v grep|sed -e 's/^.*socketpath=//'|awk '{print $1}'`
182 - if [ "$SPAMD_SOCKET" = "" ]; then
183 - SPAMD_SOCKET=`ps aux 2>/dev/null|egrep 'spamd.*socketpath'|grep -v grep|sed -e 's/^.*socketpath=//'|awk '{print $1}'`
184 - fi
186 - # st: in my RH7.3 servers this works...
187 - if [ "$SPAMD_SOCKET" = "" ]; then
188 - SPAMD_SOCKET=`ps ax -w 2>/dev/null|egrep 'spamd.*socketpath'|grep -v grep|sed -e 's/^.*socketpath=//'|awk '{print $1}'`
189 - fi
191 - if [ "$SPAMD_SOCKET" != "" ]; then
192 - if [ -S "$SPAMD_SOCKET" ]; then
193 - #SPAMC_BINARY="$SPAMC_BINARY -U $SPAMD_SOCKET"
194 - SA_SKT=" -U $SPAMD_SOCKET"
195 - else
196 - cat<<EOF
198 - Oops... Spamd socket not found in $SPAMD_SOCKET
200 - It seems that you're running spamd in unix-socket mode, but the
201 - configure script couldn't find the socket properly.
202 - Try to set it manually using the configure option --sa-socket ...
204 -EOF
205 - exit
206 - fi
207 - fi
211 - DD="`$SPAMC_BINARY $SA_SKT < ./contrib/spamc-nice.eml`"
212 - if [ "`echo $DD|grep '^From '`" != "" ]; then
213 - cat<<EOF
215 -SpamAssassin's spamd daemon is incorrectly installed. You need to run it as:
217 -spamd -F 0 ....
219 -Please try again.
221 -EOF
222 - exit
223 - fi
224 - DD="`$SPAMC_BINARY $SA_HN $SA_SKT < ./contrib/spamc-nice.eml`"
225 - if [ "$?" != "0" -o "`echo $DD|grep 'X-Spam-Status: No'`" = "" ]; then
226 - echo "
227 -Something like spamc for SpamAssassin detected - but not correctly installed
228 -(didn't include a \"X-Spam-Status\" line in output).
229 -Please read Q-S FAQ if you want it - especially check that spamd daemon
230 -is running. Ignoring...
232 - SPAMC_BINARY=''
233 - else
234 - DD="`$SPAMC_BINARY $SA_HN $SA_SKT < ./contrib/spamc-nasty.eml`"
235 - if [ "$?" != "0" -o "`echo $DD|grep 'X-Spam-Status: Yes'`" = "" ]; then
236 - echo "
237 -Something like spamc for SpamAssassin detected - but not correctly installed
238 -(didn't include a \"X-Spam-Status: Yes\" line in output) - ignoring...
240 - SPAMC_BINARY=''
241 - else
242 - DD="`$SPAMC_BINARY $SA_HN $SA_SKT -c < ./contrib/spamc-nasty.eml`"
243 - if [ "`echo $DD|tail -n 1|grep /`" != "" ]; then
244 - SPAMASSASSIN_VERSION="fast_spamassassin"
245 - SA_THRESHOLD=`echo $DD|tail -n 1|sed -e 's/\(.*\)\/\(.*\)/\2/'`
246 - fi
247 - fi
248 - fi
249 - if [ "$SPAMC_BINARY" != "" ]; then
250 if [ "`echo $FIND_SCANNERS|grep ' fast_spamassassin'`" != "" ]; then
251 - if [ "$SPAMASSASSIN_VERSION" != "fast_spamassassin" ]; then
252 - cat<<EOF
253 -Fatal: You have asked for the "fast" v2.1 SpamAssassin support, however
254 -your system is NOT correctly configured for it.
256 -Either upgrade and try again, or reconfigure for the older "verbose"
257 -SpamAssassin support.
259 -EOF
260 - exit
261 - fi
262 + SPAMASSASSIN_VERSION="fast_spamassassin"
263 #SPAMC_OPTIONS="$SA_HN -c "
264 SA_FAST="1"
265 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
266 fast_spamassassin"
267 - #See if they want fast_spamassassin to alter the
268 - #Subject: line too...
269 - SPAMC_SUBJECT="`echo $FIND_SCANNERS|grep ' fast_spamassassin='|sed -e 's/^.*fast_spamassassin=//g' -e 's/ .*$//g'`"
270 if [ "$SPAMC_SUBJECT" = "" ]; then SPAMC_SUBJECT=$SA_SUBJECT ; fi
271 else
272 SPAMASSASSIN_VERSION="verbose_spamassassin"
273 @@ -1259,10 +1090,6 @@
274 INSTALLED_SCANNERS="$INSTALLED_SCANNERS
275 verbose_spamassassin"
277 - else
278 - SPAMC_BINARY=''
279 - fi
280 - fi
283 if test -x $dir/find