View | Details | Raw Unified | Return to bug 2167
Collapse All | Expand All

(-)Mail-SpamAssassin-2.60-dist/Makefile.PL (-1 / +5 lines)
Lines 90-96 Link Here
90
    'VERSION_FROM' => 'lib/Mail/SpamAssassin.pm', # finds $VERSION
90
    'VERSION_FROM' => 'lib/Mail/SpamAssassin.pm', # finds $VERSION
91
91
92
    'EXE_FILES'	=> [
92
    'EXE_FILES'	=> [
93
			'spamassassin', 'sa-learn',
93
			'spamassassin', 'sa-learn', 'sa-btok-learn',
94
			@SPAMD_EXE_FILES
94
			@SPAMD_EXE_FILES
95
		],
95
		],
96
96
Lines 322-327 Link Here
322
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
322
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
323
	$(CHMOD) $(PERM_RWX) $@
323
	$(CHMOD) $(PERM_RWX) $@
324
324
325
sa-btok-learn: sa-btok-learn.raw
326
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
327
	$(CHMOD) $(PERM_RWX) $@
328
325
spamd/spamd: spamd/spamd.raw
329
spamd/spamd: spamd/spamd.raw
326
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
330
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
327
	$(CHMOD) $(PERM_RWX) $@
331
	$(CHMOD) $(PERM_RWX) $@
(-)Mail-SpamAssassin-2.60-dist/Makefile.old (+1060 lines)
Line 0 Link Here
1
# This Makefile is for the Mail::SpamAssassin extension to perl.
2
#
3
# It was generated automatically by MakeMaker version
4
# 5.45 (Revision: 1.222) from the contents of
5
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
6
#
7
#	ANY CHANGES MADE HERE WILL BE LOST!
8
#
9
#   MakeMaker ARGV: ()
10
#
11
#   MakeMaker Parameters:
12
13
#	ABSTRACT => q[identify spam mail using text analysis]
14
#	AUTHOR => q[Justin Mason <jm@jmason.org>]
15
#	EXE_FILES => [q[spamassassin], q[sa-learn], q[sa-btok-learn], q[spamd/spamc$(EXE_EXT)], q[spamd/spamd]]
16
#	MAN1PODS => { spamd/spamd=>q[$(INST_MAN1DIR)/spamd.$(MAN1EXT)], sa-learn=>q[$(INST_MAN1DIR)/sa-learn.$(MAN1EXT)], spamassassin=>q[$(INST_MAN1DIR)/spamassassin.$(MAN1EXT)], spamd/spamc.pod=>q[$(INST_MAN1DIR)/spamc.$(MAN1EXT)] }
17
#	NAME => q[Mail::SpamAssassin]
18
#	PL_FILES => {  }
19
#	PMLIBDIRS => [q[lib]]
20
#	PM_FILTER => q[$(PERL) build/preprocessor -Mconditional $(FIXBYTES) -Mvars -DVERSION="$(VERSION)" -DPREFIX="$(INST_PREFIX)"]
21
#	PREREQ_PM => { Text::Wrap=>q[0], Pod::Usage=>q[0], Errno=>q[0], HTML::Parser=>q[3], File::Spec=>q[0.8], ExtUtils::MakeMaker=>q[0], Time::Local=>q[0], File::Copy=>q[0] }
22
#	VERSION_FROM => q[lib/Mail/SpamAssassin.pm]
23
#	clean => { FILES=>q[pod2htm* spamassassin sa-learn spamd/spamc$(EXE_EXT) spamd/libspamc.so spamd/spamd doc spamd/libsslspamc.so binaries.mk config.h config.status config.cache config.log autom4te.cache qmail/qmail-spamct/do_razor2 t/log] }
24
#	dist => { DIST_DEFAULT=>q[tardist], COMPRESS=>q[gzip -9f], SUFFIX=>q[gz] }
25
#	macro => { RULES=>q[10_misc.cf 20_anti_ratware.cf 20_body_tests.cf 20_compensate.cf 20_dnsbl_tests.cf 20_fake_helo_tests.cf 20_head_tests.cf 20_html_tests.cf 20_meta_tests.cf 20_phrases.cf 20_porn.cf 20_ratware.cf 20_uri_tests.cf 23_bayes.cf 25_body_tests_es.cf 25_body_tests_pl.cf 25_head_tests_es.cf 25_head_tests_pl.cf 30_text_de.cf 30_text_es.cf 30_text_fr.cf 30_text_it.cf 30_text_pl.cf 30_text_sk.cf 50_scores.cf 60_whitelist.cf user_prefs.template triplets.txt languages] }
26
27
# --- MakeMaker post_initialize section:
28
29
30
# --- MakeMaker const_config section:
31
32
# These definitions are from config.sh (via /usr/lib/perl5/5.6.1/i386-linux/Config.pm)
33
34
# They may have been overridden via Makefile.PL or on the command line
35
AR = ar
36
CC = gcc
37
CCCDLFLAGS = -fPIC
38
CCDLFLAGS = -rdynamic
39
DLEXT = so
40
DLSRC = dl_dlopen.xs
41
LD = gcc
42
LDDLFLAGS = -shared -L/usr/local/lib
43
LDFLAGS =  -L/usr/local/lib
44
LIBC = /lib/libc-2.2.5.so
45
LIB_EXT = .a
46
OBJ_EXT = .o
47
OSNAME = linux
48
OSVERS = 2.4.17-0.13smp
49
RANLIB = :
50
SO = so
51
EXE_EXT = 
52
FULL_AR = /usr/bin/ar
53
54
55
# --- MakeMaker constants section:
56
AR_STATIC_ARGS = cr
57
NAME = Mail::SpamAssassin
58
DISTNAME = Mail-SpamAssassin
59
NAME_SYM = Mail_SpamAssassin
60
VERSION = 2.60
61
VERSION_SYM = 2_60
62
XS_VERSION = 2.60
63
INST_BIN = blib/bin
64
INST_EXE = blib/script
65
INST_LIB = blib/lib
66
INST_ARCHLIB = blib/arch
67
INST_SCRIPT = blib/script
68
PREFIX = /usr
69
SITEPREFIX = $(PREFIX)
70
VENDORPREFIX = $(PREFIX)
71
INSTALLDIRS = site
72
INSTALLPRIVLIB = $(PREFIX)/lib/perl5/5.6.1
73
INSTALLARCHLIB = $(PREFIX)/lib/perl5/5.6.1/i386-linux
74
INSTALLSITELIB = $(SITEPREFIX)/lib/perl5/site_perl/5.6.1
75
INSTALLSITEARCH = $(SITEPREFIX)/lib/perl5/site_perl/5.6.1/i386-linux
76
INSTALLVENDORLIB = $(VENDORPREFIX)/lib/perl5/vendor_perl/5.6.1
77
INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5/vendor_perl/5.6.1/i386-linux
78
INSTALLBIN = $(PREFIX)/bin
79
INSTALLSCRIPT = $(PREFIX)/bin
80
INSTALLSITEBIN = $(SITEPREFIX)/bin
81
PERL_LIB = /usr/lib/perl5/5.6.1
82
PERL_ARCHLIB = /usr/lib/perl5/5.6.1/i386-linux
83
SITELIBEXP = /usr/lib/perl5/site_perl/5.6.1
84
SITEARCHEXP = /usr/lib/perl5/site_perl/5.6.1/i386-linux
85
LIBPERL_A = libperl.a
86
FIRST_MAKEFILE = Makefile
87
MAKE_APERL_FILE = Makefile.aperl
88
PERLMAINCC = $(CC)
89
PERL_INC = /usr/lib/perl5/5.6.1/i386-linux/CORE
90
PERL = /usr/bin/perl
91
FULLPERL = /usr/bin/perl
92
FULL_AR = /usr/bin/ar
93
94
VERSION_MACRO = VERSION
95
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
96
XS_VERSION_MACRO = XS_VERSION
97
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
98
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
99
100
MAKEMAKER = /usr/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm
101
MM_VERSION = 5.45
102
103
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
104
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
105
# ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)  !!! Deprecated from MM 5.32  !!!
106
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
107
# DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
108
FULLEXT = Mail/SpamAssassin
109
BASEEXT = SpamAssassin
110
PARENT_NAME = Mail
111
DLBASE = $(BASEEXT)
112
VERSION_FROM = lib/Mail/SpamAssassin.pm
113
OBJECT = 
114
LDFROM = $(OBJECT)
115
LINKTYPE = dynamic
116
PM_FILTER = $(PERL) build/preprocessor -Mconditional $(FIXBYTES) -Mvars -DVERSION="$(VERSION)" -DPREFIX="$(INST_PREFIX)"
117
118
# Handy lists of source code files:
119
XS_FILES= 
120
C_FILES = 
121
O_FILES = 
122
H_FILES = acconfig.h
123
HTMLLIBPODS    = 
124
HTMLSCRIPTPODS = 
125
MAN1PODS = sa-learn \
126
	spamassassin \
127
	spamd/spamc.pod \
128
	spamd/spamd
129
MAN3PODS = lib/Mail/SpamAssassin.pm \
130
	lib/Mail/SpamAssassin/AutoWhitelist.pm \
131
	lib/Mail/SpamAssassin/Bayes.pm \
132
	lib/Mail/SpamAssassin/BayesTokenLog.pm \
133
	lib/Mail/SpamAssassin/Conf.pm \
134
	lib/Mail/SpamAssassin/ConfSourceSQL.pm \
135
	lib/Mail/SpamAssassin/PerMsgLearner.pm \
136
	lib/Mail/SpamAssassin/PerMsgStatus.pm \
137
	lib/Mail/SpamAssassin/PersistentAddrList.pm \
138
	lib/Mail/SpamAssassin/StateDirHash.pm
