-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
932 lines (817 loc) · 23.4 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
dnl Process this file with autoconf to produce a configure script.
AC_INIT([simscan], [1.4.1])
AC_CONFIG_SRCDIR([simscan.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
AC_CHECK_FUNCS([strsep])
dnl Checks for programs.
AC_PROG_CC
if test "$GCC"="yes"
then
CXXFLAGS="$CXXFLAGS -Wall"
CFLAGS="$CFLAGS -Wall"
fi
#----------------------------------------------------------------------
AC_ARG_ENABLE(user, [ --enable-user=<user> Change the user for simscan. Default: simscan.],
ENABLE_USER="$enableval",
[
ENABLE_USER="simscan"
])
AC_MSG_CHECKING(whether the $ENABLE_USER user exists)
AC_TRY_RUN( [
#include <pwd.h>
int main() {
struct passwd *pw;
if (( pw=getpwnam("$ENABLE_USER")) != 0 ) return 0;
else return 1;
return -1;
}
],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
AC_MSG_ERROR(could not find the $ENABLE_USER user. Please add the $ENABLE_USER user and try again.),
AC_MSG_RESULT(no)
AC_MSG_ERROR(could not find the $ENABLE_USER user. Please add the $ENABLE_USER user and try again.)
)
AC_SUBST(ENABLE_USER)
#----------------------------------------------------------------------
VIRUSSCANNER=0
DO_RIPMIME=0
AC_ARG_ENABLE(clamav, [ --enable-clamav=y|n Turn on clamav scanning. default yes.],
ENABLE_CLAMAV="$enableval",
[
ENABLE_CLAMAV=yes
] )
case $ENABLE_CLAMAV in
1*|y*|Y*)
ENABLE_CLAMAV=1
AC_DEFINE([ENABLE_CLAMAV], [], [enable clamav scanning])
#----------------------------------------------------------------------
AC_MSG_CHECKING(whether we can locate the clamdscan program)
clamdscan=""
for f in /usr/local/bin/clamdscan /usr/bin/clamdscan
do
if test -f $f
then
clamdscan=$f
break
fi
done
AC_ARG_ENABLE(clamdscan,
[ --enable-clamdscan=PATH Full path to clamdscan program.],
clamdscan="$enableval",
[
if test "$clamdscan" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your clamdscan program, specify --enable-clamdscan.])
fi
]
)
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(CLAMDSCAN,"$clamdscan","clamdscan program")
VIRUSSCANNER=1
;;
*)
ENABLE_CLAMAV=0
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(custom-smtp-reject, [ --enable-custom-smtp-reject=y|n Return smtp reject message with virus name.],
ENABLE_CUSTOM_SMTP_REJECT="$enableval",
[
ENABLE_CUSTOM_SMTP_REJECT=no
] )
case $ENABLE_CUSTOM_SMTP_REJECT in
1*|y*|Y*)
ENABLE_CUSTOM_SMTP_REJECT=1
AC_DEFINE([ENABLE_CUSTOM_SMTP_REJECT], [], [enable custom smtp reject message with virus name])
;;
*)
ENABLE_CUSTOM_SMTP_REJECT=0
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(per-domain, [ --enable-per-domain=y|n Turn on per domain based checking.],
ENABLE_PER_DOMAIN="$enableval",
[
ENABLE_PER_DOMAIN=no
] )
case $ENABLE_PER_DOMAIN in
1*|y*|Y*)
ENABLE_PER_DOMAIN=1
AC_DEFINE([ENABLE_PER_DOMAIN], [], [enable per domain checking])
;;
*)
ENABLE_PER_DOMAIN=0
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(attach, [ --enable-attach=y|n Turn on attachment scanning. default no.],
ENABLE_ATTACH="$enableval",
[
ENABLE_ATTACH=no
] )
case $ENABLE_ATTACH in
1*|y*|Y*)
ENABLE_ATTACH=1
DO_RIPMIME=1
AC_DEFINE_UNQUOTED([ENABLE_ATTACH], $ENABLE_ATTACH, [enable attachment scanning])
;;
*)
ENABLE_ATTACH=0
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(dropmsg, [ --enable-dropmsg=y|n Drop message in case of virus/spam found. Don't return error to sender.],
ENABLE_DROPMSG="$enableval",
[
ENABLE_DROPMSG=no
] )
case $ENABLE_DROPMSG in
1*|y*|Y*)
ENABLE_DROPMSG=1
AC_DEFINE([ENABLE_DROPMSG], [], [enable drop message])
;;
*)
ENABLE_DROPMSG=0
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(dspam, [ --enable-dspam=y|n Turn on dspam scanning. default no.],
ENABLE_DSPAM="$enableval",
[
ENABLE_DSPAM=no
] )
case $ENABLE_DSPAM in
1*|y*|Y*)
ENABLE_DSPAM=1
AC_DEFINE_UNQUOTED([ENABLE_DSPAM], $ENABLE_DSPAM, [enable dspam scanning])
;;
*)
ENABLE_DSPAM=0
;;
esac
case $ENABLE_DSPAM in
1*|y*|Y*)
AC_ARG_ENABLE(spam-passthru, [ --enable-spam-passthru=y|n Pass spam email thru or reject (default disable, reject).],
ENABLE_SPAM_PASSTHRU="$enableval",
[
ENABLE_SPAM_PASSTHRU=no
] )
case $ENABLE_SPAM_PASSTHRU in
1*|y*|Y*)
ENABLE_SPAM_PASSTHRU=1
AC_DEFINE([ENABLE_SPAM_PASSTHRU], [], [pass spam through to user])
;;
*)
ENABLE_SPAM_PASSTHRU=0
;;
esac
;;
esac
#----------------------------------------------------------------------
case $ENABLE_DSPAM in
1*|y*|Y*)
AC_MSG_CHECKING(whether we can locate the dspam program)
dspam=""
for f in /usr/bin/dspam /usr/local/bin/dspam
do
if test -f $f
then
dspam=$f
break
fi
done
AC_ARG_ENABLE(dspam-user, [ --enable-dspam-user=y|n Set user option to spamc.],
ENABLE_DSPAM_USER="$enableval",
[
ENABLE_DSPAM_USER=no
] )
case $ENABLE_DSPAM_USER in
1*|y*|Y*)
ENABLE_DSPAM_USER=1
AC_DEFINE([ENABLE_DSPAM_USER], [], [dspam --user user@domain option.])
;;
*)
ENABLE_DSPAM_USER=0
;;
esac
AC_ARG_ENABLE(dspam-path,
[ --enable-dspam-path=PATH Full path to spamc program.],
dspam="$enableval",
[
if test "$dspam" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your dspam program, specify --enable-dspam-path.])
fi
]
)
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(DSPAM,"$dspam","dspam program")
AC_ARG_ENABLE(dspam-args, [ --enable-dspam-args="args" Override the default dspam arguments.],
ENABLE_DSPAM_ARGS="$enableval",
[
ENABLE_DSPAM_ARGS=""
])
AC_DEFINE_UNQUOTED(DSPAM_ARGS,"$ENABLE_DSPAM_ARGS","dspam arguments")
;;
esac
#----------------------------------------------------------------------
AC_ARG_ENABLE(spam, [ --enable-spam=y|n Turn on spam scanning. default no.],
ENABLE_SPAM="$enableval",
[
ENABLE_SPAM=no
] )
case $ENABLE_SPAM in
1*|y*|Y*)
ENABLE_SPAM=1
AC_DEFINE_UNQUOTED([ENABLE_SPAM], $ENABLE_SPAM, [enable spam scanning])
;;
*)
ENABLE_SPAM=0
;;
esac
case $ENABLE_SPAM in
1*|y*|Y*)
AC_ARG_ENABLE(spam-passthru, [ --enable-spam-passthru=y|n Pass spam email thru or reject (default disable, reject).],
ENABLE_SPAM_PASSTHRU="$enableval",
[
ENABLE_SPAM_PASSTHRU=no
] )
case $ENABLE_SPAM_PASSTHRU in
1*|y*|Y*)
ENABLE_SPAM_PASSTHRU=1
AC_DEFINE([ENABLE_SPAM_PASSTHRU], [], [pass spam through to user])
;;
*)
ENABLE_SPAM_PASSTHRU=0
;;
esac
AC_ARG_ENABLE(spamc-user, [ --enable-spamc-user=y|n Set user option to spamc.],
ENABLE_SPAMC_USER="$enableval",
[
ENABLE_SPAMC_USER=no
] )
case $ENABLE_SPAMC_USER in
1*|y*|Y*)
ENABLE_SPAMC_USER=1
AC_DEFINE([ENABLE_SPAMC_USER], [], [spamc -u user@domain option.])
;;
*)
ENABLE_SPAMC_USER=0
;;
esac
AC_ARG_ENABLE(spam-auth-user, [ --enable-spam-auth-user=y|n Turn on spam scanning for authenticated users (default no).],
ENABLE_SPAM_AUTH_USER="$enableval",
[
ENABLE_SPAM_AUTH_USER=no
] )
case $ENABLE_SPAM_AUTH_USER in
1*|y*|Y*)
ENABLE_SPAM_AUTH_USER=1
AC_DEFINE([ENABLE_SPAM_AUTH_USER], [], [scan authenticated users for spam.])
;;
*)
ENABLE_SPAM_USER=0
;;
esac
spamhits=""
AC_ARG_ENABLE(spam-hits, [ --enable-spam-hits=number Reject spam above this hit level. default 10.0],
ENABLE_SPAM_HITS="$enableval",
[
ENABLE_SPAM_HITS="no"
] )
if test $ENABLE_SPAM_HITS = "yes"
then
ENABLE_SPAM_HITS="10.0"
fi
case $ENABLE_SPAM_HITS in
0*|n*|N*)
;;
*)
AC_DEFINE_UNQUOTED(SPAM_HITS,$ENABLE_SPAM_HITS,"spam hits")
spamhits=$ENABLE_SPAM_HITS
;;
esac
AC_MSG_CHECKING(whether we can locate the spamc program)
spamc=""
for f in /usr/bin/spamc /usr/local/bin/spamc
do
if test -f $f
then
spamc=$f
break
fi
done
AC_ARG_ENABLE(spamc,
[ --enable-spamc=PATH Full path to spamc program.],
spamc="$enableval",
[
if test "$spamc" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your spamc program, specify --enable-spamc.])
fi
]
)
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(SPAMC,"$spamc","spamc program")
AC_ARG_ENABLE(spamc-args, [ --enable-spamc-args="args" Override the default spamc arguments.],
ENABLE_SPAMC_ARGS="$enableval",
[
ENABLE_SPAMC_ARGS=""
])
AC_DEFINE_UNQUOTED(SPAMC_ARGS,"$ENABLE_SPAMC_ARGS","spamc arguments")
;;
esac
#----------------------------------------------------------------------
AC_MSG_CHECKING(whether we can locate the qmail directory)
qmaildir=""
for f in /var/qmail
do
if test -d $f
then
qmaildir=$f
fi
done
AC_ARG_ENABLE(qmaildir,
[ --enable-qmaildir=DIR Base qmail directory [/var/qmail].],
qmaildir="$enableval",
[
if test "$qmaildir" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your qmaildir directory, specify --enable-qmaildir.])
fi
]
)
AC_DEFINE_UNQUOTED(QMAILDIR,"$qmaildir","qmail directory")
AC_SUBST(qmaildir)
AC_MSG_RESULT(yes)
#----------------------------------------------------------------------
AC_MSG_CHECKING(setting the work directory)
workdir="$qmaildir/simscan"
AC_ARG_ENABLE(workdir,
[ --enable-workdir=DIR Directory to unpack emails [/var/qmail/simscan].],
workdir="$enableval",
[
if test "$workdir" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your workdir directory, specify --enable-workdir.])
fi
]
)
AC_DEFINE_UNQUOTED(WORKDIR,"$workdir","working directory")
AC_SUBST(workdir)
AC_MSG_RESULT(done)
#----------------------------------------------------------------------
AC_MSG_CHECKING(setting the control directory)
controldir="$qmaildir/control"
AC_ARG_ENABLE(controldir,
[ --enable-controldir=DIR Directory to place control files [/var/qmail/control].],
controldir="$enableval",
[
if test "$controldir" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your controldir directory, specify --enable-controldir.])
fi
]
)
AC_DEFINE_UNQUOTED(CONTROLDIR,"$controldir","working directory")
AC_SUBST(controldir)
AC_MSG_RESULT(done)
#----------------------------------------------------------------------
AC_ARG_ENABLE(quarantinedir,
[ --enable-quarantinedir=DIR Directory to keep spam and/or infected emails [/var/qmail/quarantine].],
ENABLE_QUARANTINE="$enableval",
[
ENABLE_QUARANTINE=no
])
case $ENABLE_QUARANTINE in
0*|n*|N*)
;;
*)
AC_MSG_CHECKING(setting the quarantine directory)
quarantinedir="$qmaildir/quarantine"
if test "$quarantinedir" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your quarantinedir directory, specify --enable-quarantinedir.])
fi
AC_DEFINE_UNQUOTED(QUARANTINEDIR,"$quarantinedir","quarantine directory")
AC_SUBST(quarantinedir)
AC_MSG_RESULT(done)
;;
esac
#----------------------------------------------------------------------
AC_MSG_CHECKING(whether we can locate the qmail-queue program)
qmailqueue=""
for f in "$qmaildir"/bin/qmail-queue /usr/sbin/qmail-queue
do
if test -f $f
then
qmailqueue=$f
break
fi
done
AC_ARG_ENABLE(qmail-queue,
[ --enable-qmail-queue=PATH Full path to qmail-queue program.],
qmailqueue="$enableval",
[
if test "$qmailqueue" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your qmail-queue file, specify --enable-qmail-queue.])
fi
]
)
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(QMAILQUEUE,"$qmailqueue","qmail-queue program")
#----------------------------------------------------------------------
ENABLE_TROPHIE=0
AC_ARG_ENABLE(trophie-socket,
[ --enable-trophie-socket=PATH Full path to the trophie socket.],
[
AC_MSG_CHECKING(whether if the trophie-socket path is set)
trophiesocket="$enableval"
# check for path to trophie
AC_ARG_ENABLE(trophie-path,
[ --enable-trophie-path=PATH Full path to the trophie binary.],
[
trophiebinary="$enableval"
AC_MSG_RESULT(yes)
ENABLE_TROPHIE=1
AC_DEFINE_UNQUOTED(TROPHIESOCKET,"$trophiesocket","path to trophie socket")
AC_DEFINE_UNQUOTED(TROPHIEBINARY,"$trophiebinary","path to trophie binary")
AC_DEFINE_UNQUOTED([ENABLE_TROPHIE], $ENABLE_TROPHIE, [enable trophie scanning])
DO_RIPMIME=1
VIRUSSCANNER=1
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your trophie binary, specify --enable-trophie-path.])
]
)
]
)
#----------------------------------------------------------------------
AC_ARG_ENABLE(ripmime,
[ --enable-ripmime=PATH Full path to ripmime program.],
ENABLE_RIPMIME="$enableval",
[
ENABLE_RIPMIME=no
])
case $ENABLE_RIPMIME in
0*|n*|N*)
;;
*)
DO_RIPMIME=1
;;
esac
if test $DO_RIPMIME -eq 1
then
AC_MSG_CHECKING(whether we can locate the ripmime program)
ripmime=""
for f in "$ENABLE_RIPMIME" /usr/local/bin/ripmime /usr/bin/ripmime
do
if test -f $f
then
ripmime=$f
break
fi
done
if test "$ripmime" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your ripmime program, specify --enable-ripmime.])
else
AC_MSG_RESULT(yes)
fi
AC_DEFINE_UNQUOTED(RIPMIME,"$ripmime","ripmime program")
fi
AC_DEFINE_UNQUOTED(DO_RIPMIME, $DO_RIPMIME, [run ripmime program])
#----------------------------------------------------------------------
AC_DEFINE_UNQUOTED(VIRUSSCANNER, $VIRUSSCANNER, [one or more virusscanners are active])
#----------------------------------------------------------------------
AC_ARG_ENABLE(received, [ --enable-received=y|n Add a Received: line to the message, showing the runned scanners and some stats],
ENABLE_RECEIVED="$enableval",
[
ENABLE_RECEIVED=no
] )
case $ENABLE_RECEIVED in
1*|y*|Y*)
#------------------------------------------------------------
if test $ENABLE_SPAM -eq 1; then
SA_PATH=""
AC_MSG_CHECKING(whether we can locate the spamassassin-path)
AC_ARG_ENABLE(spamassassin-path, [ --enable-spamassassin-path=PATH Path to the spamassassin binary],
[
SA_PATH="$enableval"
])
spamass=""
for f in $SA_PATH /usr/bin/spamassassin /usr/local/bin/spamassassin
do
if test -f $f
then
spamass=$f
break;
fi
done
if test "$spamass" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your spamassassin binary, specify --enable-spamassassin-path.])
else
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([SPAMASSASSINPATH], "$spamass", [Path to the spamassassin binary])
fi
fi
#------------------------------------------------------------
if test $ENABLE_CLAMAV -eq 1; then
CLAMAV_DB=""
AC_MSG_CHECKING(whether we can locate the clamav db path)
AC_ARG_ENABLE(clamavdb-path, [ --enable-clamavdb-path=PATH Directory where the clamav master.cvd and daily.cvd files are saved],
[
CLAMAV_DB="$enableval"
])
clamavdb=""
if test "$CLAMAV_DB" = ""
then
for f in "$CLAMAV_DB" /usr/local/share/clamav /var/lib/clamav
do
if test -f "$f/daily.cvd"
then
clamavdb=$f
break
elif test -f "$f/daily.inc/daily.info"
then
clamavdb=$f
break
fi
done
else
# don't test path when set on compile-time
clamavdb="$CLAMAV_DB"
fi
if test "$clamavdb" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your clamav databases, specify --enable-clamavdb-path.])
else
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([CLAMAVDBPATH], "$clamavdb", [Path to the clamav databases binary])
fi
#---------------
SIGTOOL_PATH=""
AC_MSG_CHECKING(whether we can locate the sigtool binary)
AC_ARG_ENABLE(sigtool-path, [ --enable-sigtool-path=PATH Path to the sigtool binary],
[
SIGTOOL_PATH="$enableval"
])
sigtoolp=""
for f in $SIGTOOL_PATH /usr/local/bin/sigtool /usr/bin/sigtool
do
if test -f $f
then
sigtoolp=$f
break
fi
done
if test "$sigtoolp" = ""
then
AC_MSG_RESULT(no)
AC_MSG_ERROR([Unable to find your sigtool binary, specify --enable-sigtool-path.])
else
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([SIGTOOLPATH], "$sigtoolp", [Path to the sigtool binary.])
fi
#------------------------------------------------------------
fi
ENABLE_RECEIVED=1
AC_DEFINE_UNQUOTED([ENABLE_RECEIVED], $ENABLE_RECEIVED, [enable received header])
AC_DEFINE([RCVD_REGEX_KEY], "regex", [key for regex scanner])
AC_DEFINE([RCVD_ATTACH_KEY], "attach", [key for attachment scanner])
AC_DEFINE([RCVD_SPAM_KEY], "spam", [key for spamassassin])
AC_DEFINE([RCVD_CLAM_KEY], "clamav", [key for clamav])
AC_DEFINE([RCVD_TROPHIE_KEY], "trophie", [key for clamav])
AC_DEFINE([RCVD_DSPAM_KEY], "dspam", [key for dspam])
;;
*)
ENABLE_RECEIVED=0
;;
esac
AC_ARG_WITH(pcre-include, [ --with-pcre-include=path path to the pcre includes directory],
[
CFLAGS="-I$withval"
],
[])
AC_ARG_WITH(pcre-lib, [ --with-pcre-lib=path path to the pcre library directory],
[
CFLAGS="-L$withval"
],
[])
AC_ARG_ENABLE(regex, [ --enable-regex=y|n enables regex scanner],
ENABLE_REGEX="$enableval",
[
ENABLE_REGEX=no
] )
case $ENABLE_REGEX in
1*|y*|Y*)
# check for library
AC_CHECK_HEADER(pcre.h, [
AC_CHECK_LIB(pcre,pcre_compile,[
AC_MSG_CHECKING(enable the regex scanner)
AC_MSG_RESULT(yes)
ENABLE_REGEX=1;
AC_DEFINE_UNQUOTED([ENABLE_REGEX], $ENABLE_REGEX, [enable regex scanner])
LIBS="$LIBS -lpcre"
], [
ENABLE_REGEX=0;
AC_MSG_ERROR([Unable to find the pcre library. Specify --with-pcre-lib=/path/to/libdir])
],)
],[
ENABLE_REGEX=0;
AC_MSG_ERROR([Unable to find the pcre header file. Specify --with-pcre-include=/path/to/include dir])
],)
;;
*)
ENABLE_REGEX=0;
AC_MSG_CHECKING(enable the regex scanner)
AC_MSG_RESULT(no)
;;
esac
#----------------------------------------------------------------------
AC_MSG_CHECKING(whether system has nproc ulimit)
case "$host" in
*-*-solaris*)
AC_MSG_RESULT(no)
;;
*)
AC_DEFINE_UNQUOTED(HAS_ULIMIT_NPROC,1,"system supports nproc ulimit")
AC_MSG_RESULT(yes)
;;
esac
#----------------------------------------------------------------------
AC_OUTPUT(Makefile)
echo ""
echo " Current settings"
echo "---------------------------------------"
echo " user = $ENABLE_USER"
echo " qmail directory = $qmaildir"
echo " work directory = $workdir"
echo " control directory = $controldir"
echo " qmail queue program = $qmailqueue"
case $ENABLE_CLAMAV in
1*|y*|Y*)
echo " clamdscan program = $clamdscan"
echo " clamav scan = ON"
;;
*)
echo " clamav scan = OFF"
;;
esac
case $ENABLE_TROPHIE in
1*|y*|Y*)
echo " trophie socket = $trophiesocket"
echo " trophie binary = $trophiebinary"
echo " trophie scanning = ON"
;;
*)
echo " trophie scanning = OFF"
;;
esac
case $ENABLE_ATTACH in
1*|y*|Y*)
echo " attachement scan = ON"
;;
*)
echo " attachement scan = OFF"
;;
esac
if test $DO_RIPMIME -eq 1
then
echo " ripmime program = $ripmime"
else
echo " ripmime program = OFF"
fi
case $ENABLE_CUSTOM_SMTP_REJECT in
1*|y*|Y*)
echo " custom smtp reject = ON"
;;
*)
echo " custom smtp reject = OFF"
;;
esac
case $ENABLE_DROPMSG in
1*|y*|Y*)
echo " drop message = ON"
;;
*)
echo " drop message = OFF"
;;
esac
case $ENABLE_REGEX in
1*|y*|Y*)
echo " regex scanner = ON"
;;
*)
echo " regex scanner = OFF"
;;
esac
case $ENABLE_QUARANTINE in
0*|n*|N*)
echo " quarantine processing = OFF"
;;
*)
echo " quarantine processing = ON"
echo " quarantine directory = $quarantinedir"
;;
esac
case $ENABLE_PER_DOMAIN in
1*|y*|Y*)
echo " domain based checking = ON"
;;
*)
echo " domain based checking = OFF"
;;
esac
case $ENABLE_RECEIVED in
1*|y*|Y*)
echo " add received header = ON"
;;
*)
echo " add received header = OFF"
;;
esac
case $ENABLE_SPAM in
1*|y*|Y*)
echo " spam scanning = ON"
echo " spamc program = $spamc"
echo " spamc arguments = $ENABLE_SPAMC_ARGS"
case $ENABLE_SPAMC_USER in
0*|n*|N*)
echo " spamc user = OFF"
;;
*)
echo " spamc user = ON"
;;
esac
case $ENABLE_SPAM_AUTH_USER in
0*|n*|N*)
echo "authenticated users scanned = OFF"
;;
*)
echo "authenticated users scanned = ON"
;;
esac
case $ENABLE_SPAM_PASSTHRU in
0*|n*|N*)
echo " spam passthru = OFF"
;;
*)
echo " spam passthru = ON"
;;
esac
case $ENABLE_SPAM_HITS in
0*|n*|N*)
;;
*)
echo " spam hits = $spamhits"
;;
esac
;;
*)
echo " spam scanning = OFF"
;;
esac
case $ENABLE_DSPAM in
1*|y*|Y*)
echo " dspam scanning = ON"
echo " dspam program = $dspam"
echo " dspam arguments = $ENABLE_DSPAM_ARGS"
case $ENABLE_SPAM_PASSTHRU in
0*|n*|N*)
echo " spam passthru = OFF"
;;
*)
echo " spam passthru = ON"
;;
esac
case $ENABLE_DSPAM_USER in
0*|n*|N*)
echo " dspam user = OFF"
;;
*)
echo " dspam user = ON"
;;
esac
;;
*)
echo " dspam scanning = OFF"
;;
esac
echo ""