1dnl Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.52])
4AC_INIT(vpopmail,5.4.33)
5PACKAGE=$PACKAGE_NAME
6VERSION=$PACKAGE_VERSION
7
8AM_CONFIG_HEADER(config.h)
9AM_INIT_AUTOMAKE()
10
11AC_CANONICAL_HOST
12
13#
14# Default CFLAGS
15#
16
17if test -z "$CFLAGS"
18then
19   AC_SUBST(CFLAGS, "")
20fi
21
22#
23# Default LDFLAGS
24#
25
26if test -z "$LDFLAGS"
27then
28   AC_SUBST(LDFLAGS, "")
29fi
30
31#----------------------------------------------------------------------
32
33dnl Checks for programs.
34AC_PROG_AWK
35AC_PROG_CC
36AC_PROG_INSTALL
37AC_PROG_RANLIB
38
39#AC_AIX
40AC_ISC_POSIX
41
42#----------------------------------------------------------------------
43
44AC_CHECK_LIB(crypt, crypt)
45#AC_CHECK_LIB(nsl, gethostbyaddr)
46#AC_CHECK_LIB(socket, getsockname)
47
48#----------------------------------------------------------------------
49
50dnl Checks for header files.
51AC_HEADER_DIRENT
52AC_HEADER_STDC
53AC_HEADER_SYS_WAIT
54AC_CHECK_HEADERS([inttypes.h arpa/inet.h endian.h byteswap.h fcntl.h memory.h sys/endian.h machine/endian.h netinet/in.h shadow.h stdlib.h string.h sys/file.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h utime.h crypt.h err.h])
55
56#----------------------------------------------------------------------
57
58# Checks for typedefs, structures, and compiler characteristics.
59AC_C_CONST
60AC_TYPE_UID_T
61AC_C_INLINE
62AC_TYPE_MODE_T
63AC_TYPE_OFF_T
64AC_TYPE_PID_T
65AC_TYPE_SIZE_T
66# AC_CHECK_MEMBERS([struct stat.st_blksize])
67AC_STRUCT_TM
68
69#----------------------------------------------------------------------
70
71# Checks for library functions.
72#AC_FUNC_CHOWN
73AC_FUNC_CLOSEDIR_VOID
74#AC_FUNC_FORK
75#AC_FUNC_LSTAT
76#AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
77#AC_FUNC_MALLOC
78#AC_FUNC_REALLOC
79AC_TYPE_SIGNAL
80#AC_FUNC_STAT
81AC_FUNC_UTIME_NULL
82AC_CHECK_FUNCS([htonll ntohll bzero dup2 fdatasync getcwd gethostname getpass getspnam memset mkdir putenv rmdir socket strchr strdup strerror strncasecmp strrchr strspn strstr utime warn])
83AC_MSG_CHECKING(for bswap64)
84AC_TRY_LINK([
85        #ifdef HAVE_SYS_ENDIAN_H
86                #include <sys/endian.h>
87        #endif
88        #ifdef HAVE_MACHINE_ENDIAN_H
89                #include <machine/endian.h>
90        #endif
91        ],[ bswap64(0); ],
92[
93        AC_MSG_RESULT(yes)
94        AC_DEFINE(HAVE_BSWAP64,1,[bswap64 defined])
95],
96[
97        AC_MSG_RESULT(no)
98])
99
100#----------------------------------------------------------------------
101
102AC_MSG_CHECKING(vpopmail configure options)
103AC_MSG_RESULT(ok)
104
105#----------------------------------------------------------------------
106
107case "$host" in
108  *-*-sunos4.1.1*)
109    idcommand="/usr/xpg4/bin/id -u"
110    ;;
111  *-*-solaris2.8*)
112    idcommand="/usr/xpg4/bin/id -u"
113    ;;
114  *-*-solaris*)
115    idcommand="/usr/xpg4/bin/id -u"
116    ;;
117  *)
118    idcommand="id -u"
119    ;;
120esac
121
122#----------------------------------------------------------------------
123
124AC_ARG_ENABLE(non-root-build,
125    [  --enable-non-root-build    Build vpopmail as a non-root user, only if you know what you are doing. see README.non-root],
126    idtest='false', idtest='true')
127
128#----------------------------------------------------------------------
129
130if $idtest && test `$idcommand` != "0"
131then
132  AC_MSG_WARN(=== vpopmail must be configured as root. ===)
133  AC_MSG_WARN(=== please switch to the root user and  ===)
134  AC_MSG_WARN(=== run ./configure. Thanks ===)
135  AC_MSG_ERROR(aborted.)
136fi
137
138#----------------------------------------------------------------------
139
140case "$host" in
141  *-*-sunos4.1.1*)
142        PS_COMMAND="ps -aux"
143    ;;
144  *-*-solaris*)
145        PS_COMMAND="ps -ef"
146    ;;
147  *-*-sunos*)
148        PS_COMMAND="ps -ef"
149    ;;
150  *-sgi-5*)
151        PS_COMMAND="ps -ef"
152    ;;
153  *-ibm-aix*)
154        PS_COMMAND="ps -ef"
155    ;;
156  mips-dec-mach3*)
157        PS_COMMAND="ps -ef"
158    ;;
159  *-dec-ultrix*)
160        PS_COMMAND="ps -ef"
161    ;;
162  *-*-hpux*)
163        PS_COMMAND="ps -eaf"
164    ;;
165  alpha-dec-osf*)
166        PS_COMMAND="ps -ef"
167    ;;
168  *-*-nextstep*)
169        PS_COMMAND="ps -ef"
170    ;;
171  i*86-*-bsdi*)
172        PS_COMMAND="ps axww"
173    ;;
174  i*86-unknown-bsd*)
175        PS_COMMAND="ps -ef"
176    ;;
177  m68k-sony-newsos*)
178        PS_COMMAND="ps -ef"
179    ;;
180  mips-sony-bsd*)
181        PS_COMMAND="ps -ef"
182    ;;
183  m68k-apple-aux*)
184        PS_COMMAND="ps -ef"
185    ;;
186  m88k-dg-dgux*)
187        PS_COMMAND="ps -ef"
188    ;;
189  t3e-*-*)
190        PS_COMMAND="ps -ef"
191    ;;
192  *-cray-unicos*)
193        PS_COMMAND="ps -ef"
194    ;;
195  *-*-sysv4*)
196        PS_COMMAND="ps -ef"
197    ;;
198  *-*-machten*)
199        PS_COMMAND="ps -ef"
200    ;;
201  i*86-unknown-sco*)
202        PS_COMMAND="ps -ef"
203    ;;
204  *-convex-bsd*)
205        PS_COMMAND="ps -ef"
206    ;;
207  *-sequent-ptx*)
208        PS_COMMAND="ps -ef"
209    ;;
210  *-sequent-dynix*|*-sequent-ptx*)
211        PS_COMMAND="ps -ef"
212    ;;
213  *-*-freebsd*)
214        PS_COMMAND="ps aux"
215    ;;
216  *-*-netbsd*)
217        PS_COMMAND="ps aux"
218    ;;
219  *-*-openbsd*)
220        PS_COMMAND="ps -aux"
221    ;;
222  *-*-IRIX*)
223        PS_COMMAND="ps -ef"
224    ;;
225  *)
226        PS_COMMAND="ps axww"
227    ;;
228esac
229AC_DEFINE_UNQUOTED(PS_COMMAND,"$PS_COMMAND","")
230
231#----------------------------------------------------------------------
232
233AC_MSG_CHECKING(if we're building on Solaris)
234
235case "$host" in
236  *-*-solaris*)
237    extralibflags="-lm -lnsl -lsocket"
238        AC_MSG_RESULT(yes)
239
240        #
241        # Check for Solaris libraries
242        #
243
244        AC_CHECK_LIB(m, sqrt)
245        AC_CHECK_LIB(nsl, gethostbyname)
246        AC_CHECK_LIB(socket, connect)
247    ;;
248  *)
249    AC_MSG_RESULT(no)
250    extralibflags=""
251    ;;
252esac
253
254#----------------------------------------------------------------------
255
256AC_MSG_CHECKING(whether we can locate the qmail directory)
257qmaildir=""
258for f in /var/qmail
259do
260    if test -d $f
261    then
262        qmaildir=$f
263    fi
264done
265
266AC_ARG_ENABLE(qmaildir,
267    [  --enable-qmaildir=DIR      Directory where qmail control and user directories are installed [/var/qmail].],
268    qmaildir="$enableval",
269    [
270        if test "$qmaildir" = ""
271        then
272            AC_MSG_RESULT(no)
273            AC_MSG_ERROR([Unable to find your qmaildir directory, specify --enable-qmaildir.])
274        fi
275    ]
276)
277
278AC_MSG_RESULT(yes)
279AC_DEFINE_UNQUOTED(QMAILDIR,"$qmaildir","")
280
281#----------------------------------------------------------------------
282
283AC_MSG_CHECKING(whether we can locate the qmail-newu program)
284qmailnewu=""
285for f in "$qmaildir"/bin/qmail-newu /usr/sbin/qmail-newu
286do
287    if test -f $f
288    then
289        qmailnewu=$f
290        break
291    fi
292done
293
294AC_ARG_ENABLE(qmail-newu,
295    [  --enable-qmail-newu=PATH   Full path to qmail-newu program.],
296    qmailnewu="$enableval",
297    [
298        if test "$qmailnewu" = ""
299        then
300            AC_MSG_RESULT(no)
301            AC_MSG_ERROR([Unable to find your qmail-newu file, specify --enable-qmail-newu.])
302        fi
303    ]
304)
305
306if test ! -f "$qmailnewu"
307then
308    AC_MSG_RESULT(no)
309    AC_MSG_ERROR([Unable to find your qmail-newu file, specify --enable-qmail-newu=/full/path/to/qmail-newu])
310fi
311
312AC_MSG_RESULT(yes)
313AC_DEFINE_UNQUOTED(QMAILNEWU,"$qmailnewu","")
314
315#----------------------------------------------------------------------
316
317AC_MSG_CHECKING(whether we can locate the qmail-inject program)
318qmailinject=""
319for f in "$qmaildir"/bin/qmail-inject /usr/sbin/qmail-inject /usr/bin/qmail-inject
320do
321    if test -f $f
322    then
323        qmailinject=$f
324        break
325    fi
326done
327
328AC_ARG_ENABLE(qmail-inject,
329    [  --enable-qmail-inject=PATH Full path to qmail-inject program.],
330    qmailinject="$enableval",
331    [
332        if test "$qmailinject" = ""
333        then
334            AC_MSG_RESULT(no)
335            AC_MSG_ERROR([Unable to find your qmailinject file, specify --enable-qmail-inject.])
336        fi
337    ]
338)
339
340if test ! -f "$qmailinject"
341then
342    AC_MSG_RESULT(no)
343    AC_MSG_ERROR([Unable to find your qmail-inject file, specify --enable-qmail-inject=/full/path/to/qmail-inject])
344fi
345
346AC_MSG_RESULT(yes)
347AC_DEFINE_UNQUOTED(QMAILINJECT,"$qmailinject","")
348
349#----------------------------------------------------------------------
350
351AC_MSG_CHECKING(whether we can locate the qmail-newmrh program)
352qmailnewmrh=""
353for f in "$qmaildir"/bin/qmail-newmrh /usr/sbin/qmail-newmrh
354do
355    if test -f $f
356    then
357        qmailnewmrh=$f
358        break
359    fi
360done
361
362AC_ARG_ENABLE(qmail-newmrh,
363    [  --enable-qmail-newmrh=PATH Full path to qmail-newmrh program.],
364    qmailnewmrh="$enableval",
365    [
366        if test "$qmailnewmrh" = ""
367        then
368            AC_MSG_RESULT(no)
369            AC_MSG_ERROR([Unable to find your qmail-newmrh file, specify --enable-qmail-newmrh.])
370        fi
371    ]
372)
373
374if test ! -f "$qmailnewmrh"
375then
376    AC_MSG_RESULT(no)
377    AC_MSG_ERROR([Unable to find your qmail-newmrh file, specify --enable-qmail-qmail-newmrh=/full/path/to/qmail-newmrh])
378fi
379
380AC_MSG_RESULT(yes)
381AC_DEFINE_UNQUOTED(QMAILNEWMRH,"$qmailnewmrh","")
382
383#----------------------------------------------------------------------
384
385AC_MSG_CHECKING(for valid vpopmail user and group)
386
387vpopuser="vpopmail"
388AC_ARG_ENABLE(vpopuser,
389    [  --enable-vpopuser=USER     User name allocated to vpopmail [vpopmail].],
390    vpopuser="$enableval",
391    [
392        if test "$vpopuser" = ""
393        then
394            AC_MSG_ERROR([Unable to find your vpopmail user, specify --enable-vpopuser.])
395        fi
396    ]
397)
398
399AC_DEFINE_UNQUOTED(VPOPUSER,"$vpopuser","")
400AC_SUBST(vpopuser)
401
402echo $vpopuser > vpopusername
403
404vpopgroup="vchkpw"
405AC_ARG_ENABLE(vpopgroup,
406    [  --enable-vpopgroup=GROUP   Group name allocated to vpopmail [vchkpw].],
407    vpopgroup="$enableval",
408    [
409        if test "$vpopgroup" = ""
410        then
411            AC_MSG_ERROR([Unable to find your vpopmail group, specify --enable-vpopgroup.])
412        fi
413    ]
414)
415
416AC_DEFINE_UNQUOTED(VPOPGROUP,"$vpopgroup","")
417AC_SUBST(vpopgroup)
418
419AC_MSG_RESULT(yes)
420
421AC_MSG_CHECKING(whether password file entry for the vpopmail user exists)
422AC_TRY_RUN( [
423  #include <stdio.h>
424  #include <pwd.h>
425  #include <stdlib.h>
426
427  int main() {
428    struct passwd *pw;
429    char tmpbuf[100];
430    FILE *f;
431
432        unlink("vpopmail.dir");
433        unlink("vpopmail.uid");
434        unlink("vpopmail.gid");
435
436        if ( (f=fopen("vpopusername","r+"))==NULL) {
437                printf("No vpopmail user found.\n");
438                printf("Please add the vchkpw group and\n");
439                printf("vpopmail user. Then run configure again\n");
440                return(-1);
441        }
442
443        fgets(tmpbuf,100,f);
444        fclose(f);
445        tmpbuf[strlen(tmpbuf)-1] = 0;
446
447        if (( pw=getpwnam(tmpbuf)) != 0 ) {
448                f=fopen("vpopmail.dir","a+");
449                fprintf(f,"%s\n", pw->pw_dir);
450                fclose(f);
451
452                f=fopen("vpopmail.uid", "a+");
453                fprintf(f,"%d\n", pw->pw_uid);
454                fclose(f);
455
456                f=fopen("vpopmail.gid", "a+");
457                fprintf(f,"%d\n", pw->pw_gid);
458                fclose(f);
459        } else {
460                printf("No vpopmail user found.\n");
461                printf("Please add the vchkpw group and\n");
462                printf("vpopmail user. Then run configure again\n");
463                return(-1);
464        }
465        return(0);
466  }
467  ],
468    AC_MSG_RESULT(yes),
469    AC_MSG_RESULT(no)
470    AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.),
471    AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.)
472)
473
474if test ! -f vpopmail.uid
475then
476        AC_MSG_ERROR(No vpopmail user.)
477fi
478
479if test ! -f vpopmail.gid
480then
481        AC_MSG_ERROR(No vpopmail group.)
482fi
483
484if test ! -f vpopmail.dir
485then
486        AC_MSG_ERROR(No vpopmail home directory)
487fi
488
489vpopmaildir=`cat vpopmail.dir`
490AC_SUBST(vpopmaildir)
491AC_DEFINE_UNQUOTED(VPOPMAILDIR,"$vpopmaildir","")
492rm -f vpopmail.dir
493
494vpopmailuid=`cat vpopmail.uid`
495AC_DEFINE_UNQUOTED(VPOPMAILUID,$vpopmailuid,"")
496rm -f vpopmail.uid
497
498vpopmailgid=`cat vpopmail.gid`
499AC_DEFINE_UNQUOTED(VPOPMAILGID,$vpopmailgid,"")
500rm -f vpopmail.gid
501rm -f vpopusername
502
503#----------------------------------------------------------------------
504
505if test ! -d $vpopmaildir/etc
506then
507  if test ! -d $vpopmaildir
508  then
509    AC_MSG_WARN( creating $vpopmaildir )
510    mkdir -p $vpopmaildir
511    chown $vpopmailuid $vpopmaildir
512    chgrp $vpopmailgid $vpopmaildir
513    chmod 755 $vpopmaildir
514  fi
515  AC_MSG_WARN( making a vpopmail etc directory )
516  mkdir $vpopmaildir/etc
517  chown $vpopmailuid "$vpopmaildir"/etc
518  chgrp $vpopmailgid "$vpopmaildir"/etc
519  chmod 755 "$vpopmaildir"/etc
520fi
521
522#----------------------------------------------------------------------
523
524AC_MSG_CHECKING(whether roaming-users has been enabled)
525AC_ARG_ENABLE(roaming-users,
526    [  --enable-roaming-users     Enable POP-before-SMTP functionality.],
527    POPRELAY=$enableval,
528        [
529            POPRELAY=no
530        ]
531)
532
533case $POPRELAY in
534  1*|y*|Y*)
535    AC_MSG_RESULT(yes)
536    POPRELAY=1
537    AC_DEFINE_UNQUOTED(POP_AUTH_OPEN_RELAY,$POPRELAY,"")
538
539    AC_MSG_CHECKING(whether we can locate the tcprules program)
540    for f in /usr/local/bin/tcprules /usr/bin/tcprules
541    do
542        if test -f $f
543        then
544            tcprules_prog=$f
545            break
546        fi
547    done
548
549    AC_ARG_ENABLE(tcprules-prog,
550        [  --enable-tcprules-prog=PATH    Full path to tcprules program [/usr/{local/}bin/tcprules].],
551        tcprules_prog="$enableval",
552        [
553            if test "$tcprules_prog" = ""
554            then
555                AC_MSG_RESULT(no)
556                AC_MSG_ERROR([Unable to find your tcprules prog, specify --enable-tcprules-prog.])
557            fi
558        ]
559    )
560
561    if test ! -f "$tcprules_prog"
562    then
563        AC_MSG_RESULT(no)
564        AC_MSG_ERROR([Unable to find your tcprulesfile, specify --enable-tcprules-prog=/full/path/to/tcprules])
565    fi
566
567    AC_MSG_RESULT(yes)
568    AC_DEFINE_UNQUOTED(TCPRULES_PROG,"$tcprules_prog","")
569
570
571    AC_MSG_CHECKING(whether we can locate the tcp.smtp file)
572    tcpserver_file=""
573    for f in "$vpopmaildir"/etc/tcp.smtp /etc/tcp.smtp /etc/tcprules.d/qmail-smtpd
574    do
575        if test -f $f
576        then
577            tcpserver_file=$f
578            break
579        fi
580    done
581
582    AC_ARG_ENABLE(tcpserver_file,
583        [  --enable-tcpserver-file=PATH   File where tcpserver -x relay information is stored [/home/vpopmail/etc/tcp.smtp].],
584        tcpserver_file="$enableval",
585        [
586            if test "$tcpserver_file" = ""
587            then
588                AC_MSG_WARN([Unable to find your tcpserver relay file.])
589                AC_MSG_WARN([Creating tcp.smtp in "$vpopmaildir"/etc/tcp.smtp.])
590
591                echo "127.:allow,RELAYCLIENT=\"\"" > "$vpopmaildir"/etc/tcp.smtp
592                tcpserver_file="$vpopmaildir"/etc/tcp.smtp
593            fi
594        ]
595    )
596
597    if test ! -f "$tcpserver_file"
598    then
599        AC_MSG_ERROR([Unable to find your tcp.smtp file, specify --enable-tcpserver-path=/full/path/to/tcp.smtp])
600    fi
601
602    AC_MSG_RESULT(yes)
603    AC_DEFINE_UNQUOTED(TCP_FILE,"$tcpserver_file","")
604
605
606    AC_MSG_CHECKING(whether rebuild-tcpserver-file is been enabled)
607    AC_ARG_ENABLE(rebuild-tcpserver-file,
608        [  --disable-rebuild-tcpserver-file  Disable rebuilding of tcpserver relay control file.],
609        REBUILD_TCPSERVER=$enableval,
610                [
611                        REBUILD_TCPSERVER=y
612                ]
613    )
614
615    case $REBUILD_TCPSERVER in
616      1*|y*|Y*)
617        AC_MSG_RESULT(yes)
618        REBUILD_TCPSERVER=1
619        AC_DEFINE_UNQUOTED(REBUILD_TCPSERVER,$REBUILD_TCPSERVER,"")
620        ;;
621      *)
622        AC_MSG_RESULT(no)
623        ;;
624    esac
625
626
627    relay_clear_minutes="180"
628    AC_ARG_ENABLE(relay-clear-minutes,
629        [  --enable-relay-clear-minutes=#    Expire time for roaming users after pop authentication [180].],
630        relay_clear_minutes="$enableval",
631    )
632
633    AC_DEFINE_UNQUOTED(RELAY_CLEAR_MINUTES,$relay_clear_minutes,"")
634
635
636    open_smtp_cur="$vpopmaildir/etc/open-smtp"
637    open_smtp_tmp="$vpopmaildir/etc/open-smtp.tmp"
638    open_smtp_lok="$vpopmaildir/etc/open-smtp.lock"
639    AC_DEFINE_UNQUOTED(OPEN_SMTP_CUR_FILE,"$open_smtp_cur","")
640    AC_DEFINE_UNQUOTED(OPEN_SMTP_TMP_FILE,"$open_smtp_tmp","")
641    AC_DEFINE_UNQUOTED(OPEN_SMTP_LOK_FILE,"$open_smtp_lok","")
642    ;;
643  *)
644    AC_MSG_RESULT(no)
645    ;;
646esac
647
648#----------------------------------------------------------------------
649
650AC_MSG_CHECKING(whether learn-passwords is enabled)
651AC_ARG_ENABLE(learn-passwords,
652        [  --enable-learn-passwords   If no password is stored for a user, learn it the first time they authenticate.],
653        ENABLE_LEARN_PASSWORDS=$enableval,
654                [
655                        ENABLE_LEARN_PASSWORDS=n
656                ]
657)
658
659case $ENABLE_LEARN_PASSWORDS in
660  1*|y*|Y*)
661      AC_MSG_RESULT(yes)
662      ENABLE_LEARN_PASSWORDS=1
663      AC_DEFINE_UNQUOTED(ENABLE_LEARN_PASSWORDS,$ENABLE_LEARN_PASSWORDS,"")
664      ;;
665  *)
666      AC_MSG_RESULT(no)
667      ;;
668esac
669
670#----------------------------------------------------------------------
671
672AC_MSG_CHECKING(whether md5-passwords is enabled)
673AC_ARG_ENABLE(md5-passwords,
674        [  --disable-md5-passwords    Use DES crypt() instead of MD5 encryption for passwords.],
675        ENABLE_MD5_PASSWORDS=$enableval,
676                [
677                        ENABLE_MD5_PASSWORDS=y
678                ]
679)
680
681case $ENABLE_MD5_PASSWORDS in
682  1*|y*|Y*)
683      AC_MSG_RESULT(yes)
684      ENABLE_MD5_PASSWORDS=1
685      AC_DEFINE_UNQUOTED(MD5_PASSWORDS,$ENABLE_MD5_PASSWORDS,"")
686      ;;
687  *)
688      AC_MSG_RESULT(no)
689      ;;
690esac
691
692#----------------------------------------------------------------------
693
694AC_MSG_CHECKING(whether file-locking is enabled)
695AC_ARG_ENABLE(file-locking,
696        [  --disable-file-locking     Don't use file locking.],
697        FILE_LOCKING=$enableval,
698                [
699                        FILE_LOCKING=y
700                ]
701)
702
703case $FILE_LOCKING in
704  1*|y*|Y*)
705      AC_MSG_RESULT(yes)
706      FILE_LOCKING=1
707      AC_DEFINE_UNQUOTED(FILE_LOCKING,$FILE_LOCKING,"")
708      ;;
709  *)
710      AC_MSG_RESULT(no)
711      ;;
712esac
713
714#----------------------------------------------------------------------
715
716AC_MSG_CHECKING(whether file-sync is enabled)
717AC_ARG_ENABLE(file-sync,
718        [  --enable-file-sync         Enable file sync after each message is delivered.],
719        FILE_SYNC=$enableval,
720                [
721                        FILE_SYNC=n
722                ]
723)
724
725case $FILE_SYNC in
726  1*|y*|Y*)
727      AC_MSG_RESULT(yes)
728      FILE_SYNC=1
729      AC_DEFINE_UNQUOTED(FILE_SYNC,$FILE_SYNC,"")
730      ;;
731  *)
732      AC_MSG_RESULT(no)
733      ;;
734esac
735
736#----------------------------------------------------------------------
737
738AC_MSG_CHECKING(whether make-seekable is enabled)
739AC_ARG_ENABLE(make-seekable,
740        [  --disable-make-seekable    Don't try to make input to vdelivermail seekable.],
741        MAKE_SEEKABLE=$enableval,
742                [
743                        MAKE_SEEKABLE=y
744                ]
745)
746
747case $MAKE_SEEKABLE in
748  1*|y*|Y*)
749      AC_MSG_RESULT(yes)
750      MAKE_SEEKABLE=1
751      AC_DEFINE_UNQUOTED(MAKE_SEEKABLE,$MAKE_SEEKABLE,"")
752      ;;
753  *)
754      AC_MSG_RESULT(no)
755      ;;
756esac
757
758#----------------------------------------------------------------------
759
760AC_MSG_CHECKING(whether clear-passwd is enabled)
761AC_ARG_ENABLE(clear-passwd,
762        [  --disable-clear-passwd     Don't store a cleartext version of the password in addition to the encrypted version.],
763        CLEAR_PASS=$enableval,
764                [
765                        CLEAR_PASS=y
766                ]
767)
768
769case $CLEAR_PASS in
770  1*|y*|Y*)
771      AC_MSG_RESULT(yes)
772      CLEAR_PASS=1
773      AC_DEFINE_UNQUOTED(CLEAR_PASS,$CLEAR_PASS,"")
774      ;;
775  *)
776      AC_MSG_RESULT(no)
777      ;;
778esac
779
780#----------------------------------------------------------------------
781
782AC_MSG_CHECKING(whether user-big-dir is enabled)
783AC_ARG_ENABLE(users-big-dir,
784        [  --disable-users-big-dir    Disable hashing of user directories.],
785        USERS_BIG_DIR=$enableval,
786                [
787                        USERS_BIG_DIR=y
788                ]
789)
790
791case $USERS_BIG_DIR in
792  1*|y*|Y*)
793      AC_MSG_RESULT(yes)
794      USERS_BIG_DIR=1
795      AC_DEFINE_UNQUOTED(USERS_BIG_DIR,$USERS_BIG_DIR,"")
796      ;;
797  *)
798      AC_MSG_RESULT(no)
799      ;;
800esac
801
802#----------------------------------------------------------------------
803
804AC_MSG_CHECKING(whether sqwebmail-pass is enabled)
805AC_ARG_ENABLE(sqwebmail-pass,
806        [  --enable-sqwebmail-pass    Store a copy of the user's password in the the user's maildir for use by pre-v3 sqwebmail.],
807        ENABLE_SQWEBMAIL_PASS=$enableval,
808                [
809                        ENABLE_SQWEBMAIL_PASS=n
810                ]
811)
812
813case $ENABLE_SQWEBMAIL_PASS in
814  1*|y*|Y*)
815          AC_MSG_RESULT(yes)
816          ENABLE_SQWEBMAIL_PASS=1
817          AC_DEFINE_UNQUOTED(SQWEBMAIL_PASS,$ENABLE_SQWEBMAIL_PASS,"")
818          ;;
819  *)
820          AC_MSG_RESULT(no)
821          ;;
822esac
823
824#----------------------------------------------------------------------
825
826AC_MSG_CHECKING(whether qmail-ext is enabled)
827AC_ARG_ENABLE(qmail-ext,
828        [  --enable-qmail-ext         Enable qmail email address extension support.],
829        QMAIL_EXT=$enableval,
830                [
831                        QMAIL_EXT=n
832                ]
833)
834
835case $QMAIL_EXT in
836  1*|y*|Y*)
837        AC_MSG_RESULT(yes)
838        QMAIL_EXT=1
839        AC_DEFINE_UNQUOTED(QMAIL_EXT,$QMAIL_EXT,"")
840        ;;
841  *)
842        AC_MSG_RESULT(no)
843        ;;
844esac
845
846#----------------------------------------------------------------------
847
848AC_MSG_CHECKING(whether ip-alias-domains is enabled)
849AC_ARG_ENABLE(ip-alias-domains,
850        [  --enable-ip-alias-domains  Enable mapping of default domain via reverse ip lookup table.],
851        IPALIAS=$enableval,
852                [
853                        IPALIAS=no
854                ]
855)
856
857case $IPALIAS in
858  1*|y*|Y*)
859        AC_MSG_RESULT(yes)
860        IPALIAS=1
861        AC_DEFINE_UNQUOTED(IP_ALIAS_DOMAINS,$IPALIAS,"")
862        ;;
863  *)
864        AC_MSG_RESULT(no)
865        ;;
866esac
867
868#----------------------------------------------------------------------
869
870AC_MSG_CHECKING(whether onchange script is enabled)
871AC_ARG_ENABLE(onchange-script,
872        [  --enable-onchange-script   Enable onchange script. See README.onchange for more info.],
873        ENABLE_ONCHANGE_SCRIPT=$enableval,
874                [
875                        ENABLE_ONCHANGE_SCRIPT=0
876                ]
877)
878
879case $ENABLE_ONCHANGE_SCRIPT in
880  1*|y*|Y*)
881      AC_MSG_RESULT(yes)
882      ENABLE_ONCHANGE_SCRIPT=1
883      AC_DEFINE_UNQUOTED(ONCHANGE_SCRIPT,$ENABLE_ONCHANGE_SCRIPT,"")
884      ;;
885  *)
886      AC_MSG_RESULT(no)
887      ;;
888esac
889
890#----------------------------------------------------------------------
891
892
893#----------------------------------------------------------------------
894
895AC_MSG_CHECKING(whether spamassassin is enabled)
896AC_ARG_ENABLE(spamassassin,
897        [  --enable-spamassassin      Enable spamassassin. See  README.spamassassin for more info.],
898        ENABLE_SPAMASSASSIN=$enableval,
899                [
900                        ENABLE_SPAMASSASSIN=0
901                ]
902)
903
904case $ENABLE_SPAMASSASSIN in
905  0*|n*|N*)
906      AC_MSG_RESULT(no)
907      ;;
908  *)
909      AC_MSG_RESULT(yes)
910      ENABLE_SPAMASSASSIN=1
911      AC_DEFINE_UNQUOTED(SPAMASSASSIN,$ENABLE_SPAMASSASSIN,"")
912
913    AC_MSG_CHECKING(whether we can locate the spamc program)
914    for f in /usr/bin/spamc /usr/local/bin/spamc
915    do
916        if test -f $f
917        then
918            spamc_prog=$f
919            break
920        fi
921    done
922    AC_ARG_ENABLE(spamc-prog,
923        [  --enable-spamc-prog=PATH   Full path to spamc program [/usr/{local/}bin/spamc].],
924        spamc_prog="$enableval",
925        [
926            if test "$spamc_prog" = ""
927            then
928                AC_MSG_RESULT(no)
929                AC_MSG_ERROR([Unable to find your spamc prog, specify --enable-spamc-prog.])
930            fi
931        ]
932    )
933
934    if test ! -f "$spamc_prog"
935    then
936        AC_MSG_RESULT(no)
937        AC_MSG_ERROR([Unable to find your spamc program, specify --enable-spamc-prog=/full/path/to/spamc])
938    fi
939
940    AC_MSG_RESULT(yes)
941    AC_DEFINE_UNQUOTED(SPAMC_PROG,"$spamc_prog","")
942
943      ;;
944esac
945
946#----------------------------------------------------------------------
947
948AC_MSG_CHECKING(whether maildrop is enabled)
949AC_ARG_ENABLE(maildrop,
950        [  --enable-maildrop          Enable maildrop. See  README.maildrop for more info.],
951        ENABLE_MAILDROP=$enableval,
952                [
953                        ENABLE_MAILDROP=0
954                ]
955)
956
957case $ENABLE_MAILDROP in
958  0*|n*|N*)
959      AC_MSG_RESULT(no)
960      ;;
961  *)
962      AC_MSG_RESULT(yes)
963      ENABLE_MAILDROP=1
964      AC_DEFINE_UNQUOTED(MAILDROP,$ENABLE_MAILDROP,"")
965
966    AC_MSG_CHECKING(whether we can locate the maildrop program)
967    for f in /usr/bin/maildrop /usr/local/bin/maildrop
968    do
969        if test -f $f
970        then
971            maildrop_prog=$f
972            break
973        fi
974    done
975    AC_ARG_ENABLE(maildrop-prog,
976        [  --enable-maildrop-prog=PATH    Full path to maildrop program [/usr/{local/}bin/maildrop].],
977        maildrop_prog="$enableval",
978        [
979            if test "$maildrop_prog" = ""
980            then
981                AC_MSG_RESULT(no)
982                AC_MSG_ERROR([Unable to find your maildrop prog, specify --enable-maildrop-prog.])
983            fi
984        ]
985    )
986
987    if test ! -f "$maildrop_prog"
988    then
989        AC_MSG_RESULT(no)
990        AC_MSG_ERROR([Unable to find your maildrop program, specify --enable-maildrop-prog=/full/path/to/maildrop])
991    fi
992
993    AC_MSG_RESULT(yes)
994    AC_DEFINE_UNQUOTED(MAILDROP_PROG,"$maildrop_prog","")
995
996      ;;
997esac
998
999#----------------------------------------------------------------------
1000AC_MSG_CHECKING(whether domainquotas is enabled)
1001AC_ARG_ENABLE(domainquotas,
1002        [  --enable-domainquotas      Enable non-system domain quotas. See README.quotas for more info.],
1003        ENABLE_DOMAIN_QUOTAS=$enableval,
1004                [
1005                        ENABLE_DOMAIN_QUOTAS=0
1006                ]
1007)
1008
1009case $ENABLE_DOMAIN_QUOTAS in
1010  0*|n*|N*)
1011      AC_MSG_RESULT(no)
1012      ;;
1013  *)
1014      AC_MSG_RESULT(yes)
1015      ENABLE_DOMAIN_QUOTAS=1
1016      AC_DEFINE_UNQUOTED(DOMAIN_QUOTAS,$ENABLE_DOMAIN_QUOTAS,"")
1017      ;;
1018esac
1019
1020#----------------------------------------------------------------------
1021
1022vlimits_default="$vpopmaildir/etc/vlimits.default"
1023
1024AC_DEFINE_UNQUOTED(VLIMITS_DEFAULT_FILE,"$vlimits_default","")
1025
1026#----------------------------------------------------------------------
1027
1028domains_dir="domains"
1029
1030AC_ARG_ENABLE(domains-dir,
1031    [  --enable-domains-dir=TEXT  Directory in ~vpopmail to store domains (default=domains).],
1032    domains_dir="$enableval",
1033)
1034
1035AC_DEFINE_UNQUOTED(DOMAINS_DIR,"$domains_dir","")
1036AC_SUBST(domains_dir)
1037
1038#----------------------------------------------------------------------
1039
1040# cant contain this following block in the mysql section, as it is also used by oracle
1041incdir=""
1042for f in /usr/local/mysql/include/mysql /usr/local/mysql/include /usr/local/include/mysql /usr/include/mysql
1043do
1044    if test -d $f
1045    then
1046        incdir=$f
1047        break
1048    fi
1049done
1050
1051AC_ARG_ENABLE(incdir,
1052    [  --enable-incdir=DIR        Your MySQL/Oracle 'include' directory.],
1053    incdir="$enableval",
1054)
1055
1056libdir=""
1057for f in /usr/local/mysql/lib/mysql /usr/local/mysql/lib  /usr/local/lib/mysql /usr/lib/mysql
1058do
1059    if test -d $f
1060    then
1061        libdir=$f
1062        break
1063    fi
1064done
1065
1066AC_ARG_ENABLE(libdir,
1067    [  --enable-libdir=DIR        Your MySQL/Oracle 'lib' directory.],
1068    libdir="$enableval",
1069)
1070
1071#----------------------------------------------------------------------
1072
1073AC_MSG_CHECKING(whether an auth module has been specified)
1074
1075#default to use CDB authentication
1076AUTH_MODULE="cdb"
1077
1078AC_ARG_ENABLE(auth-module,
1079    [  --enable-auth-module=MOD   Nominate how to store the vpopmail account information (cdb (default), mysql, pgsql, ldap, oracle, or sybase).],
1080    AUTH_MODULE="$enableval",
1081)
1082
1083case $AUTH_MODULE in
1084
1085  cd*|Cd*|CD*)
1086    AC_MSG_RESULT([no, so default to cdb])
1087    USE_CDB=1
1088    USE_SQL=0
1089    rm -rf vauth.c
1090    ln -sf vcdb.c vauth.c
1091    AC_DEFINE_UNQUOTED(USE_CDB,$USE_CDB,"")
1092    authlib=""
1093    AC_SUBST(authlib)
1094    auth_inc="-Icdb"
1095    AC_SUBST(auth_inc)
1096    ;;
1097
1098  my*|My*|MY*)
1099    AC_MSG_RESULT(mysql)
1100    USE_CDB=0
1101    USE_SQL=1
1102    USE_MYSQL=1
1103    rm -rf vauth.c
1104    ln -sf vmysql.c vauth.c
1105    AC_SUBST(USE_MYSQL)
1106    AC_DEFINE_UNQUOTED(USE_SQL,$USE_SQL,"")
1107    AC_DEFINE_UNQUOTED(USE_MYSQL,$USE_MYSQL,"")
1108    #AC_CHECK_LIB(m,floor)
1109    #AC_CHECK_LIB(z,compress)
1110
1111    if test "$incdir" = ""
1112    then
1113        AC_MSG_ERROR([Unable to find your MySQL inc dir, specify --enable-incdir.])
1114    fi
1115
1116    if test ! -d "$incdir"
1117    then
1118       AC_MSG_ERROR([Unable to find your MySQL inc dir, specify --enable-incdir.])
1119    fi
1120
1121    auth_inc="-I$incdir"
1122    AC_SUBST(auth_inc)
1123
1124    if test "$libdir" = ""
1125    then
1126        AC_MSG_ERROR([Unable to find your MySQL lib dir, specify --enable-libdir.])
1127    fi
1128
1129    if test ! -d "$libdir"
1130    then
1131        AC_MSG_ERROR([Unable to find your MySQL lib dir, specify --enable-libdir.])
1132    fi
1133
1134    auth_libs="-Xlinker -R -Xlinker $libdir -L$libdir $extralibflags -lmysqlclient -lz -lm"
1135    AC_SUBST(auth_libs)
1136    ;;
1137
1138  pg*|Pg*|PG*)
1139    AC_MSG_RESULT(pgsql)
1140
1141    pgconfig=""
1142    for f in /usr/local/pgsql/bin/pg_config /usr/local/bin/pg_config /usr/bin/pg_config
1143    do
1144        if test -f $f
1145        then
1146            pgconfig=$f
1147            break
1148        fi
1149    done
1150
1151    if test "$pgconfig" = ""
1152    then
1153        AC_MSG_ERROR([Unable to locate the pg_config program.])
1154    fi
1155
1156    if test ! -f "$pgconfig"
1157    then
1158        AC_MSG_ERROR([Unable to locate the pg_config program.])
1159    fi
1160
1161    USE_CDB=0
1162    USE_SQL=1
1163    USE_POSTGRES=1
1164    rm -rf vauth.c
1165    ln -sf vpgsql.c vauth.c
1166    AC_DEFINE_UNQUOTED(USE_SQL,$USE_SQL,"")
1167    AC_DEFINE_UNQUOTED(USE_POSTGRES,$USE_POSTGRES,"")
1168
1169    auth_libs="-L`$pgconfig --libdir` -lpq "
1170    AC_SUBST(auth_libs)
1171    auth_inc="-I`$pgconfig --includedir`"
1172    AC_SUBST(auth_inc)
1173    ;;
1174
1175  ld*|Ld*|LD*)
1176    AC_MSG_RESULT(ldap)
1177    USE_CDB=0
1178    USE_SQL=0
1179    USE_LDAP=1
1180    rm -rf vauth.c
1181    ln -sf vldap.c vauth.c
1182    AC_DEFINE_UNQUOTED(USE_LDAP,$USE_LDAP,"")
1183    auth_libs="-L/usr/local/lib -lldap -llber -lresolv"
1184    AC_SUBST(auth_libs)
1185    auth_inc="-I/usr/local/include"
1186    AC_SUBST(auth_inc)
1187    ;;
1188
1189  or*|Or*|OR*)
1190    AC_MSG_RESULT(oracle)
1191    USE_CDB=0
1192    USE_SQL=1
1193    USE_ORACLE=1
1194    rm -rf vauth.c
1195    ln -sf voracle.c vauth.c
1196    AC_DEFINE_UNQUOTED(USE_SQL,$USE_SQL,"")
1197    AC_DEFINE_UNQUOTED(USE_ORACLE,$USE_ORACLE,"")
1198    auth_libs="-L$libdir -lclntsh -lclient8"
1199    AC_SUBST(auth_libs)
1200    auth_inc="-I$incdir"
1201    AC_SUBST(auth_inc)
1202    ;;
1203
1204  sy*|Sy*|SY*)
1205    AC_MSG_RESULT(sybase)
1206    USE_CDB=0
1207    USE_SQL=1
1208    USE_SYBASE=1
1209    rm -rf vauth.c
1210    ln -sf vsybase.c vauth.c
1211    AC_DEFINE_UNQUOTED(USE_SQL,$USE_SQL,"")
1212    AC_DEFINE_UNQUOTED(USE_SYBASE,$USE_SYBASE,"")
1213    auth_libs="-L/opt/sybase/lib -lsybdb -lm"
1214    AC_SUBST(auth_libs)
1215    auth_inc="-I/opt/sybase/include"
1216    AC_SUBST(auth_inc)
1217    ;;
1218
1219  *)
1220    AC_MSG_RESULT(no)
1221    AC_MSG_ERROR(A valid auth-module was not selected. Please specify using --enable-auth-module=cdb|mysql|pgsql|ldap|oracle|sybase)
1222    ;;
1223
1224esac
1225
1226
1227#----------------------------------------------------------------------
1228
1229AC_MSG_CHECKING(whether system accounts have been enabled)
1230AC_ARG_ENABLE(passwd,
1231        [  --enable-passwd            Enable /etc/passwd (or shadow) accounts in addition to virtual domains.],
1232        ENABLE_PASSWD=$enableval,
1233                [
1234                        ENABLE_PASSWD=no
1235                ]
1236)
1237
1238case $ENABLE_PASSWD in
1239  1*|y*|Y*)
1240        AC_MSG_RESULT(yes)
1241        ENABLE_PASSWD=1
1242
1243        AC_CHECK_HEADERS(shadow.h)
1244        HAS_SHADOW_H=0
1245        AC_CHECK_HEADER(shadow.h,
1246                [
1247                        HAS_SHADOW_H=1;
1248                ] )
1249        # if test $HAS_SHADOW_H = 1
1250        # then
1251        #        AC_CHECK_LIB(shadow, setspent)
1252        # fi
1253                AC_DEFINE_UNQUOTED(ENABLE_PASSWD,$ENABLE_PASSWD,"")
1254        ;;
1255  *)
1256        AC_MSG_RESULT(no)
1257        ENABLE_PASSWD=0
1258        ;;
1259esac
1260
1261#----------------------------------------------------------------------
1262
1263AC_MSG_CHECKING(whether /etc/shadow exists)
1264if test -f /etc/shadow
1265then
1266        AC_MSG_RESULT(yes)
1267        HAS_SHADOW=1
1268        AC_DEFINE_UNQUOTED(HAS_SHADOW,$HAS_SHADOW,"")
1269else
1270        AC_MSG_RESULT(no)
1271fi
1272
1273#----------------------------------------------------------------------
1274
1275AC_MSG_CHECKING(whether logging is enabled)
1276AC_ARG_ENABLE(logging,
1277        [  --enable-logging=OPT       Log to syslog: n=nothing, e=errors only (default), y=all attempts, p=errors with passwords, v=verbose (all attempts, with passwords).],
1278        ENABLE_LOGGING=$enableval,
1279                [
1280                        ENABLE_LOGGING=e
1281                ]
1282)
1283
1284case $ENABLE_LOGGING in
1285  1*|y*|Y*)
1286      AC_MSG_RESULT(all attempts)
1287      ENABLE_LOGGING=1
1288          AC_DEFINE_UNQUOTED(ENABLE_LOGGING,$ENABLE_LOGGING,"")
1289      ;;
1290  e*|E*)
1291      AC_MSG_RESULT(errors only)
1292      ENABLE_LOGGING=2
1293          AC_DEFINE_UNQUOTED(ENABLE_LOGGING,$ENABLE_LOGGING,"")
1294          ;;
1295  p*|P*)
1296      AC_MSG_RESULT([errors, with password])
1297      ENABLE_LOGGING=3
1298          AC_DEFINE_UNQUOTED(ENABLE_LOGGING,$ENABLE_LOGGING,"")
1299          ;;
1300  v*|V*)
1301      AC_MSG_RESULT([verbose, all with password])
1302       ENABLE_LOGGING=4
1303          AC_DEFINE_UNQUOTED(ENABLE_LOGGING,$ENABLE_LOGGING,"")
1304          ;;
1305  *)
1306      AC_MSG_RESULT(no)
1307      ENABLE_LOGGING=0
1308          AC_DEFINE_UNQUOTED(ENABLE_LOGGING,$ENABLE_LOGGING,"")
1309          ;;
1310esac
1311
1312#----------------------------------------------------------------------
1313
1314log_name="vpopmail"
1315AC_ARG_ENABLE(log-name,
1316    [  --enable-log-name=TEXT     Set syslog name [vpopmail].],
1317    log_name="$enableval",
1318)
1319
1320AC_DEFINE_UNQUOTED(LOG_NAME,"$log_name","")
1321
1322#----------------------------------------------------------------------
1323
1324AC_MSG_CHECKING(whether auth-logging is enabled)
1325AC_ARG_ENABLE(auth-logging,
1326        [  --disable-auth-logging     Don't record time and ip of last auth attempt. Valid only for CDB, MySQL, PGSQL, LDAP.],
1327        ENABLE_AUTH_LOGGING=$enableval,
1328                [
1329                        ENABLE_AUTH_LOGGING=y
1330                ]
1331)
1332
1333case $ENABLE_AUTH_LOGGING in
1334  1*|y*|Y*)
1335      AC_MSG_RESULT(yes)
1336      ENABLE_AUTH_LOGGING=1
1337      AC_DEFINE_UNQUOTED(ENABLE_AUTH_LOGGING,$ENABLE_AUTH_LOGGING,"")
1338      ;;
1339  *)
1340      AC_MSG_RESULT(no)
1341      ;;
1342esac
1343
1344#----------------------------------------------------------------------
1345
1346AC_MSG_CHECKING(whether sql-logging is enabled)
1347AC_ARG_ENABLE(sql-logging,
1348        [  --enable-sql-logging       Enable authentication logging to MySQL/Postgres.],
1349        ENABLE_SQL_LOGGING=$enableval,
1350                [
1351                        ENABLE_SQL_LOGGING=n
1352                ]
1353)
1354
1355case $ENABLE_SQL_LOGGING in
1356  1*|y*|Y*)
1357      AC_MSG_RESULT(yes)
1358      if test "$USE_SQL" != 1
1359      then
1360          AC_MSG_ERROR(sql-logging is only supported in the MySQL/Postgres authentication modules)
1361      else
1362        ENABLE_SQL_LOGGING=1
1363        AC_DEFINE_UNQUOTED(ENABLE_SQL_LOGGING,$ENABLE_SQL_LOGGING,"")
1364      fi
1365      ;;
1366  *)
1367      AC_MSG_RESULT(no)
1368      ;;
1369esac
1370
1371#----------------------------------------------------------------------
1372
1373WARN_LIMITS=0
1374AC_MSG_CHECKING(whether mysql-limits is enabled)
1375AC_ARG_ENABLE(mysql-limits,
1376        [  --enable-mysql-limits      Use MySQL to store limits instead of .qmailadmin-limits files.],
1377        ENABLE_MYSQL_LIMITS=$enableval,
1378                [
1379                        ENABLE_MYSQL_LIMITS=n
1380                ]
1381)
1382
1383case $ENABLE_MYSQL_LIMITS in
1384  1*|y*|Y*)
1385      AC_MSG_RESULT(yes)
1386      if test "$USE_MYSQL" != 1
1387      then
1388          AC_MSG_ERROR(mysql-limits is only supported in the MySQL authentication module)
1389      else
1390		  WARN_LIMITS=1
1391          ENABLE_MYSQL_LIMITS=1
1392          AC_DEFINE_UNQUOTED(ENABLE_MYSQL_LIMITS,$ENABLE_MYSQL_LIMITS,"")
1393      fi
1394      ;;
1395  *)
1396      AC_MSG_RESULT(no)
1397      ;;
1398esac
1399
1400#----------------------------------------------------------------------
1401
1402AC_MSG_CHECKING(whether mysql-replication is enabled)
1403AC_ARG_ENABLE(mysql-replication,
1404        [  --enable-mysql-replication Enable support for replicated MySQL auth servers.],
1405        MYSQL_REPLICATION=$enableval,
1406                [
1407                        MYSQL_REPLICATION=n
1408                ]
1409)
1410
1411case $MYSQL_REPLICATION in
1412  1*|y*|Y*)
1413        AC_MSG_RESULT(yes)
1414        if test "$USE_MYSQL" != 1
1415        then
1416                AC_MSG_ERROR(mysql-replication is only supported in the MySQL authentication module)
1417        else
1418                MYSQL_REPLICATION=1
1419                AC_DEFINE_UNQUOTED(MYSQL_REPLICATION,$MYSQL_REPLICATION,"")
1420        fi
1421        ;;
1422  *)
1423        AC_MSG_RESULT(no)
1424        ;;
1425esac
1426
1427#----------------------------------------------------------------------
1428
1429AC_MSG_CHECKING(whether valias is enabled)
1430AC_ARG_ENABLE(valias,
1431        [  --enable-valias            Store email aliases in SQL table or LDAP database instead of .qmail files.],
1432        VALIAS=$enableval,
1433                [
1434                        VALIAS=n
1435                ]
1436)
1437
1438case $VALIAS in
1439  1*|y*|Y*)
1440        AC_MSG_RESULT(yes)
1441        if test "$USE_SQL" != 1
1442		 then
1443		   if test "$USE_LDAP" != 1
1444			then
1445                AC_MSG_ERROR(valias option is only supported in the SQL and LDAP authentication modules)
1446			fi
1447		 fi
1448
1449                VALIAS=1
1450                AC_DEFINE_UNQUOTED(VALIAS,$VALIAS,"")
1451        ;;
1452  *)
1453        AC_MSG_RESULT(no)
1454        ;;
1455esac
1456
1457#----------------------------------------------------------------------
1458
1459AC_MSG_CHECKING(whether many-domains is enabled)
1460AC_ARG_ENABLE(many-domains,
1461        [  --disable-many-domains     Creates a table for each virtual domain instead of storing all users in a single table. Only valid for MySQL and PostgreSQL],
1462        MANY_DOMAINS=$enableval,
1463                [
1464                        MANY_DOMAINS=y
1465                ]
1466)
1467
1468case $MANY_DOMAINS in
1469  1*|y*|Y*)
1470                AC_MSG_RESULT(yes)
1471                #if test $USE_SQL != 1
1472                #then
1473                #     AC_MSG_ERROR(many-domains is only supported in the SQL authentication modules)
1474                #else
1475                   MANY_DOMAINS=1
1476                   AC_DEFINE_UNQUOTED(MANY_DOMAINS,$MANY_DOMAINS,"")
1477                #fi
1478        ;;
1479  *)
1480                AC_MSG_RESULT(no)
1481                MANY_DOMAINS=0
1482        ;;
1483esac
1484
1485#----------------------------------------------------------------------
1486
1487AC_MSG_CHECKING(whether any discontinued --enable commands have been used)
1488
1489AC_ARG_ENABLE(mysql-logging, [],
1490    [
1491        AC_MSG_RESULT(yes)
1492        AC_MSG_ERROR(--enable-mysql-logging has been superceded.  Please use --enable-sql-logging instead)
1493    ]
1494)
1495
1496AC_ARG_ENABLE(pgsql-logging, [],
1497    [
1498        AC_MSG_RESULT(yes)
1499        AC_MSG_ERROR(--enable-pgsql-logging has been superceded.  Please use --enable-sql-logging instead)
1500    ]
1501)
1502
1503AC_ARG_ENABLE(mysql, [],
1504    [
1505        AC_MSG_RESULT(yes)
1506        AC_MSG_ERROR(--enable-mysql has been superceded. Please use --enable-auth-module=mysql instead)
1507    ]
1508)
1509
1510AC_ARG_ENABLE(pgsql, [],
1511    [
1512        AC_MSG_RESULT(yes)
1513        AC_MSG_ERROR(--enable-pgsql has been superceded. Please use --enable-auth-module=pgsql instead)
1514    ]
1515)
1516
1517AC_ARG_ENABLE(ldap, [],
1518    [
1519        AC_MSG_RESULT(yes)
1520        AC_MSG_ERROR(--enable-ldap has been superceded. Please use --enable-auth-module=ldap instead)
1521    ]
1522)
1523
1524AC_ARG_ENABLE(oracle, [],
1525    [
1526        AC_MSG_RESULT(yes)
1527        AC_MSG_ERROR(--enable-oracle has been superceded. Please use --enable-auth-module=oracle instead)
1528    ]
1529)
1530
1531AC_ARG_ENABLE(sybase, [],
1532    [
1533        AC_MSG_RESULT(yes)
1534	AC_MSG_ERROR(--enable-sybase has been superceded. Please use --enable-auth-module=sybase instead)
1535    ]
1536)
1537
1538#AC_ARG_ENABLE(domainquotas, [],
1539#    [
1540#        AC_MSG_RESULT(yes)
1541#        AC_MSG_ERROR(--enable-domainquotas has been temporarily disabled since the domain quota code is broken.)
1542#    ]
1543#)
1544
1545AC_ARG_ENABLE(hardquota, [],
1546    [
1547        AC_MSG_RESULT(yes)
1548        AC_MSG_ERROR(--enable-hardquota has been superceded. Please use the ~vpopmail/etc/vlimits.default file instead.)
1549    ]
1550)
1551
1552AC_ARG_ENABLE(defaultquota, [],
1553    [
1554        AC_MSG_RESULT(yes)
1555        AC_MSG_ERROR(--enable-defaultquota has been superceded. Please use the ~vpopmail/etc/vlimits.default file instead.)
1556    ]
1557)
1558
1559AC_ARG_ENABLE(default-domain, [],
1560    [
1561        AC_MSG_RESULT(yes)
1562        AC_MSG_ERROR(--enable-default-domain has been superceded. The default domain should be put into the file ~vpopmail/etc/defaultdomain instead)
1563    ]
1564)
1565
1566AC_MSG_RESULT(no)
1567
1568#----------------------------------------------------------------------
1569
1570AC_OUTPUT(Makefile)
1571
1572#----------------------------------------------------------------------
1573
1574
1575echo ""
1576echo "           $PACKAGE $VERSION           "
1577echo "            Current settings"
1578echo "---------------------------------------"
1579echo ""
1580echo "vpopmail directory = "$vpopmaildir""
1581echo " domains directory = "$vpopmaildir"/"$domains_dir""
1582echo "               uid = "$vpopmailuid""
1583echo "               gid = "$vpopmailgid""
1584
1585case $POPRELAY in
1586  1*|y*|Y*)
1587    echo "     roaming users = ON  --enable-roaming-users"
1588
1589    echo "    tcpserver file = $tcpserver_file"
1590    echo "    open_smtp file = $open_smtp_cur"
1591
1592    case $REBUILD_TCPSERVER in
1593      1*|y*|Y*)
1594        echo "rebuild tcpserver file = ON  --enable-rebuild-tcpserver-file (default)"
1595        ;;
1596      *)
1597        echo "rebuild tcpserver file = OFF --disable-rebuild-tcpserver-file"
1598        ;;
1599    esac
1600
1601    ;;
1602  *)
1603    echo "     roaming users = OFF --disable-roaming-users (default)"
1604    ;;
1605esac
1606
1607
1608case $ENABLE_LEARN_PASSWORDS in
1609  1*|y*|Y*)
1610    echo " password learning = ON  --enable-learn-passwords"
1611    ;;
1612  *)
1613    echo " password learning = OFF --disable-learn-passwords (default)"
1614    ;;
1615esac
1616
1617
1618case $ENABLE_MD5_PASSWORDS in
1619  1*|y*|Y*)
1620    echo "     md5 passwords = ON  --enable-md5-passwords (default)"
1621    ;;
1622  *)
1623    echo "     md5 passwords = OFF --disable-md5-passwords"
1624    ;;
1625esac
1626
1627
1628case $FILE_LOCKING in
1629  1*|y*|Y*)
1630    echo "      file locking = ON  --enable-file-locking (default)"
1631    ;;
1632  *)
1633    echo "      file locking = OFF --disable-file-locking"
1634    ;;
1635esac
1636
1637
1638case $FILE_SYNC in
1639  1*|y*|Y*)
1640    echo "vdelivermail fsync = ON  --enable-file-sync"
1641    ;;
1642  *)
1643    echo "vdelivermail fsync = OFF --disable-file-sync (default)"
1644    ;;
1645esac
1646
1647
1648case $MAKE_SEEKABLE in
1649  1*|y*|Y*)
1650    echo "     make seekable = ON  --enable-make-seekable (default)"
1651    ;;
1652  *)
1653    echo "     make seekable = OFF --disable-make-seekable"
1654    ;;
1655esac
1656
1657
1658case $CLEAR_PASS in
1659  1*|y*|Y*)
1660    echo "      clear passwd = ON  --enable-clear-passwd (default)"
1661    ;;
1662  *)
1663    echo "      clear passwd = OFF --disable-clear-passwd"
1664    ;;
1665esac
1666
1667
1668case $USERS_BIG_DIR in
1669  1*|y*|Y*)
1670    echo " user dir hashing  = ON  --enable-users-big-dir (default)"
1671    ;;
1672  *)
1673    echo " user dir hashing  = OFF --disable-users-big-dir"
1674    ;;
1675esac
1676
1677
1678# SQWEBMAIL PASS
1679
1680
1681case $QMAIL_EXT in
1682  1*|y*|Y*)
1683    echo "address extensions = ON  --enable-qmail-ext"
1684    ;;
1685  *)
1686    echo "address extensions = OFF --disable-qmail-ext (default)"
1687    ;;
1688esac
1689
1690
1691case $IPALIAS in
1692  1*|y*|Y*)
1693    echo "          ip alias = ON  --enable-ip-alias-domains"
1694    ;;
1695  *)
1696    echo "          ip alias = OFF --disable-ip-alias-domains (default)"
1697    ;;
1698esac
1699
1700
1701case $ENABLE_ONCHANGE_SCRIPT in
1702  1*|y*|Y*)
1703    echo "   onchange script = ON  --enable-onchange-script"
1704    ;;
1705  *)
1706    echo "   onchange script = OFF --disable-onchange-script (default)"
1707    ;;
1708esac
1709
1710
1711case $ENABLE_DOMAIN_QUOTAS in
1712  1*|y*|Y*)
1713    echo "     domain quotas = ON  --enable-domainquotas"
1714	echo ""
1715	echo "                     *** Domain quotas should only be enabled ***"
1716    echo "                     *** when using the vpopmail usage daemon ***"
1717	echo ""
1718    ;;
1719  *)
1720    echo "     domain quotas = OFF --disable-domainquotas (default)"
1721    ;;
1722esac
1723
1724
1725case $AUTH_MODULE in
1726  cd*|Cd*|CD*)
1727    echo "       auth module = cdb --enable-auth-module=cdb (default)"
1728    ;;
1729
1730  my*|My*|MY*)
1731    echo "       auth module = mysql --enable-auth-module=mysql"
1732
1733    case $MYSQL_REPLICATION in
1734      1*|y*|Y*)
1735        echo " mysql replication = ON  --enable-mysql-replication"
1736        ;;
1737      *)
1738        echo " mysql replication = OFF --disable-mysql-replication (default)"
1739        ;;
1740    esac
1741
1742    case $ENABLE_SQL_LOGGING in
1743      1*|y*|Y*)
1744        echo "       sql logging = ON  --enable-sql-logging"
1745        ;;
1746      *)
1747        echo "       sql logging = OFF --disable-sql-logging (default)"
1748        ;;
1749    esac
1750
1751    case $ENABLE_MYSQL_LIMITS in
1752      1*|y*|Y*)
1753        echo "      mysql limits = ON  --enable-mysql-limits"
1754        ;;
1755      *)
1756        echo "      mysql limits = OFF --disable-mysql-limits (default)"
1757        ;;
1758    esac
1759
1760    case $VALIAS in
1761      1*|y*|Y*)
1762        echo "  SQL valias table = ON  --enable-valias"
1763        ;;
1764      *)
1765        echo "  SQL valias table = OFF --disable-valias (default)"
1766        ;;
1767    esac
1768    ;;
1769
1770  pg*|Pg*|PG*)
1771    echo "       auth module = postgres --enable-auth-module=postgres"
1772
1773    case $ENABLE_SQL_LOGGING in
1774      1*|y*|Y*)
1775        echo "       sql logging = ON  --enable-sql-logging"
1776        ;;
1777      *)
1778        echo "       sql logging = OFF --disable-sql-logging (default)"
1779      ;;
1780    esac
1781    ;;
1782
1783  ld*|Ld*|LD*)
1784    echo "       auth module = ldap --enable-auth-module=ldap"
1785    ;;
1786
1787  or*|Or*|OR*)
1788    echo "       auth module = oracle --enable-auth-module=oracle"
1789    ;;
1790
1791  sy*|Sy*|SY*)
1792    echo "       auth module = sybase --enable-auth-module=sybase"
1793    ;;
1794
1795esac
1796
1797
1798echo "          auth inc = $auth_inc"
1799echo "          auth lib = $auth_libs"
1800
1801
1802case $ENABLE_PASSWD in
1803  1*|y*|Y*)
1804    echo "  system passwords = ON  --enable-passwd"
1805    ;;
1806  *)
1807    echo "  system passwords = OFF --disable-passwd (default)"
1808    ;;
1809esac
1810
1811
1812case $ENABLE_LOGGING in
1813  1*|y*|Y*)
1814    echo "        pop syslog = show successful and failed login attempts --enable-logging=y"
1815    ;;
1816  2*|e*|E*)
1817    echo "        pop syslog = show only failed attempts --enable-logging=e (default)"
1818    ;;
1819  3*|p*|P*)
1820    echo "        pop syslog = show failed attempts with clear text password --enable-logging=p"
1821    ;;
1822  4*|v*|V*)
1823    echo "        pop syslog = log success and errors including passwords --enable-logging=v"
1824    ;;
1825  *)
1826    echo "        pop syslog = OFF"
1827    ;;
1828esac
1829
1830
1831case $ENABLE_AUTH_LOGGING in
1832  1*|y*|Y*)
1833    echo "      auth logging = ON  --enable-auth-logging (default)"
1834    ;;
1835  *)
1836    echo "      auth logging = OFF --disable-auth-logging"
1837    ;;
1838esac
1839
1840
1841if test "$USE_SQL" = 1
1842then
1843  if test "$MANY_DOMAINS" = 1
1844  then
1845    echo "all domains in one SQL table = --enable-many-domains (default)"
1846  else
1847    echo "one domain per SQL table     = --disable-many-domains"
1848  fi
1849fi
1850
1851case $ENABLE_SPAMASSASSIN in
1852  1*|y*|Y*)
1853    echo "      spamassassin = ON  --enable-spamassassin"
1854    ;;
1855  *)
1856    echo "      spamassassin = OFF --disable-spamassassin (default)"
1857    ;;
1858esac
1859
1860case $ENABLE_MAILDROP in
1861  1*|y*|Y*)
1862    echo "          maildrop = ON  --enable-maildrop"
1863    ;;
1864  *)
1865    echo "          maildrop = OFF --disable-maildrop (default)"
1866    ;;
1867esac
1868
1869echo "${CC} -O2" > cdb/conf-cc
1870echo "${CC} -s" > cdb/conf-ld
1871
1872echo ""
1873echo ""
1874
1875if test $WARN_LIMITS -eq 1; then
1876   echo "*** You have MySQL limits enabled.  If you are upgrading, please see doc/UPGRADE for information on database schema changes ****"
1877   echo ""
1878   echo ""
1879fi
1880