139
HTMLEXT = html
140
INST_MAN1DIR = blib/man1
141
INSTALLMAN1DIR = $(PREFIX)/share/man/man1
142
INSTALLSITEMAN1DIR = $(SITEPREFIX)/share/man/man1
143
INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1
144
MAN1EXT = 1
145
INST_MAN3DIR = blib/man3
146
INSTALLMAN3DIR = $(PREFIX)/share/man/man3
147
INSTALLSITEMAN3DIR = $(SITEPREFIX)/share/man/man3
148
INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3
149
MAN3EXT = 3pm
150
PERM_RW = 644
151
PERM_RWX = 755
152
153
# work around a famous dec-osf make(1) feature(?):
154
makemakerdflt: all
155
156
.SUFFIXES: .xs .c .C .cpp .cxx .cc $(OBJ_EXT)
157
158
# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
159
# some make implementations will delete the Makefile when we rebuild it. Because
160
# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
161
# does so. Our milage may vary.
162
# .PRECIOUS: Makefile    # seems to be not necessary anymore
163
164
.PHONY: all config static dynamic test linkext manifest
165
166
# Where is the Config information that we are using/depend on
167
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
168
169
# Where to put things:
170
INST_LIBDIR      = $(INST_LIB)/Mail
171
INST_ARCHLIBDIR  = $(INST_ARCHLIB)/Mail
172
173
INST_AUTODIR     = $(INST_LIB)/auto/$(FULLEXT)
174
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
175
176
INST_STATIC  =
177
INST_DYNAMIC =
178
INST_BOOT    =
179
180
EXPORT_LIST = 
181
182
PERL_ARCHIVE = 
183
184
PERL_ARCHIVE_AFTER = 
185
186
TO_INST_PM = lib/Mail/SpamAssassin.pm \
187
	lib/Mail/SpamAssassin/ArchiveIterator.pm \
188
	lib/Mail/SpamAssassin/AuditMessage.pm \
189
	lib/Mail/SpamAssassin/AutoWhitelist.pm \
190
	lib/Mail/SpamAssassin/Bayes.pm \
191
	lib/Mail/SpamAssassin/BayesStore.pm \
192
	lib/Mail/SpamAssassin/BayesTokenLog.pm \
193
	lib/Mail/SpamAssassin/CmdLearn.pm \
194
	lib/Mail/SpamAssassin/Conf.pm \
195
	lib/Mail/SpamAssassin/ConfSourceSQL.pm \
196
	lib/Mail/SpamAssassin/DBBasedAddrList.pm \
197
	lib/Mail/SpamAssassin/Dns.pm \
198
	lib/Mail/SpamAssassin/EncappedMIME.pm \
199
	lib/Mail/SpamAssassin/EncappedMessage.pm \
200
	lib/Mail/SpamAssassin/EvalTests.pm \
201
	lib/Mail/SpamAssassin/HTML.pm \
202
	lib/Mail/SpamAssassin/Locales.pm \
203
	lib/Mail/SpamAssassin/Locker.pm \
204
	lib/Mail/SpamAssassin/MailingList.pm \
205
	lib/Mail/SpamAssassin/Message.pm \
206
	lib/Mail/SpamAssassin/NetSet.pm \
207
	lib/Mail/SpamAssassin/NoMailAudit.pm \
208
	lib/Mail/SpamAssassin/PerMsgLearner.pm \
209
	lib/Mail/SpamAssassin/PerMsgStatus.pm \
210
	lib/Mail/SpamAssassin/PersistentAddrList.pm \
211
	lib/Mail/SpamAssassin/PhraseFreqs.pm \
212
	lib/Mail/SpamAssassin/Received.pm \
213
	lib/Mail/SpamAssassin/Replier.pm \
214
	lib/Mail/SpamAssassin/Reporter.pm \
215
	lib/Mail/SpamAssassin/SHA1.pm \
216
	lib/Mail/SpamAssassin/StateDirHash.pm \
217
	lib/Mail/SpamAssassin/TextCat.pm \
218
	lib/Mail/SpamAssassin/UnixLocker.pm \
219
	lib/Mail/SpamAssassin/Util.pm \
220
	lib/Mail/SpamAssassin/Win32Locker.pm
221
222
PM_TO_BLIB = lib/Mail/SpamAssassin/NetSet.pm \
223
	$(INST_LIB)/Mail/SpamAssassin/NetSet.pm \
224
	lib/Mail/SpamAssassin/StateDirHash.pm \
225
	$(INST_LIB)/Mail/SpamAssassin/StateDirHash.pm \
226
	lib/Mail/SpamAssassin/Bayes.pm \
227
	$(INST_LIB)/Mail/SpamAssassin/Bayes.pm \
228
	lib/Mail/SpamAssassin/ConfSourceSQL.pm \
229
	$(INST_LIB)/Mail/SpamAssassin/ConfSourceSQL.pm \
230
	lib/Mail/SpamAssassin/DBBasedAddrList.pm \
231
	$(INST_LIB)/Mail/SpamAssassin/DBBasedAddrList.pm \
232
	lib/Mail/SpamAssassin/PerMsgStatus.pm \
233
	$(INST_LIB)/Mail/SpamAssassin/PerMsgStatus.pm \
234
	lib/Mail/SpamAssassin/Reporter.pm \
235
	$(INST_LIB)/Mail/SpamAssassin/Reporter.pm \
236
	lib/Mail/SpamAssassin/SHA1.pm \
237
	$(INST_LIB)/Mail/SpamAssassin/SHA1.pm \
238
	lib/Mail/SpamAssassin/HTML.pm \
239
	$(INST_LIB)/Mail/SpamAssassin/HTML.pm \
240
	lib/Mail/SpamAssassin/Win32Locker.pm \
241
	$(INST_LIB)/Mail/SpamAssassin/Win32Locker.pm \
242
	lib/Mail/SpamAssassin/ArchiveIterator.pm \
243
	$(INST_LIB)/Mail/SpamAssassin/ArchiveIterator.pm \
244
	lib/Mail/SpamAssassin/PerMsgLearner.pm \
245
	$(INST_LIB)/Mail/SpamAssassin/PerMsgLearner.pm \
246
	lib/Mail/SpamAssassin/AutoWhitelist.pm \
247
	$(INST_LIB)/Mail/SpamAssassin/AutoWhitelist.pm \
248
	lib/Mail/SpamAssassin/PhraseFreqs.pm \
249
	$(INST_LIB)/Mail/SpamAssassin/PhraseFreqs.pm \
250
	lib/Mail/SpamAssassin/Util.pm \
251
	$(INST_LIB)/Mail/SpamAssassin/Util.pm \
252
	lib/Mail/SpamAssassin/Dns.pm \
253
	$(INST_LIB)/Mail/SpamAssassin/Dns.pm \
254
	lib/Mail/SpamAssassin/Message.pm \
255
	$(INST_LIB)/Mail/SpamAssassin/Message.pm \
256
	lib/Mail/SpamAssassin/EvalTests.pm \
257
	$(INST_LIB)/Mail/SpamAssassin/EvalTests.pm \
258
	lib/Mail/SpamAssassin/Locales.pm \
259
	$(INST_LIB)/Mail/SpamAssassin/Locales.pm \
260
	lib/Mail/SpamAssassin/Conf.pm \
261
	$(INST_LIB)/Mail/SpamAssassin/Conf.pm \
262
	lib/Mail/SpamAssassin/Replier.pm \
263
	$(INST_LIB)/Mail/SpamAssassin/Replier.pm \
264
	lib/Mail/SpamAssassin.pm \
265
	$(INST_LIB)/Mail/SpamAssassin.pm \
266
	lib/Mail/SpamAssassin/AuditMessage.pm \
267
	$(INST_LIB)/Mail/SpamAssassin/AuditMessage.pm \
268
	lib/Mail/SpamAssassin/Locker.pm \
269
	$(INST_LIB)/Mail/SpamAssassin/Locker.pm \
270
	lib/Mail/SpamAssassin/MailingList.pm \
271
	$(INST_LIB)/Mail/SpamAssassin/MailingList.pm \
272
	lib/Mail/SpamAssassin/BayesTokenLog.pm \
273
	$(INST_LIB)/Mail/SpamAssassin/BayesTokenLog.pm \
274
	lib/Mail/SpamAssassin/CmdLearn.pm \
275
	$(INST_LIB)/Mail/SpamAssassin/CmdLearn.pm \
276
	lib/Mail/SpamAssassin/EncappedMIME.pm \
277
	$(INST_LIB)/Mail/SpamAssassin/EncappedMIME.pm \
278
	lib/Mail/SpamAssassin/NoMailAudit.pm \
279
	$(INST_LIB)/Mail/SpamAssassin/NoMailAudit.pm \
280
	lib/Mail/SpamAssassin/BayesStore.pm \
281
	$(INST_LIB)/Mail/SpamAssassin/BayesStore.pm \
282
	lib/Mail/SpamAssassin/PersistentAddrList.pm \
283
	$(INST_LIB)/Mail/SpamAssassin/PersistentAddrList.pm \
284
	lib/Mail/SpamAssassin/Received.pm \
285
	$(INST_LIB)/Mail/SpamAssassin/Received.pm \
286
	lib/Mail/SpamAssassin/TextCat.pm \
287
	$(INST_LIB)/Mail/SpamAssassin/TextCat.pm \
288
	lib/Mail/SpamAssassin/UnixLocker.pm \
289
	$(INST_LIB)/Mail/SpamAssassin/UnixLocker.pm \
290
	lib/Mail/SpamAssassin/EncappedMessage.pm \
291
	$(INST_LIB)/Mail/SpamAssassin/EncappedMessage.pm
292
293
294
# --- MakeMaker tool_autosplit section:
295
296
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
297
AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
298
299
300
# --- MakeMaker tool_xsubpp section:
301
302
303
# --- MakeMaker tools_other section:
304
305
SHELL = /bin/sh
306
CHMOD = chmod
307
CP = cp
308
LD = gcc
309
MV = mv
310
NOOP = $(SHELL) -c true
311
RM_F = rm -f
312
RM_RF = rm -rf
313
TEST_F = test -f
314
TOUCH = touch
315
UMASK_NULL = umask 0
316
DEV_NULL = > /dev/null 2>&1
317
318
# The following is a portable way to say mkdir -p
319
# To see which directories are created, change the if 0 to if 1
320
MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
321
322
# This helps us to minimize the effect of the .exists files A yet
323
# better solution would be to have a stable file in the perl
324
# distribution with a timestamp of zero. But this solution doesn't
325
# need any changes to the core distribution and works with older perls
326
EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
327
328
# Here we warn users that an old packlist file was found somewhere,
329
# and that they should call some uninstall routine
330
WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \
331
-e 'print "WARNING: I have found an old package in\n";' \
332
-e 'print "\t$$ARGV[0].\n";' \
333
-e 'print "Please make sure the two installations are not conflicting\n";'
334
335
UNINST=0
336
VERBINST=0
337
338
MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
339
-e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
340
341
DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \
342
-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \
343
-e 'print "=over 4";' \
344
-e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
345
-e 'print "=back";'
346
347
UNINSTALL =   $(PERL) -MExtUtils::Install \
348
-e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \
349
-e 'print " packlist above carefully.\n  There may be errors. Remove the";' \
350
-e 'print " appropriate files manually.\n  Sorry for the inconveniences.\n"'
351
352
353
# --- MakeMaker dist section:
354
355
DISTVNAME = $(DISTNAME)-$(VERSION)
356
TAR  = tar
357
TARFLAGS = cvf
358
ZIP  = zip
359
ZIPFLAGS = -r
360
COMPRESS = gzip -9f
361
SUFFIX = gz
362
SHAR = shar
363
PREOP = @$(NOOP)
364
POSTOP = @$(NOOP)
365
TO_UNIX = @$(NOOP)
366
CI = ci -u
367
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
368
DIST_CP = best
369
DIST_DEFAULT = tardist
370
371
372
# --- MakeMaker macro section:
373
RULES = 10_misc.cf 20_anti_ratware.cf 20_body_tests.cf 20_compensate.cf 20_dnsbl_tests.cf 20_fake_helo_tests.cf 20_head_tests.cf 20_html_tests.cf 20_meta_tests.cf 20_phrases.cf 20_porn.cf 20_ratware.cf 20_uri_tests.cf 23_bayes.cf 25_body_tests_es.cf 25_body_tests_pl.cf 25_head_tests_es.cf 25_head_tests_pl.cf 30_text_de.cf 30_text_es.cf 30_text_fr.cf 30_text_it.cf 30_text_pl.cf 30_text_sk.cf 50_scores.cf 60_whitelist.cf user_prefs.template triplets.txt languages
374
375
376
# --- MakeMaker depend section:
377
378
379
# --- MakeMaker cflags section:
380
381
382
# --- MakeMaker const_loadlibs section:
383
384
385
# --- MakeMaker const_cccmd section:
386
387
388
# --- MakeMaker post_constants section:
389
390
391
# --- MakeMaker pasthru section:
392
393
PASTHRU = LIB="$(LIB)"\
394
	LIBPERL_A="$(LIBPERL_A)"\
395
	LINKTYPE="$(LINKTYPE)"\
396
	PREFIX="$(PREFIX)"\
397
	OPTIMIZE="$(OPTIMIZE)"
398
399
400
# --- MakeMaker c_o section:
401
402
403
# --- MakeMaker xs_c section:
404
405
406
# --- MakeMaker xs_o section:
407
408
409
# --- MakeMaker top_targets section:
410
411
#all ::	config $(INST_PM) subdirs linkext manifypods
412
413
all :: pure_all htmlifypods manifypods
414
	@$(NOOP)
415
416
pure_all :: config pm_to_blib subdirs linkext
417
	@$(NOOP)
418
419
subdirs :: $(MYEXTLIB)
420
	@$(NOOP)
421
422
config :: Makefile $(INST_LIBDIR)/.exists
423
	@$(NOOP)
424
425
config :: $(INST_ARCHAUTODIR)/.exists
426
	@$(NOOP)
427
428
config :: $(INST_AUTODIR)/.exists
429
	@$(NOOP)
430
431
$(INST_AUTODIR)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
432
	@$(MKPATH) $(INST_AUTODIR)
433
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_AUTODIR)/.exists
434
435
	-@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
436
437
$(INST_LIBDIR)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
438
	@$(MKPATH) $(INST_LIBDIR)
439
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_LIBDIR)/.exists
440
441
	-@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
442
443
$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
444
	@$(MKPATH) $(INST_ARCHAUTODIR)
445
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
446
447
	-@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
448
449
config :: $(INST_MAN1DIR)/.exists
450
	@$(NOOP)
451
452
453
$(INST_MAN1DIR)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
454
	@$(MKPATH) $(INST_MAN1DIR)
455
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_MAN1DIR)/.exists
456
457
	-@$(CHMOD) $(PERM_RWX) $(INST_MAN1DIR)
458
459
config :: $(INST_MAN3DIR)/.exists
460
	@$(NOOP)
461
462
463
$(INST_MAN3DIR)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
464
	@$(MKPATH) $(INST_MAN3DIR)
465
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_MAN3DIR)/.exists
466
467
	-@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
468
469
help:
470
	perldoc ExtUtils::MakeMaker
471
472
Version_check:
473
	@$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
474
		-MExtUtils::MakeMaker=Version_check \
475
		-e "Version_check('$(MM_VERSION)')"
476
477
478
# --- MakeMaker linkext section:
479
480
linkext :: $(LINKTYPE)
481
	@$(NOOP)
482
483
484
# --- MakeMaker dlsyms section:
485
486
487
# --- MakeMaker dynamic section:
488
489
## $(INST_PM) has been moved to the all: target.
490
## It remains here for awhile to allow for old usage: "make dynamic"
491
#dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
492
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT)
493
	@$(NOOP)
494
495
496
# --- MakeMaker dynamic_bs section:
497
498
BOOTSTRAP =
499
500
501
# --- MakeMaker dynamic_lib section:
502
503
504
# --- MakeMaker static section:
505
506
## $(INST_PM) has been moved to the all: target.
507
## It remains here for awhile to allow for old usage: "make static"
508
#static :: Makefile $(INST_STATIC) $(INST_PM)
509
static :: Makefile $(INST_STATIC)
510
	@$(NOOP)
511
512
513
# --- MakeMaker static_lib section:
514
515
516
# --- MakeMaker htmlifypods section:
517
518
htmlifypods : pure_all
519
	@$(NOOP)
520
521
522
# --- MakeMaker manifypods section:
523
POD2MAN_EXE = /usr/bin/pod2man
524
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
525
-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \
526
-e 'print "Manifying $$m{$$_}\n";' \
527
-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
528
-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
529
530
manifypods : pure_all spamd/spamd \
531
	sa-learn \
532
	spamassassin \
533
	spamd/spamc.pod \
534
	lib/Mail/SpamAssassin/PersistentAddrList.pm \
535
	lib/Mail/SpamAssassin/Conf.pm \
536
	lib/Mail/SpamAssassin/StateDirHash.pm \
537
	lib/Mail/SpamAssassin/BayesTokenLog.pm \
538
	lib/Mail/SpamAssassin/Bayes.pm \
539
	lib/Mail/SpamAssassin/ConfSourceSQL.pm \
540
	lib/Mail/SpamAssassin/PerMsgLearner.pm \
541
	lib/Mail/SpamAssassin/PerMsgStatus.pm \
542
	lib/Mail/SpamAssassin/AutoWhitelist.pm \
543
	lib/Mail/SpamAssassin.pm
544
	@$(POD2MAN) \
545
	spamd/spamd \
546
	$(INST_MAN1DIR)/spamd.$(MAN1EXT) \
547
	sa-learn \
548
	$(INST_MAN1DIR)/sa-learn.$(MAN1EXT) \
549
	spamassassin \
550
	$(INST_MAN1DIR)/spamassassin.$(MAN1EXT) \
551
	spamd/spamc.pod \
552
	$(INST_MAN1DIR)/spamc.$(MAN1EXT) \
553
	lib/Mail/SpamAssassin/PersistentAddrList.pm \
554
	$(INST_MAN3DIR)/Mail::SpamAssassin::PersistentAddrList.$(MAN3EXT) \
555
	lib/Mail/SpamAssassin/Conf.pm \
556
	$(INST_MAN3DIR)/Mail::SpamAssassin::Conf.$(MAN3EXT) \
557
	lib/Mail/SpamAssassin/StateDirHash.pm \
558
	$(INST_MAN3DIR)/Mail::SpamAssassin::StateDirHash.$(MAN3EXT) \
559
	lib/Mail/SpamAssassin/BayesTokenLog.pm \
560
	$(INST_MAN3DIR)/Mail::SpamAssassin::BayesTokenLog.$(MAN3EXT) \
561
	lib/Mail/SpamAssassin/Bayes.pm \
562
	$(INST_MAN3DIR)/Mail::SpamAssassin::Bayes.$(MAN3EXT) \
563
	lib/Mail/SpamAssassin/ConfSourceSQL.pm \
564
	$(INST_MAN3DIR)/Mail::SpamAssassin::ConfSourceSQL.$(MAN3EXT) \
565
	lib/Mail/SpamAssassin/PerMsgLearner.pm \
566
	$(INST_MAN3DIR)/Mail::SpamAssassin::PerMsgLearner.$(MAN3EXT) \
567
	lib/Mail/SpamAssassin/PerMsgStatus.pm \
568
	$(INST_MAN3DIR)/Mail::SpamAssassin::PerMsgStatus.$(MAN3EXT) \
569
	lib/Mail/SpamAssassin/AutoWhitelist.pm \
570
	$(INST_MAN3DIR)/Mail::SpamAssassin::AutoWhitelist.$(MAN3EXT) \
571
	lib/Mail/SpamAssassin.pm \
572
	$(INST_MAN3DIR)/Mail::SpamAssassin.$(MAN3EXT)
573
574
# --- MakeMaker processPL section:
575
576
577
# --- MakeMaker installbin section:
578
579
$(INST_SCRIPT)/.exists :: /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h
580
	@$(MKPATH) $(INST_SCRIPT)
581
	@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.1/i386-linux/CORE/perl.h $(INST_SCRIPT)/.exists
582
583
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)
584
585
EXE_FILES = spamassassin sa-learn sa-btok-learn spamd/spamc$(EXE_EXT) spamd/spamd
586
587
FIXIN = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::MakeMaker \
588
    -e "MY->fixin(shift)"
589
590
pure_all :: $(INST_SCRIPT)/sa-btok-learn $(INST_SCRIPT)/spamd $(INST_SCRIPT)/sa-learn $(INST_SCRIPT)/spamc$(EXE_EXT) $(INST_SCRIPT)/spamassassin
591
	@$(NOOP)
592
593
realclean ::
594
	rm -f $(INST_SCRIPT)/sa-btok-learn $(INST_SCRIPT)/spamd $(INST_SCRIPT)/sa-learn $(INST_SCRIPT)/spamc$(EXE_EXT) $(INST_SCRIPT)/spamassassin
595
596
$(INST_SCRIPT)/sa-btok-learn: sa-btok-learn Makefile $(INST_SCRIPT)/.exists
597
	@rm -f $(INST_SCRIPT)/sa-btok-learn
598
	cp sa-btok-learn $(INST_SCRIPT)/sa-btok-learn
599
	$(FIXIN) $(INST_SCRIPT)/sa-btok-learn
600
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/sa-btok-learn
601
602
$(INST_SCRIPT)/spamd: spamd/spamd Makefile $(INST_SCRIPT)/.exists
603
	@rm -f $(INST_SCRIPT)/spamd
604
	cp spamd/spamd $(INST_SCRIPT)/spamd
605
	$(FIXIN) $(INST_SCRIPT)/spamd
606
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/spamd
607
608
$(INST_SCRIPT)/sa-learn: sa-learn Makefile $(INST_SCRIPT)/.exists
609
	@rm -f $(INST_SCRIPT)/sa-learn
610
	cp sa-learn $(INST_SCRIPT)/sa-learn
611
	$(FIXIN) $(INST_SCRIPT)/sa-learn
612
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/sa-learn
613
614
$(INST_SCRIPT)/spamc$(EXE_EXT): spamd/spamc$(EXE_EXT) Makefile $(INST_SCRIPT)/.exists
615
	@rm -f $(INST_SCRIPT)/spamc$(EXE_EXT)
616
	cp spamd/spamc$(EXE_EXT) $(INST_SCRIPT)/spamc$(EXE_EXT)
617
	$(FIXIN) $(INST_SCRIPT)/spamc$(EXE_EXT)
618
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/spamc$(EXE_EXT)
619
620
$(INST_SCRIPT)/spamassassin: spamassassin Makefile $(INST_SCRIPT)/.exists
621
	@rm -f $(INST_SCRIPT)/spamassassin
622
	cp spamassassin $(INST_SCRIPT)/spamassassin
623
	$(FIXIN) $(INST_SCRIPT)/spamassassin
624
	-@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/spamassassin
625
626
627
# --- MakeMaker subdirs section:
628
629
# none
630
631
# --- MakeMaker clean section:
632
633
# Delete temporary files but do not touch installed files. We don't delete
634
# the Makefile here so a later make realclean still has a makefile to use.
635
636
clean ::
637
	-rm -rf pod2htm* spamassassin sa-learn spamd/spamc$(EXE_EXT) spamd/libspamc.so spamd/spamd doc spamd/libsslspamc.so binaries.mk config.h config.status config.cache config.log autom4te.cache qmail/qmail-spamct/do_razor2 t/log ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
638
	-mv Makefile Makefile.old $(DEV_NULL)
639
640
641
# --- MakeMaker realclean section:
642
643
# Delete temporary files (via clean) and also delete installed files
644
realclean purge ::  clean
645
	rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
646
	rm -f  $(INST_LIB)/Mail/SpamAssassin/NetSet.pm
647
	rm -f $(INST_LIB)/Mail/SpamAssassin/StateDirHash.pm
648
	rm -f $(INST_LIB)/Mail/SpamAssassin/Bayes.pm
649
	rm -f $(INST_LIB)/Mail/SpamAssassin/ConfSourceSQL.pm
650
	rm -f $(INST_LIB)/Mail/SpamAssassin/DBBasedAddrList.pm
651
	rm -f $(INST_LIB)/Mail/SpamAssassin/PerMsgStatus.pm
652
	rm -f $(INST_LIB)/Mail/SpamAssassin/Reporter.pm $(INST_LIB)/Mail/SpamAssassin/SHA1.pm
653
	rm -f $(INST_LIB)/Mail/SpamAssassin/HTML.pm
654
	rm -f $(INST_LIB)/Mail/SpamAssassin/Win32Locker.pm
655
	rm -f $(INST_LIB)/Mail/SpamAssassin/ArchiveIterator.pm
656
	rm -f $(INST_LIB)/Mail/SpamAssassin/PerMsgLearner.pm
657
	rm -f $(INST_LIB)/Mail/SpamAssassin/AutoWhitelist.pm
658
	rm -f $(INST_LIB)/Mail/SpamAssassin/PhraseFreqs.pm
659
	rm -f $(INST_LIB)/Mail/SpamAssassin/Util.pm $(INST_LIB)/Mail/SpamAssassin/Dns.pm
660
	rm -f $(INST_LIB)/Mail/SpamAssassin/Message.pm
661
	rm -f $(INST_LIB)/Mail/SpamAssassin/EvalTests.pm
662
	rm -f $(INST_LIB)/Mail/SpamAssassin/Locales.pm $(INST_LIB)/Mail/SpamAssassin/Conf.pm
663
	rm -f $(INST_LIB)/Mail/SpamAssassin/Replier.pm $(INST_LIB)/Mail/SpamAssassin.pm
664
	rm -f $(INST_LIB)/Mail/SpamAssassin/AuditMessage.pm
665
	rm -f $(INST_LIB)/Mail/SpamAssassin/Locker.pm
666
	rm -f $(INST_LIB)/Mail/SpamAssassin/MailingList.pm
667
	rm -f $(INST_LIB)/Mail/SpamAssassin/BayesTokenLog.pm
668
	rm -f $(INST_LIB)/Mail/SpamAssassin/CmdLearn.pm
669
	rm -f $(INST_LIB)/Mail/SpamAssassin/EncappedMIME.pm
670
	rm -f $(INST_LIB)/Mail/SpamAssassin/NoMailAudit.pm
671
	rm -f $(INST_LIB)/Mail/SpamAssassin/BayesStore.pm
672
	rm -f $(INST_LIB)/Mail/SpamAssassin/PersistentAddrList.pm
673
	rm -f $(INST_LIB)/Mail/SpamAssassin/Received.pm
674
	rm -f $(INST_LIB)/Mail/SpamAssassin/TextCat.pm
675
	rm -f $(INST_LIB)/Mail/SpamAssassin/UnixLocker.pm
676
	rm -f $(INST_LIB)/Mail/SpamAssassin/EncappedMessage.pm
677
	rm -rf Makefile Makefile.old
678
679
680
# --- MakeMaker dist_basics section:
681
682
distclean :: realclean distcheck
683
684
distcheck :
685
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=fullcheck \
686
		-e fullcheck
687
688
skipcheck :
689
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=skipcheck \
690
		-e skipcheck
691
692
manifest :
693
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \
694
		-e mkmanifest
695
696
veryclean : realclean
697
	$(RM_F) *~ *.orig */*~ */*.orig
698
699
700
# --- MakeMaker dist_core section:
701
702
dist : $(DIST_DEFAULT)
703
	@$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
704
	    -e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";'
705
706
tardist : $(DISTVNAME).tar$(SUFFIX)
707
708
zipdist : $(DISTVNAME).zip
709
710
$(DISTVNAME).tar$(SUFFIX) : distdir
711
	$(PREOP)
712
	$(TO_UNIX)
713
	$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
714
	$(RM_RF) $(DISTVNAME)
715
	$(COMPRESS) $(DISTVNAME).tar
716
	$(POSTOP)
717
718
$(DISTVNAME).zip : distdir
719
	$(PREOP)
720
	$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
721
	$(RM_RF) $(DISTVNAME)
722
	$(POSTOP)
723
724
uutardist : $(DISTVNAME).tar$(SUFFIX)
725
	uuencode $(DISTVNAME).tar$(SUFFIX) \
726
		$(DISTVNAME).tar$(SUFFIX) > \
727
		$(DISTVNAME).tar$(SUFFIX)_uu
728
729
shdist : distdir
730
	$(PREOP)
731
	$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
732
	$(RM_RF) $(DISTVNAME)
733
	$(POSTOP)
734
735
736
# --- MakeMaker dist_dir section:
737
738
distdir :
739
	$(RM_RF) $(DISTVNAME)
740
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=manicopy,maniread \
741
		-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
742
743
744
# --- MakeMaker dist_test section:
745
746
disttest : distdir
747
	cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
748
	cd $(DISTVNAME) && $(MAKE)
749
	cd $(DISTVNAME) && $(MAKE) test
750
751
752
# --- MakeMaker dist_ci section:
753
754
ci :
755
	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \
756
		-e "@all = keys %{ maniread() };" \
757
		-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \
758
		-e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
759
760
761
# --- MakeMaker install section:
762
763
install :: all pure_install doc_install inst_cfs
764
765
install_perl :: all pure_perl_install doc_perl_install
766
767
install_site :: all pure_site_install doc_site_install
768
769
install_vendor :: all pure_vendor_install doc_vendor_install
770
771
install_ :: install_site
772
	@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
773
774
pure_install :: pure_$(INSTALLDIRS)_install
775
776
doc_install :: doc_$(INSTALLDIRS)_install
777
	@echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
778
779
pure__install : pure_site_install
780
	@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
781
782
doc__install : doc_site_install
783
	@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
784
785
pure_perl_install ::
786
	@$(MOD_INSTALL) \
787
		read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
788
		write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
789
		$(INST_LIB) $(INSTALLPRIVLIB) \
790
		$(INST_ARCHLIB) $(INSTALLARCHLIB) \
791
		$(INST_BIN) $(INSTALLBIN) \
792
		$(INST_SCRIPT) $(INSTALLSCRIPT) \
793
		$(INST_HTMLLIBDIR) $(INSTALLHTMLPRIVLIBDIR) \
794
		$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
795
		$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
796
		$(INST_MAN3DIR) $(INSTALLMAN3DIR)
797
	@$(WARN_IF_OLD_PACKLIST) \
798
		$(SITEARCHEXP)/auto/$(FULLEXT)
799
800
801
pure_site_install ::
802
	@$(MOD_INSTALL) \
803
		read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
804
		write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
805
		$(INST_LIB) $(INSTALLSITELIB) \
806
		$(INST_ARCHLIB) $(INSTALLSITEARCH) \
807
		$(INST_BIN) $(INSTALLBIN) \
808
		$(INST_SCRIPT) $(INSTALLSCRIPT) \
809
		$(INST_HTMLLIBDIR) $(INSTALLHTMLSITELIBDIR) \
810
		$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
811
		$(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \
812
		$(INST_MAN3DIR) $(INSTALLSITEMAN3DIR)
813
	@$(WARN_IF_OLD_PACKLIST) \
814
		$(PERL_ARCHLIB)/auto/$(FULLEXT)
815
816
pure_vendor_install ::
817
	@$(MOD_INSTALL) \
818
		read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \
819
		write $(INSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \
820
		$(INST_LIB) $(INSTALLVENDORLIB) \
821
		$(INST_ARCHLIB) $(INSTALLVENDORARCH) \
822
		$(INST_BIN) $(INSTALLBIN) \
823
		$(INST_SCRIPT) $(INSTALLSCRIPT) \
824
		$(INST_HTMLLIBDIR) $(INSTALLHTMLVENDORLIBDIR) \
825
		$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
826
		$(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) \
827
		$(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR)
828
	@$(WARN_IF_OLD_PACKLIST) \
829
		$(PERL_ARCHLIB)/auto/$(FULLEXT)
830
831
doc_perl_install ::
832
	-@$(MKPATH) $(INSTALLARCHLIB)
833
	-@$(DOC_INSTALL) \
834
		"Module" "$(NAME)" \
835
		"installed into" "$(INSTALLPRIVLIB)" \
836
		LINKTYPE "$(LINKTYPE)" \
837
		VERSION "$(VERSION)" \
838
		EXE_FILES "$(EXE_FILES)" \
839
		>> $(INSTALLARCHLIB)/perllocal.pod
840
841
doc_site_install ::
842
	-@$(MKPATH) $(INSTALLSITEARCHLIB)
843
	-@$(DOC_INSTALL) \
844
		"Module" "$(NAME)" \
845
		"installed into" "$(INSTALLSITELIB)" \
846
		LINKTYPE "$(LINKTYPE)" \
847
		VERSION "$(VERSION)" \
848
		EXE_FILES "$(EXE_FILES)" \
849
		>> $(INSTALLSITEARCHLIB)/perllocal.pod
850
851
doc_vendor_install ::
852
	-@$(MKPATH) $(INSTALLVENDORARCHLIB)
853
	-@$(DOC_INSTALL) \
854
		"Module" "$(NAME)" \
855
		"installed into" "$(INSTALLVENDORLIB)" \
856
		LINKTYPE "$(LINKTYPE)" \
857
		VERSION "$(VERSION)" \
858
		EXE_FILES "$(EXE_FILES)" \
859
		>> $(INSTALLVENDORARCHLIB)/perllocal.pod
860
861
862
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
863
864
uninstall_from_perldirs ::
865
	@$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
866
867
uninstall_from_sitedirs ::
868
	@$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
869
870
871
# --- MakeMaker force section:
872
# Phony target to force checking subdirectories.
873
FORCE:
874
	@$(NOOP)
875
876
877
# --- MakeMaker perldepend section:
878
879
880
# --- MakeMaker makefile section:
881
882
# We take a very conservative approach here, but it\'s worth it.
883
# We move Makefile to Makefile.old here to avoid gnu make looping.
884
Makefile : Makefile.PL $(CONFIGDEP)
885
	@echo "Makefile out-of-date with respect to $?"
886
	@echo "Cleaning current config before rebuilding Makefile..."
887
	-@$(RM_F) Makefile.old
888
	-@$(MV) Makefile Makefile.old
889
	-$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP)
890
	$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL 
891
	@echo "==> Your Makefile has been rebuilt. <=="
892
	@echo "==> Please rerun the make command.  <=="
893
	false
894
895
# To change behavior to :: would be nice, but would break Tk b9.02
896
# so you find such a warning below the dist target.
897
#Makefile :: $(VERSION_FROM)
898
#	@echo "Warning: Makefile possibly out of date with $(VERSION_FROM)"
899
900
901
# --- MakeMaker staticmake section:
902
903
# --- MakeMaker makeaperl section ---
904
MAP_TARGET    = perl
905
FULLPERL      = /usr/bin/perl
906
907
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
908
	$(MAKE) -f $(MAKE_APERL_FILE) $@
909
910
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
911
	@echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
912
	@$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
913
		Makefile.PL DIR= \
914
		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
915
		MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
916
917
918
# --- MakeMaker test section:
919
920
TEST_VERBOSE=0
921
TEST_TYPE=test_$(LINKTYPE)
922
TEST_FILE = test.pl
923
TEST_FILES = t/*.t
924
TESTDB_SW = -d
925
926
testdb :: testdb_$(LINKTYPE)
927
928
test :: $(TEST_TYPE)
929
930
test_dynamic :: pure_all
931
	PERL_DL_NONLAZY=1 $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;' $(TEST_FILES)
932
933
testdb_dynamic :: pure_all
934
	PERL_DL_NONLAZY=1 $(FULLPERL) $(TESTDB_SW) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE)
935
936
test_ : test_dynamic
937
938
test_static :: test_dynamic
939
testdb_static :: testdb_dynamic
940
941
942
# --- MakeMaker ppd section:
943
# Creates a PPD (Perl Package Description) for a binary distribution.
944
ppd:
945
	@$(PERL) -e "print qq{<SOFTPKG NAME=\"Mail-SpamAssassin\" VERSION=\"2,60,0,0\">\n}. qq{\t<TITLE>Mail-SpamAssassin</TITLE>\n}. qq{\t<ABSTRACT>identify spam mail using text analysis</ABSTRACT>\n}. qq{\t<AUTHOR>Justin Mason &lt;jm\@jmason.org&gt;</AUTHOR>\n}. qq{\t<IMPLEMENTATION>\n}. qq{\t\t<DEPENDENCY NAME=\"Errno\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"ExtUtils-MakeMaker\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"File-Copy\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"File-Spec\" VERSION=\"0,8,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"HTML-Parser\" VERSION=\"3,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"Pod-Usage\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"Text-Wrap\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<DEPENDENCY NAME=\"Time-Local\" VERSION=\"0,0,0,0\" />\n}. qq{\t\t<OS NAME=\"$(OSNAME)\" />\n}. qq{\t\t<ARCHITECTURE NAME=\"i386-linux\" />\n}. qq{\t\t<CODEBASE HREF=\"\" />\n}. qq{\t</IMPLEMENTATION>\n}. qq{</SOFTPKG>\n}" > Mail-SpamAssassin.ppd
946
947
# --- MakeMaker pm_to_blib section:
948
949
pm_to_blib: $(TO_INST_PM)
950
	@$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
951
	"-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
952
        -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto','$(PM_FILTER)')"
953
	@$(TOUCH) $@
954
955
956
# --- MakeMaker selfdocument section:
957
958
959
# --- MakeMaker postamble section:
960
961
INST_PREFIX     	= /usr
962
SYSCONFDIR      	= /etc
963
INST_SYSCONFDIR 	= /etc
964
PKG_DEF_RULES_DIR 	= $(PREFIX)/share/spamassassin
965
DEF_RULES_DIR		= $(INST_PREFIX)/share/spamassassin
966
PKG_LOCAL_RULES_DIR	= $(SYSCONFDIR)/mail/spamassassin
967
LOCAL_RULES_DIR		= $(INST_SYSCONFDIR)/mail/spamassassin
968
INST_SITELIB		= $(INSTALLSITELIB)
969
ENABLE_SSL		= no
970
CONTACT_ADDRESS		= the administrator of that system
971
972
PERL_BIN		= this
973
PERL_WARN		= auto
974
PERL_VERSION 		= this
975
976
977
978
FIXVARS		= -Mvars \
979
		  -DVERSION="$(VERSION)" \
980
		  -DPREFIX="$(INST_PREFIX)" \
981
		  -DDEF_RULES_DIR="$(DEF_RULES_DIR)" \
982
		  -DLOCAL_RULES_DIR="$(LOCAL_RULES_DIR)" \
983
		  -DINSTALLSITELIB="$(INST_SITELIB)" \
984
		  -DCONTACT_ADDRESS="$(CONTACT_ADDRESS)"
985
986
FIXBYTES	= -Mbytes \
987
		  -DPERL_VERSION="$(PERL_VERSION)"
988
                  
989
FIXBANG		= -Msharpbang \
990
		  -DPERL_BIN="$(PERL_BIN)" \
991
		  -DPERL_WARN="$(PERL_WARN)"
992
993
SPAMC_SOURCES = spamd/spamc.c qmail/qmail-spamc.c spamd/libspamc.c spamd/utils.c
994
995
996
997
spamassassin: spamassassin.raw
998
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
999
	$(CHMOD) $(PERM_RWX) $@
1000
1001
sa-learn: sa-learn.raw
1002
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
1003
	$(CHMOD) $(PERM_RWX) $@
1004
1005
sa-btok-learn: sa-btok-learn.raw
1006
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
1007
	$(CHMOD) $(PERM_RWX) $@
1008
1009
spamd/spamd: spamd/spamd.raw
1010
	$(PERL) build/preprocessor $(FIXBYTES) $(FIXVARS) $(FIXBANG) -i$? -o$@
1011
	$(CHMOD) $(PERM_RWX) $@
1012
1013
spamd/libspamc.so: binaries.mk $(SPAMC_SOURCES)
1014
	$(MAKE) -f binaries.mk $@
1015
1016
spamd/libspamc.dll: binaries.mk $(SPAMC_SOURCES)
1017
	$(MAKE) -f binaries.mk $@
1018
1019
spamd/spamc$(EXE_EXT): binaries.mk $(SPAMC_SOURCES)
1020
	$(MAKE) -f binaries.mk $@
1021
1022
spamd/libsslspamc.so: binaries.mk $(SPAMC_SOURCES)
1023
	$(MAKE) -f binaries.mk $@
1024
1025
spamd/libsslspamc.dll: binaries.mk $(SPAMC_SOURCES)
1026
	$(MAKE) -f binaries.mk $@
1027
1028
qmail/qmail-spamc: binaries.mk $(SPAMC_SOURCES)
1029
	$(MAKE) -f binaries.mk $@
1030
1031
binaries.mk: configure
1032
	./configure --enable-ssl=$(ENABLE_SSL)
1033
1034
inst_cfs: $(PKG_LOCAL_RULES_DIR) $(PKG_LOCAL_RULES_DIR)/local.cf
1035
	$(MKPATH) $(PKG_DEF_RULES_DIR)
1036
	$(RM_RF) $(PKG_DEF_RULES_DIR)/*
1037
	$(PERL) build/preprocessor $(FIXVARS) -m$(PERM_RW) -Irules -O$(PKG_DEF_RULES_DIR) $(RULES)
1038
	$(CHMOD) $(PERM_RWX) $(PKG_DEF_RULES_DIR)
1039
1040
$(PKG_LOCAL_RULES_DIR):
1041
	$(MKPATH) $@
1042
1043
$(PKG_LOCAL_RULES_DIR)/local.cf: rules/local.cf
1044
	$(PERL) -e "use File::Copy; (-f '$@') or copy ('$?', '$@');"
1045
1046
text_html_doc: made-doc-stamp
1047
	$(NOOP)
1048
1049
doc:
1050
	$(MKPATH) $@
1051
1052
made-doc-stamp: doc $(MAN1PODS) $(MAN3PODS) $(EXTRAPODS)
1053
	$(PERL) build/convert_pods_to_doc $(MAN1PODS) $(MAN3PODS) $(EXTRAPODS)
1054
	
1055
	$(TOUCH) made-doc-stamp
1056
	$(RM_F) pod2htm*
1057
1058
1059
1060
# End.
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/Bayes.pm (+152 lines)
Lines 29-34 Link Here
29
29
30
use strict;
30
use strict;
31
use bytes;
31
use bytes;
32
use Sys::Hostname;
33
use File::Path;
34
use File::Spec;
35
use File::Basename;
32
36
33
use Mail::SpamAssassin;
37
use Mail::SpamAssassin;
34
use Mail::SpamAssassin::BayesStore;
38
use Mail::SpamAssassin::BayesStore;
Lines 295-300 Link Here
295
  }
299
  }
296
300
297
  my @toks = @{$self->{tokens}}; delete $self->{tokens};
301
  my @toks = @{$self->{tokens}}; delete $self->{tokens};
302
298
  ($wc, @toks);
303
  ($wc, @toks);
299
}
304
}
300
305
Lines 606-611 Link Here
606
611
607
###########################################################################
612
###########################################################################
608
613
614
sub learn_tokens {
615
  my ($self, $toks, $id, $isspam) = @_;
616
617
  my $ret;
618
619
  eval {
620
    local $SIG{'__DIE__'};      # do not run user die() traps in here
621
622
    my $ok;
623
    if ($self->{main}->{learn_to_journal}) {
624
      $ok = $self->{store}->tie_db_readonly();
625
    } else {
626
      $ok = $self->{store}->tie_db_writable();
627
    }
628
629
    if ($ok) {
630
      $ret = $self->learn_trapped_tokens ($toks, $id, $isspam);
631
632
      if (!$self->{main}->{learn_caller_will_untie}) {
633
        $self->{store}->untie_db();
634
      }
635
    }
636
  };
637
638
  if ($@) {             # if we died, untie the dbs.
639
    my $failure = $@;
640
    $self->{store}->untie_db();
641
    die $failure;
642
  }
643
644
  return $ret;
645
}
646
609
sub learn {
647
sub learn {
610
  my ($self, $isspam, $msg) = @_;
648
  my ($self, $isspam, $msg) = @_;
611
649
Lines 686-691 Link Here
686
  1;
724
  1;
687
}
725
}
688
726
727
sub learn_trapped_tokens {
728
  my ($self, $toks, $id, $isspam) = @_;
729
730
  my $seen = $self->{store}->seen_get($id);
731
732
  if (defined($seen)) {
733
    if (($seen eq 's' && $isspam) || ($seen eq 'h' && !$isspam)) {
734
      dbg ("$id: already learnt correctly, not learning twice");
735
      return;
736
    } elsif ($seen !~ /^[hs]$/) {
737
      warn ("db_seen corrupt: value='$seen' for $id. ignored");
738
    } else {
739
      dbg ("$id: already learnt as opposite, forgetting first");
740
      $self->forget_tokens ($toks, $id);
741
    }
742
  }
743
744
  if ($isspam) {
745
    $self->{store}->nspam_nham_change(1,0);
746
  } else {
747
    $self->{store}->nspam_nham_change(0,1);
748
  }
749
750
  my @tokens = @$toks;
751
  my %seen = ();
752
753
  my $msgatime = time(); # this is sort of incorrect.
754
755
  for (@tokens) {
756
    if ($seen{$_}) { next; } else { $seen{$_} = 1; }
757
758
    if ($isspam) {
759
      $self->{store}->tok_count_change (1, 0, $_, $msgatime);
760
    } else {
761
      $self->{store}->tok_count_change (0, 1, $_, $msgatime);
762
    }
763
  }
764
765
  $self->{store}->seen_put ($id, ($isspam ? 's' : 'h'));
766
  $self->{store}->add_touches_to_journal();
767
  1;
768
}
769
689
###########################################################################
770
###########################################################################
690
771
691
sub forget {
772
sub forget {
Lines 719-724 Link Here
719
  return $ret;
800
  return $ret;
720
}
801
}
721
802
803
sub forget_tokens {
804
  my ($self, $toks, $id) = @_;
805
806
  if (!$self->{conf}->{use_bayes}) { return; }
807
  my $ret;
808
809
  # we still tie for writing here, since we write to the seen db
810
  # synchronously
811
  eval {
812
    local $SIG{'__DIE__'};	# do not run user die() traps in here
813
814
    if ($self->{store}->tie_db_writable()) {
815
      $ret = $self->forget_trapped_tokens ($toks, $id);
816
817
      if (!$self->{main}->{learn_caller_will_untie}) {
818
        $self->{store}->untie_db();
819
      }
820
    }
821
  };
822
823
  if ($@) {		# if we died, untie the dbs.
824
    my $failure = $@;
825
    $self->{store}->untie_db();
826
    die $failure;
827
  }
828
829
  return $ret;
830
}
831
832
722
# this function is trapped by the wrapper above
833
# this function is trapped by the wrapper above
723
sub forget_trapped {
834
sub forget_trapped {
724
  my ($self, $msg, $body) = @_;
835
  my ($self, $msg, $body) = @_;
Lines 750-755 Link Here
750
  my %seen = ();
861
  my %seen = ();
751
  for (@tokens) {
862
  for (@tokens) {
752
    if ($seen{$_}) { next; } else { $seen{$_} = 1; }
863
    if ($seen{$_}) { next; } else { $seen{$_} = 1; }
864
865
    if ($isspam) {
866
      $self->{store}->tok_count_change (-1, 0, $_);
867
    } else {
868
      $self->{store}->tok_count_change (0, -1, $_);
869
    }
870
  }
871
872
  $self->{store}->seen_delete ($msgid);
873
  1;
874
}
875
876
sub forget_trapped_tokens {
877
  my ($self, $toks, $msgid) = @_;
878
879
  my $seen = $self->{store}->seen_get ($msgid);
880
  my $isspam;
881
  if (defined ($seen)) {
882
    if ($seen eq 's') {
883
      $isspam = 1;
884
    } elsif ($seen eq 'h') {
885
      $isspam = 0;
886
    } else {
887
      dbg ("forget: message $msgid seen entry is neither ham nor spam, ignored");
888
      return;
889
    }
890
  } else {
891
    dbg ("forget: message $msgid not learnt, ignored");
892
    return;
893
  }
894
895
  if ($isspam) {
896
    $self->{store}->nspam_nham_change (-1, 0);
897
  } else {
898
    $self->{store}->nspam_nham_change (0, -1);
899
  }
900
901
  my @tokens = @$toks;
902
  my %seen = ();
903
  for (@tokens) {
904
    if ($seen{$_}) { next; } else { $seen{$_} = 1; }
753
905
754
    if ($isspam) {
906
    if ($isspam) {
755
      $self->{store}->tok_count_change (-1, 0, $_);
907
      $self->{store}->tok_count_change (-1, 0, $_);
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/BayesStore.pm (-1 lines)
Lines 136-142 Link Here
136
    dbg ("bayes_path not defined");
136
    dbg ("bayes_path not defined");
137
    return 0;
137
    return 0;
138
  }
138
  }
139
140
  my $path = $main->sed_path ($main->{conf}->{bayes_path});
139
  my $path = $main->sed_path ($main->{conf}->{bayes_path});
141
140
142
  my $found=0;
141
  my $found=0;
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/BayesTokenLog.pm (+49 lines)
Line 0 Link Here
1
=head1 NAME
2
3
Mail::SpamAssassin::BayesTokenLog - per message logging of Bayes Tokens for
4
use in training bayes.
5
6
=head1 SYNOPSIS
7
8
=head1 DESCRIPTION
9
10
=head1 METHODS
11
12
=over 4
13
14
=cut
15
16
package Mail::SpamAssassin::BayesTokenLog;
17
18
use strict;
19
20
use Mail::SpamAssassin;
21
use Mail::SpamAssassin::Conf;
22
23
use vars qw{
24
  @ISA
25
};
26
27
@ISA = qw();
28
29
30
###########################################################################
31
32
sub new {
33
  my $class = shift;
34
  $class = ref($class) || $class;
35
  my ($main) = @_;
36
  my $self = {
37
    'main'              => $main,
38
    'conf'		=> $main->{conf},
39
  };
40
41
  bless ($self, $class);
42
43
  $self;
44
}
45
46
47
###########################################################################
48
49
1;
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/Conf.pm (+47 lines)
Lines 2384-2389 Link Here
2384
      $self->{user_scores_sql_field_scope} = $1; next;
2384
      $self->{user_scores_sql_field_scope} = $1; next;
2385
    }
2385
    }
2386
2386
2387
=item state_dir_hash_base field_value
2388
2389
The base path for the state_dir_hash
2390
2391
=cut
2392
    if(/^state_dir_hash_base\s+(\S+)$/) {
2393
      $self->{state_dir_hash_base} = $1; next;
2394
    }
2395
2396
=item use_state_dir_hash field_value
2397
2398
set to 1 to enable
2399
2400
=cut
2401
    if(/^use_state_dir_hash\s+(\S+)$/) {
2402
      $self->{use_state_dir_hash} = $1; next;
2403
    }
2404
2405
=item per_msg_bayes_token_log field_value
2406
2407
set to 1 to enable
2408
2409
=cut
2410
    if(/^per_msg_bayes_token_log\s+(\S+)$/) {
2411
      $self->{per_msg_bayes_token_log} = $1; next;
2412
    }
2413
2414
=item per_msg_bayes_token_dir field_value
2415
2416
set to something like __statedir__/bayes_loken_log
2417
2418
=cut
2419
    if(/^per_msg_bayes_token_dir\s+(\S+)$/) {
2420
      $self->{per_msg_bayes_token_dir} = $1; next;
2421
    }
2422
2423
=item per_msg_bayes_token_retries field_value
2424
2425
number of times to retry for the token file
2426
2427
=cut
2428
    if(/^per_msg_bayes_token_retries\s+(\S+)$/) {
2429
      $self->{per_msg_bayes_token_retries} = $1; next;
2430
    }
2431
2432
2433
2387
###########################################################################
2434
###########################################################################
2388
2435
2389
failed_line:
2436
failed_line:
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/PerMsgStatus.pm (+63 lines)
Lines 38-43 Link Here
38
use Text::Wrap qw();
38
use Text::Wrap qw();
39
use POSIX qw(strftime);
39
use POSIX qw(strftime);
40
use Sys::Hostname;
40
use Sys::Hostname;
41
use File::Path qw(mkpath);
41
42
42
use Mail::SpamAssassin::EvalTests;
43
use Mail::SpamAssassin::EvalTests;
43
use Mail::SpamAssassin::AutoWhitelist;
44
use Mail::SpamAssassin::AutoWhitelist;
Lines 112-117 Link Here
112
  $self->{head_only_hits} = 0;
113
  $self->{head_only_hits} = 0;
113
  $self->{hits} = 0;
114
  $self->{hits} = 0;
114
115
116
  my $toks;
117
118
  # Log all bayesian tokens to a file for later training
119
  if ($self->{conf}->{per_msg_bayes_token_log})
120
  {
121
    $toks = join("\n", $self->{main}->{bayes_scanner}->tokenize(
122
      $self->{msg}, $self->{main}->{bayes_scanner}->get_body_from_msg(
123
        $self->{msg})))."\n";
124
  }
125
115
  # Resident Mail::SpamAssassin code will possibly never change score
126
  # Resident Mail::SpamAssassin code will possibly never change score
116
  # sets, even if bayes becomes available.  So we should do a quick check
127
  # sets, even if bayes becomes available.  So we should do a quick check
117
  # to see if we should go from {0,1} to {2,3}.  We of course don't need
128
  # to see if we should go from {0,1} to {2,3}.  We of course don't need
Lines 237-242 Link Here
237
  $report =~ s/\n*$/\n\n/s;
248
  $report =~ s/\n*$/\n\n/s;
238
  $self->{report} = $report;
249
  $self->{report} = $report;
239
250
251
  if ($self->{conf}->{per_msg_bayes_token_log})
252
  {
253
    my $path = $self->{main}->sed_path($self->{conf}->{per_msg_bayes_token_dir});
254
255
    if (! -d $path)
256
    {
257
      dbg("Making (mkdiring) path for token log: $path");
258
      eval { mkpath($path, 0, 0700) } or dbg ("mkdir $path failed: $@ $!");
259
    }
260
  
261
    my $file = $self->get_maildir_file($path);
262
    dbg("Writing token log to file: $file");
263
  
264
    if (!open(F, ">$file"))
265
    {
266
      dbg("Couldn't open file $file for writing of tokens: $!");
267
      return;
268
    }
269
270
    my $hits    = $self->{hits}."\n";
271
    my $is_spam = $self->{is_spam} ? "1\n" : "0\n";
272
    my $from    = $self->{msg}->get_pristine_header('From');
273
    my $date    = $self->{msg}->get_pristine_header('Date');
274
    my $subj    = $self->{msg}->get_pristine_header('Subject');
275
276
    print F $hits;
277
    print F $is_spam;
278
    print F $from;
279
    print F $date;
280
    print F $subj;
281
282
    print F $toks;
283
284
    close(F);
285
  }
240
}
286
}
241
287
242
###########################################################################
288
###########################################################################
Lines 2507-2512 Link Here
2507
  return ($reportfile, \*TMPFILE);
2553
  return ($reportfile, \*TMPFILE);
2508
}
2554
}
2509
2555
2556
sub get_maildir_file {
2557
  my ($self, $dir) = @_;
2558
2559
  my $ctime = time();
2560
  my $pid = $$;
2561
  my $hostname = hostname();
2562
  my $i;
2563
2564
  for ( $i = 0; $i < $self->{conf}->{per_msg_bayes_token_retries}; $i++ ) {
2565
    my $name = $ctime . '.' .$pid . '_' . $i . '.' . $hostname;
2566
    return ("$dir/$name")  if ( ! -e "$dir/$name" );
2567
  }
2568
2569
  return('');  #return undef if it hit the max.
2570
2571
}
2572
2510
###########################################################################
2573
###########################################################################
2511
2574
2512
1;
2575
1;
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin/StateDirHash.pm (+61 lines)
Line 0 Link Here
1
=head1 NAME
2
3
Mail::SpamAssassin::StateDirHash - determine StateDir Location
4
5
=head1 SYNOPSIS
6
7
=head1 DESCRIPTION
8
9
=head1 METHODS
10
11
=over 4
12
13
=cut
14
15
package Mail::SpamAssassin::StateDirHash;
16
17
use strict;
18
19
use Mail::SpamAssassin;
20
use Mail::SpamAssassin::Conf;
21
22
use vars qw{
23
  @ISA
24
};
25
26
@ISA = qw();
27
28
29
###########################################################################
30
31
sub new {
32
  my $class = shift;
33
  $class = ref($class) || $class;
34
  my ($main) = @_;
35
  my $self = {
36
    'main'              => $main,
37
    'conf'		=> $main->{conf},
38
  };
39
40
  bless ($self, $class);
41
42
  $self;
43
}
44
45
sub get_state_dir {
46
  my ($self, $user) = @_;
47
48
  my $state_dir = '';
49
  
50
  if ( $user =~ /^(.)(.)/ ) {
51
    $state_dir = $self->{conf}->{state_dir_hash_base} . "/$1/$2/$user/.spamassassin";
52
  }
53
54
  return ($state_dir);
55
}  
56
  
57
 
58
59
###########################################################################
60
61
1;
(-)Mail-SpamAssassin-2.60-dist/lib/Mail/SpamAssassin.pm (-2 / +14 lines)
Lines 58-63 Link Here
58
use 5.005;
58
use 5.005;
59
59
60
use Mail::SpamAssassin::Conf;
60
use Mail::SpamAssassin::Conf;
61
use Mail::SpamAssassin::StateDirHash;
61
use Mail::SpamAssassin::ConfSourceSQL;
62
use Mail::SpamAssassin::ConfSourceSQL;
62
use Mail::SpamAssassin::PerMsgStatus;
63
use Mail::SpamAssassin::PerMsgStatus;
63
use Mail::SpamAssassin::NoMailAudit;
64
use Mail::SpamAssassin::NoMailAudit;
Lines 1263-1273 Link Here
1263
1264
1264
  # user state directory
1265
  # user state directory
1265
  my $fname = $self->{userstate_dir};
1266
  my $fname = $self->{userstate_dir};
1267
1268
  # get statedir hash from module if the config says so
1269
  if ($self->{conf}->{use_state_dir_hash})
1270
  {
1271
    my $sdh = Mail::SpamAssassin::StateDirHash->new($self);
1272
    my $dir = $sdh->get_state_dir($self->{username});
1273
1274
    unshift(@default_userstate_dir, $dir);
1275
  }
1276
1266
  $fname ||= $self->first_existing_path (@default_userstate_dir);
1277
  $fname ||= $self->first_existing_path (@default_userstate_dir);
1267
1278
1268
  # If vpopmail is enabled then set fname to virtual homedir
1279
  # If vpopmail is enabled then set fname to virtual homedir
1269
  #
1280
  #
1270
  if (defined $self->{user_dir}) {
1281
  if (!$self->{conf}->{use_state_dir_hash} && defined $self->{user_dir}) {
1271
    $fname = File::Spec->catdir ($self->{user_dir}, ".spamassassin");
1282
    $fname = File::Spec->catdir ($self->{user_dir}, ".spamassassin");
1272
  }
1283
  }
1273
1284
Lines 1374-1380 Link Here
1374
  $path =~ s/__local_rules_dir__/$self->{LOCAL_RULES_DIR} || ''/ges;
1385
  $path =~ s/__local_rules_dir__/$self->{LOCAL_RULES_DIR} || ''/ges;
1375
  $path =~ s/__def_rules_dir__/$self->{DEF_RULES_DIR} || ''/ges;
1386
  $path =~ s/__def_rules_dir__/$self->{DEF_RULES_DIR} || ''/ges;
1376
  $path =~ s{__prefix__}{$self->{PREFIX} || $Config{prefix} || '/usr'}ges;
1387
  $path =~ s{__prefix__}{$self->{PREFIX} || $Config{prefix} || '/usr'}ges;
1377
  $path =~ s{__userstate__}{$self->get_and_create_userstate_dir()}ges;
1388
  $path =~ s/__userstate__/$self->get_and_create_userstate_dir()/ges;
1378
  $path =~ s/^\~([^\/]*)/$self->expand_name($1)/es;
1389
  $path =~ s/^\~([^\/]*)/$self->expand_name($1)/es;
1379
1390
1380
  return Mail::SpamAssassin::Util::untaint_file_path ($path);
1391
  return Mail::SpamAssassin::Util::untaint_file_path ($path);
Lines 1383-1388 Link Here
1383
sub first_existing_path {
1394
sub first_existing_path {
1384
  my $self = shift;
1395
  my $self = shift;
1385
  my $path;
1396
  my $path;
1397
1386
  foreach my $p (@_) {
1398
  foreach my $p (@_) {
1387
    $path = $self->sed_path ($p);
1399
    $path = $self->sed_path ($p);
1388
    if (defined $path && -e $path) { return $path; }
1400
    if (defined $path && -e $path) { return $path; }
(-)Mail-SpamAssassin-2.60-dist/rules/local.cf (+1 lines)
Lines 9-11 Link Here
9
# report_safe 1
9
# report_safe 1
10
# trusted_networks 212.17.35.
10
# trusted_networks 212.17.35.
11
11
12
state_dir_hash_base	/tmp
(-)Mail-SpamAssassin-2.60-dist/sa-btok-learn (+94 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use strict;
4
use bytes;
5
6
use Mail::SpamAssassin;
7
use Mail::SpamAssassin::Bayes;
8
use Mail::SpamAssassin::PerMsgLearner;
9
10
# create the tester factory
11
my $spamtest = new Mail::SpamAssassin ({
12
		rules_filename      => 0,
13
		userprefs_filename  => 0, # perhaps use later
14
		debug               => 0,
15
		local_tests_only    => 1,
16
		dont_copy_prefs     => 1,
17
		});
18
19
$spamtest->init (1);
20
21
$spamtest->init_learner({
22
		force_expire      => 0,
23
		learn_to_journal  => 0,
24
		wait_for_lock     => 1,
25
		caller_will_untie => 1
26
		});
27
28
# sync the journal first if we're going to go r/w so we make sure to
29
# learn everything before doing anything else.
30
#
31
$spamtest->rebuild_learner_caches();
32
33
my $processed = 0;
34
35
while (<>)
36
{
37
	my @a = split(/\s/, $_);
38
	&do($a[0], $a[1]);
39
	$processed++;
40
}
41
42
print "Learned from $processed messages.\n";
43
44
$spamtest->finish_learner();
45
exit(0);
46
47
sub do {
48
	my ($file, $isspam) = @_;
49
50
	# message ID is the last directory piece (the filename)
51
	my @id = split(/\//, $file);
52
	my $id = $id[scalar(@id)-1];
53
54
	my @toks;
55
56
	if (!open (F, $file))
57
	{
58
		warn "Couldn't open file $file for reading of tokens: $!";
59
	} else {
60
61
		# always ignore the first 6 lines.
62
		<F>;
63
		<F>;
64
		<F>;
65
		<F>;
66
		<F>;
67
		<F>;
68
69
		# copy out the tokens
70
		while (<F>)
71
		{
72
			chomp;
73
			push (@toks, $_);
74
		}
75
76
		close(F);
77
78
		eval {
79
			my $status = &learn_tokens(\@toks, $id, $isspam);
80
		};
81
82
		if ($@)
83
		{
84
			print "Couldn't learn tokens out of file $file: $@";
85
		}
86
	}
87
}
88
89
sub learn_tokens
90
{
91
	my ($toks, $id, $isspam) = @_;
92
93
	$spamtest->{bayes_scanner}->learn_tokens($toks, $id, $isspam);
94
}
(-)Mail-SpamAssassin-2.60-dist/sa-btok-learn.raw (+94 lines)
Line 0 Link Here
1
#!/usr/bin/perl -w
2
3
use strict;
4
use bytes;
5
6
use Mail::SpamAssassin;
7
use Mail::SpamAssassin::Bayes;
8
use Mail::SpamAssassin::PerMsgLearner;
9
10
# create the tester factory
11
my $spamtest = new Mail::SpamAssassin ({
12
		rules_filename      => 0,
13
		userprefs_filename  => 0, # perhaps use later
14
		debug               => 0,
15
		local_tests_only    => 1,
16
		dont_copy_prefs     => 1,
17
		});
18
19
$spamtest->init (1);
20
21
$spamtest->init_learner({
22
		force_expire      => 0,
23
		learn_to_journal  => 0,
24
		wait_for_lock     => 1,
25
		caller_will_untie => 1
26
		});
27
28
# sync the journal first if we're going to go r/w so we make sure to
29
# learn everything before doing anything else.
30
#
31
$spamtest->rebuild_learner_caches();
32
33
my $processed = 0;
34
35
while (<>)
36
{
37
	my @a = split(/\s/, $_);
38
	&do($a[0], $a[1]);
39
	$processed++;
40
}
41
42
print "Learned from $processed messages.\n";
43
44
$spamtest->finish_learner();
45
exit(0);
46
47
sub do {
48
	my ($file, $isspam) = @_;
49
50
	# message ID is the last directory piece (the filename)
51
	my @id = split(/\//, $file);
52
	my $id = $id[scalar(@id)-1];
53
54
	my @toks;
55
56
	if (!open (F, $file))
57
	{
58
		warn "Couldn't open file $file for reading of tokens: $!";
59
	} else {
60
61
		# always ignore the first 6 lines.
62
		<F>;
63
		<F>;
64
		<F>;
65
		<F>;
66
		<F>;
67
		<F>;
68
69
		# copy out the tokens
70
		while (<F>)
71
		{
72
			chomp;
73
			push (@toks, $_);
74
		}
75
76
		close(F);
77
78
		eval {
79
			my $status = &learn_tokens(\@toks, $id, $isspam);
80
		};
81
82
		if ($@)
83
		{
84
			print "Couldn't learn tokens out of file $file: $@";
85
		}
86
	}
87
}
88
89
sub learn_tokens
90
{
91
	my ($toks, $id, $isspam) = @_;
92
93
	$spamtest->{bayes_scanner}->learn_tokens($toks, $id, $isspam);
94
}
(-)Mail-SpamAssassin-2.60-dist/spamd/spamd.raw (+3 lines)
Lines 105-110 Link Here
105
  'vpopmail!'                   => \$opt{'vpopmail'},
105
  'vpopmail!'                   => \$opt{'vpopmail'},
106
    'v'                         => \$opt{'vpopmail'},
106
    'v'                         => \$opt{'vpopmail'},
107
  'configpath|C=s'              => \$opt{'configpath'},
107
  'configpath|C=s'              => \$opt{'configpath'},
108
  'use-statedir-hash'           => \$opt{'use_statedir_hash'},
109
    'U'                         => \$opt{'use_statedir_hash'},
108
  'user-config'                 => \$opt{'user-config'},
110
  'user-config'                 => \$opt{'user-config'},
109
    'nouser-config|x'           => sub{ $opt{'user-config'} = 0 },
111
    'nouser-config|x'           => sub{ $opt{'user-config'} = 0 },
110
  'allowed-ips|A=s'             => \@{$opt{'allowed-ip'}},
112
  'allowed-ips|A=s'             => \@{$opt{'allowed-ip'}},
Lines 222-227 Link Here
222
  rules_filename       => ($opt{'configpath'} || 0),
224
  rules_filename       => ($opt{'configpath'} || 0),
223
  local_tests_only     => ($opt{'local'} || 0),
225
  local_tests_only     => ($opt{'local'} || 0),
224
  debug                => ($opt{'debug'} || 0),
226
  debug                => ($opt{'debug'} || 0),
227
  use_statedir_hash    => ($opt{'use_statedir_hash'} || 0),
225
  paranoid             => ($opt{'paranoid'} || 0),
228
  paranoid             => ($opt{'paranoid'} || 0),
226
  home_dir_for_helpers => (defined $opt{'home_dir_for_helpers'} ? $opt{'home_dir_for_helpers'} : $orighome),
229
  home_dir_for_helpers => (defined $opt{'home_dir_for_helpers'} ? $opt{'home_dir_for_helpers'} : $orighome),
227
  PREFIX               => $PREFIX,
230
  PREFIX               => $PREFIX,

Return to bug 2167