*** Makefile.am.dist Sat Dec 23 08:41:15 2000 --- Makefile.am Sat Dec 23 09:11:23 2000 *************** *** 4,10 **** noinst_LIBRARIES=libvpopmail.a ! COMMONSOURCES=safestring.c vpopmail.c md5.c bigdir.c vauth.c file_lock.c libvpopmail_a_SOURCES=$(COMMONSOURCES) libvpopmail_a_LIBADD = cdb/*.o --- 4,10 ---- noinst_LIBRARIES=libvpopmail.a ! COMMONSOURCES=safestring.c vpopmail.c md5.c bigdir.c vauth.c file_lock.c vopen_smtp.c libvpopmail_a_SOURCES=$(COMMONSOURCES) libvpopmail_a_LIBADD = cdb/*.o *** ../vpopmail-4.9.7/Makefile.in Thu Dec 14 09:36:38 2000 --- Makefile.in Sat Dec 23 14:50:29 2000 *************** *** 75,81 **** noinst_LIBRARIES = libvpopmail.a ! COMMONSOURCES = safestring.c vpopmail.c md5.c bigdir.c vauth.c file_lock.c libvpopmail_a_SOURCES = $(COMMONSOURCES) libvpopmail_a_LIBADD = cdb/*.o --- 75,81 ---- noinst_LIBRARIES = libvpopmail.a ! COMMONSOURCES = safestring.c vpopmail.c md5.c bigdir.c vauth.c file_lock.c vopen_smtp.c libvpopmail_a_SOURCES = $(COMMONSOURCES) libvpopmail_a_LIBADD = cdb/*.o *************** *** 144,150 **** LIBS = @LIBS@ libvpopmail_a_DEPENDENCIES = cdb/*.o libvpopmail_a_OBJECTS = safestring.o vpopmail.o md5.o bigdir.o vauth.o \ ! file_lock.o AR = ar PROGRAMS = $(vpopmailbin_PROGRAMS) --- 144,150 ---- LIBS = @LIBS@ libvpopmail_a_DEPENDENCIES = cdb/*.o libvpopmail_a_OBJECTS = safestring.o vpopmail.o md5.o bigdir.o vauth.o \ ! file_lock.o vopen_smtp.o AR = ar PROGRAMS = $(vpopmailbin_PROGRAMS) *************** *** 216,222 **** .deps/vconvert.P .deps/vdeldomain.P .deps/vdelivermail.P \ .deps/vdeluser.P .deps/vipmap.P .deps/vmkpasswd.P .deps/vmoduser.P \ .deps/vpasswd.P .deps/vpopbull.P .deps/vpopmail.P .deps/vsetuserquota.P \ ! .deps/vuserinfo.P SOURCES = $(libvpopmail_a_SOURCES) $(vchkpw_SOURCES) $(vdelivermail_SOURCES) $(clearopensmtp_SOURCES) $(vadddomain_SOURCES) $(vdeldomain_SOURCES) $(vpasswd_SOURCES) $(vadduser_SOURCES) $(vdeluser_SOURCES) $(vaddaliasdomain_SOURCES) $(vsetuserquota_SOURCES) $(vpopbull_SOURCES) $(vconvert_SOURCES) $(vmoduser_SOURCES) $(vuserinfo_SOURCES) $(vmkpasswd_SOURCES) $(vipmap_SOURCES) OBJECTS = $(libvpopmail_a_OBJECTS) $(vchkpw_OBJECTS) $(vdelivermail_OBJECTS) $(clearopensmtp_OBJECTS) $(vadddomain_OBJECTS) $(vdeldomain_OBJECTS) $(vpasswd_OBJECTS) $(vadduser_OBJECTS) $(vdeluser_OBJECTS) $(vaddaliasdomain_OBJECTS) $(vsetuserquota_OBJECTS) $(vpopbull_OBJECTS) $(vconvert_OBJECTS) $(vmoduser_OBJECTS) $(vuserinfo_OBJECTS) $(vmkpasswd_OBJECTS) $(vipmap_OBJECTS) --- 216,222 ---- .deps/vconvert.P .deps/vdeldomain.P .deps/vdelivermail.P \ .deps/vdeluser.P .deps/vipmap.P .deps/vmkpasswd.P .deps/vmoduser.P \ .deps/vpasswd.P .deps/vpopbull.P .deps/vpopmail.P .deps/vsetuserquota.P \ ! .deps/vuserinfo.P .deps/vopen_smtp.P SOURCES = $(libvpopmail_a_SOURCES) $(vchkpw_SOURCES) $(vdelivermail_SOURCES) $(clearopensmtp_SOURCES) $(vadddomain_SOURCES) $(vdeldomain_SOURCES) $(vpasswd_SOURCES) $(vadduser_SOURCES) $(vdeluser_SOURCES) $(vaddaliasdomain_SOURCES) $(vsetuserquota_SOURCES) $(vpopbull_SOURCES) $(vconvert_SOURCES) $(vmoduser_SOURCES) $(vuserinfo_SOURCES) $(vmkpasswd_SOURCES) $(vipmap_SOURCES) OBJECTS = $(libvpopmail_a_OBJECTS) $(vchkpw_OBJECTS) $(vdelivermail_OBJECTS) $(clearopensmtp_OBJECTS) $(vadddomain_OBJECTS) $(vdeldomain_OBJECTS) $(vpasswd_OBJECTS) $(vadduser_OBJECTS) $(vdeluser_OBJECTS) $(vaddaliasdomain_OBJECTS) $(vsetuserquota_OBJECTS) $(vpopbull_OBJECTS) $(vconvert_OBJECTS) $(vmoduser_OBJECTS) $(vuserinfo_OBJECTS) $(vmkpasswd_OBJECTS) $(vipmap_OBJECTS) *** ../vpopmail-4.9.7/acconfig.h Mon Oct 30 16:06:06 2000 --- acconfig.h Sat Dec 23 08:42:27 2000 *************** *** 66,68 **** --- 66,70 ---- #undef POP_AUTH_OPEN_RELAY + #undef POP_AUTH_USE_MYSQL + *** ../vpopmail-4.9.7/clearopensmtp.c Wed Oct 25 11:42:22 2000 --- clearopensmtp.c Sat Dec 23 14:19:18 2000 *************** *** 28,34 **** #include "vpopmail.h" #include "vauth.h" ! #ifndef USE_MYSQL #define MAX_BUFF 200 static char TmpBuf1[MAX_BUFF]; static char TmpBuf2[MAX_BUFF]; --- 28,34 ---- #include "vpopmail.h" #include "vauth.h" ! #ifndef POP_AUTH_USE_MYSQL #define MAX_BUFF 200 static char TmpBuf1[MAX_BUFF]; static char TmpBuf2[MAX_BUFF]; *************** *** 37,43 **** int main() { ! #ifndef USE_MYSQL FILE *fs; FILE *fs1; char *tmpstr; --- 37,43 ---- int main() { ! #ifndef POP_AUTH_USE_MYSQL FILE *fs; FILE *fs1; char *tmpstr; *************** *** 49,55 **** clear_minutes = RELAY_CLEAR_MINUTES * 60; mytime = time(NULL); ! #ifdef USE_MYSQL vclear_open_smtp(clear_minutes, mytime); #else fs = fopen(OPEN_SMTP_CUR_FILE, "r+"); --- 49,55 ---- clear_minutes = RELAY_CLEAR_MINUTES * 60; mytime = time(NULL); ! #ifdef POP_AUTH_USE_MYSQL vclear_open_smtp(clear_minutes, mytime); #else fs = fopen(OPEN_SMTP_CUR_FILE, "r+"); *** ../vpopmail-4.9.7/config.h.in Mon Oct 30 16:06:08 2000 --- config.h.in Sat Dec 23 08:42:01 2000 *************** *** 88,93 **** --- 88,95 ---- #undef POP_AUTH_OPEN_RELAY + #undef POP_AUTH_USE_MYSQL + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD *** ../vpopmail-4.9.7/configure.in Thu Dec 14 01:36:06 2000 --- configure.in Sat Dec 23 15:49:22 2000 *************** *** 297,302 **** --- 297,303 ---- ln -sf vmysql.c vauth.c AC_DEFINE_UNQUOTED(USE_SQL,$USE_SQL) AC_DEFINE_UNQUOTED(USE_MYSQL,$USE_MYSQL) + AC_DEFINE_UNQUOTED(POP_AUTH_USE_MYSQL,$USE_MYSQL) AC_CHECK_LIB(m,floor) for f in /usr/local/include/mysql /usr/include/mysql *************** *** 437,443 **** echo "-I$vpopmaildir/include" > $vpopmaildir/etc/inc_deps AC_ARG_ENABLE(roaming-users, ! [ --enable-roaming-users=n|y Enable or disable open relay after pop authentication. Default is no], POPRELAY=$enableval, [ POPRELAY=no --- 438,444 ---- echo "-I$vpopmaildir/include" > $vpopmaildir/etc/inc_deps AC_ARG_ENABLE(roaming-users, ! [ --enable-roaming-users=n|y|mysql Enable or disable open relay after pop authentication. Default is no], POPRELAY=$enableval, [ POPRELAY=no *************** *** 446,451 **** --- 447,462 ---- 1*|y*|Y*) POPRELAY=1 AC_DEFINE_UNQUOTED(POP_AUTH_OPEN_RELAY,$POPRELAY) + ;; + mysql*|MYSQL*) + USE_SQL=1 + POPRELAY=1 + AC_DEFINE_UNQUOTED(POP_AUTH_OPEN_RELAY,$POPRELAY) + AC_DEFINE_UNQUOTED(POP_AUTH_USE_MYSQL,$USE_SQL) + + auth_libs="-L$sqllibdir -lmysqlclient" + echo "-L$vpopmaildir/lib -lvpopmail -L$sqllibdir -lmysqlclient" > $vpopmaildir/etc/lib_deps + AC_SUBST(auth_libs) ;; *) ;; *** ../vpopmail-4.9.7/configure Thu Dec 14 01:36:10 2000 --- configure Sat Dec 23 14:27:51 2000 *************** *** 52,58 **** ac_help="$ac_help --enable-sybase=n|y use sybase, default is no" ac_help="$ac_help ! --enable-roaming-users=n|y Enable or disable open relay after pop authentication. Default is no" ac_help="$ac_help --enable-deliver-filter=n|y Experimental vdeliermail filter, default is no" ac_help="$ac_help --- 52,58 ---- ac_help="$ac_help --enable-sybase=n|y use sybase, default is no" ac_help="$ac_help ! --enable-roaming-users=n|y|mysql Enable or disable open relay after pop authentication. Default is no" ac_help="$ac_help --enable-deliver-filter=n|y Experimental vdeliermail filter, default is no" ac_help="$ac_help *************** *** 1673,1680 **** #define USE_MYSQL $USE_MYSQL EOF echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6 ! echo "configure:1678: checking for floor in -lm" >&5 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1673,1684 ---- #define USE_MYSQL $USE_MYSQL EOF + cat >> confdefs.h <&6 ! echo "configure:1682: checking for floor in -lm" >&5 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1682,1688 **** ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1697,1703 ---- floor() ; return 0; } EOF ! if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1910,1915 **** --- 1914,1935 ---- EOF ;; + mysql*|MYSQL*) + USE_SQL=1 + POPRELAY=1 + cat >> confdefs.h <> confdefs.h < $vpopmaildir/etc/lib_deps + + ;; *) ;; esac *************** *** 1993,1999 **** echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 ! echo "configure:1997: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2013,2019 ---- echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 ! echo "configure:2017: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2001,2007 **** ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2032,2038 ---- crypt() ; return 0; } EOF ! if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2040,2046 **** fi echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6 ! echo "configure:2044: checking for gethostbyaddr in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2060,2066 ---- fi echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6 ! echo "configure:2064: checking for gethostbyaddr in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2048,2054 **** ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2079,2085 ---- gethostbyaddr() ; return 0; } EOF ! if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2087,2093 **** fi echo $ac_n "checking for getsockname in -lsocket""... $ac_c" 1>&6 ! echo "configure:2091: checking for getsockname in -lsocket" >&5 ac_lib_var=`echo socket'_'getsockname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2107,2113 ---- fi echo $ac_n "checking for getsockname in -lsocket""... $ac_c" 1>&6 ! echo "configure:2111: checking for getsockname in -lsocket" >&5 ac_lib_var=`echo socket'_'getsockname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2095,2101 **** ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2126,2132 ---- getsockname() ; return 0; } EOF ! if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2141,2157 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2145: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2161,2177 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2165: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 2180,2196 **** HAS_SHADOW_H=0 ac_safe=`echo "shadow.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for shadow.h""... $ac_c" 1>&6 ! echo "configure:2184: checking for shadow.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2200,2216 ---- HAS_SHADOW_H=0 ac_safe=`echo "shadow.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for shadow.h""... $ac_c" 1>&6 ! echo "configure:2204: checking for shadow.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 2216,2222 **** if test $HAS_SHADOW_H = 1 then echo $ac_n "checking for setspent in -lshadow""... $ac_c" 1>&6 ! echo "configure:2220: checking for setspent in -lshadow" >&5 ac_lib_var=`echo shadow'_'setspent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2236,2242 ---- if test $HAS_SHADOW_H = 1 then echo $ac_n "checking for setspent in -lshadow""... $ac_c" 1>&6 ! echo "configure:2240: checking for setspent in -lshadow" >&5 ac_lib_var=`echo shadow'_'setspent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2224,2230 **** ac_save_LIBS="$LIBS" LIBS="-lshadow $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2255,2261 ---- setspent() ; return 0; } EOF ! if { (eval echo configure:2259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2417,2428 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:2421: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> --- 2437,2448 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:2441: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> *************** *** 2430,2436 **** DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:2434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else --- 2450,2456 ---- DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:2454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else *************** *** 2455,2461 **** # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:2459: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2475,2481 ---- # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:2479: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2463,2469 **** ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2494,2500 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2496,2502 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:2500: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2516,2522 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:2520: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2504,2510 **** ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2535,2541 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:2539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2538,2549 **** fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2542: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 2558,2569 ---- fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2562: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 2551,2557 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2571,2577 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 2568,2574 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 2588,2594 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 2586,2592 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 2606,2612 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 2607,2613 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 2627,2633 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 2618,2624 **** exit (0); } EOF ! if { (eval echo configure:2622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else --- 2638,2644 ---- exit (0); } EOF ! if { (eval echo configure:2642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else *************** *** 2645,2661 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2649: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2665,2681 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2669: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 2683,2694 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:2687: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2707: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else --- 2757,2763 ---- ; return 0; } EOF ! if { (eval echo configure:2761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else *************** *** 2758,2769 **** fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:2762: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 2778,2789 ---- fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:2782: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 2791,2802 **** fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:2795: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 2811,2822 ---- fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:2815: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 2804,2810 **** struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:2808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else --- 2824,2830 ---- struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:2828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else *************** *** 2828,2839 **** for ac_func in getcwd mkdir strdup strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2832: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2852: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2876,2882 ---- ; return 0; } EOF ! if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *** vcdb.c.dist Sat Dec 23 16:55:29 2000 --- vcdb.c Sat Dec 23 16:56:55 2000 *************** *** 759,768 **** return(0); } ! void vclose() ! { ! } #ifdef IP_ALIAS_DOMAINS int vget_ip_map( char *ip, char *domain, int domain_size) --- 759,770 ---- return(0); } ! #ifndef POP_AUTH_USE_MYSQL ! void vclose() ! { ! } ! #endif #ifdef IP_ALIAS_DOMAINS int vget_ip_map( char *ip, char *domain, int domain_size) *** ../vpopmail-4.9.7/vmysql.c Thu Dec 14 10:40:29 2000 --- vmysql.c Sat Dec 23 14:27:23 2000 *************** *** 555,661 **** return(0); } - void vopen_smtp_relay() - { - char *ipaddr; - time_t mytime; - int err; - - mytime = time(NULL); - ipaddr = getenv("TCPREMOTEIP"); - if ( ipaddr == NULL ) { - return; - } - - if ( ipaddr != NULL && ipaddr[0] == ':') { - ipaddr +=2; - while(*ipaddr!=':') ++ipaddr; - ++ipaddr; - } - - if ( (err=vauth_open()) != 0 ) exit(0); - - sprintf( SqlBuf, - "replace into relay ( ip_addr, timestamp ) values ( '%s', %d )", - ipaddr, (int)mytime); - if (mysql_query(&mysql,SqlBuf)) { - vcreate_relay_table(); - - sprintf( SqlBuf, - "replace into relay ( ip_addr, timestamp ) values ( '%s', %d )", - ipaddr, (int)mytime); - if (mysql_query(&mysql,SqlBuf)) { - fprintf(stderr, "error inserting into ip_addr table\n"); - } - } - res = mysql_store_result(&mysql); - mysql_free_result(res); - return; - } - - void vupdate_rules(int fdm) - { - sprintf(SqlBuf, "select ip_addr from relay"); - if (mysql_query(&mysql,SqlBuf)) { - vcreate_relay_table(); - sprintf(SqlBuf, "select ip_addr from relay"); - if (mysql_query(&mysql,SqlBuf)) { - printf("vmysql: vupdate_rules could not create relay table\n"); - return; - } - } - if (!(res = mysql_use_result(&mysql))) { - printf("vsql_getpw: store result failed\n"); - return; - } - while((row = mysql_fetch_row(res))) { - sprintf(SqlBuf, "%s:allow,RELAYCLIENT=\"\"\n", row[0]); - write(fdm,SqlBuf, slen(SqlBuf)); - } - mysql_free_result(res); - - } - - void vclear_open_smtp(time_t clear_minutes, time_t mytime) - { - time_t delete_time; - int err; - - if ( (err=vauth_open()) != 0 ) exit(0); - delete_time = mytime - clear_minutes; - - sprintf( SqlBuf, "delete from relay where timestamp <= %d", - (int)delete_time); - if (mysql_query(&mysql,SqlBuf)) { - vcreate_relay_table(); - return; - } - } - - void vcreate_relay_table() - { - sprintf( SqlBuf, "create table relay ( %s )", RELAY_TABLE_LAYOUT ); - if (mysql_query(&mysql,SqlBuf)) { - fprintf(stderr, "could not create relay table %s\n", SqlBuf); - return; - } - res = mysql_store_result(&mysql); - mysql_free_result(res); - return; - } - int vmkpasswd( char *domain ) { return(0); - } - - void vclose() - { - /* disconnection from the database */ - if ( is_open == 1 ) { - is_open = 0; - mysql_close(&mysql); - } } #ifdef IP_ALIAS_DOMAINS --- 555,563 ---- *** ../vpopmail-4.9.7/vmysql.h Thu Dec 14 10:29:06 2000 --- vmysql.h Sat Dec 23 16:59:44 2000 *************** *** 22,30 **** #define VPOPMAIL_MYSQL_H /* Edit to match your set up */ ! #define MYSQL_SERVER "localhost" #define MYSQL_USER "root" ! #define MYSQL_PASSWD "gipgap" /* End of setup section*/ /* defaults - no need to change */ --- 22,30 ---- #define VPOPMAIL_MYSQL_H /* Edit to match your set up */ ! #define MYSQL_SERVER "localhost" #define MYSQL_USER "root" ! #define MYSQL_PASSWD "secret" /* End of setup section*/ /* defaults - no need to change */ *************** *** 51,58 **** pw_gecos varchar(255), \ pw_dir varchar(255), \ pw_shell varchar(255), primary key(pw_name)" - - #define RELAY_TABLE_LAYOUT "ip_addr char(18) not null, timestamp char(12), unique index (ip_addr)" #define SMALL_SITE 0 #define LARGE_SITE 1 --- 51,56 ---- *** ../vpopmail-4.9.7/vopen_smtp.c Sat Dec 23 17:01:38 2000 --- vopen_smtp.c Sat Dec 23 09:18:34 2000 *************** *** 0 **** --- 1,208 ---- + /* + * vopen_smtp.c + * part of the vpopmail package + * + * Copyright (C) 1999 Inter7 Internet Technologies, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + #include + #include + #include + #include + #include + #include + #include + #include "/usr/local/include/mysql/mysql.h" + #include "config.h" + #include "safestring.h" + #include "vpopmail.h" + #include "vauth.h" + #include "vopen_smtp.h" + + + static int is_open = 0; + static MYSQL mysql; + static MYSQL_RES *res = NULL; + /* static MYSQL_RES *res1 = NULL; */ + + #ifdef IP_ALIAS_DOMAINS + static MYSQL_RES *res2 = NULL; + #endif + + static MYSQL_ROW row; + + #define SQL_BUF_SIZE 600 + static char SqlBuf[SQL_BUF_SIZE]; + /* static char SqlBuf1[SQL_BUF_SIZE]; */ + + #define SMALL_BUFF 200 + char IUser[SMALL_BUFF]; + char IPass[SMALL_BUFF]; + char IGecos[SMALL_BUFF]; + char IDir[SMALL_BUFF]; + char IShell[SMALL_BUFF]; + + void vcreate_relay_table(); + void vcreate_dir_control(); + + int vauth_open() + { + if ( is_open == 1 ) return(0); + + is_open = 1; + mysql_init(&mysql); + + if (!(mysql_real_connect(&mysql,MYSQL_SERVER,MYSQL_USER,MYSQL_PASSWD, + MYSQL_DATABASE, 0,NULL,0))) { + if (!(mysql_real_connect(&mysql,MYSQL_SERVER,MYSQL_USER,MYSQL_PASSWD, + NULL, 0,NULL,0))) { + fprintf(stderr, "could not connect to mysql server\n"); + return(VA_NO_AUTH_CONNECTION); + } + + sprintf( SqlBuf, "create database %s", MYSQL_DATABASE ); + if (mysql_query(&mysql,SqlBuf)) { + fprintf(stderr, "could not create %s database\n", + MYSQL_DATABASE); + return(-1); + } + res = mysql_store_result(&mysql); + mysql_free_result(res); + if (mysql_select_db(&mysql,MYSQL_DATABASE)) { + fprintf(stderr, "could not enter %s database\n", + MYSQL_DATABASE); + return(-1); + } + + } + return(0); + } + + char *vauth_munch_domain( char *domain ) + { + int i; + static char tmpbuf[50]; + + if ( domain == NULL || domain[0] == 0 ) return(domain); + + for(i=0;domain[i]!=0;++i){ + tmpbuf[i] = domain[i]; + if ( domain[i] == '.' || domain[i] == '-' ) { + tmpbuf[i] = MYSQL_DOT_CHAR; + } + } + tmpbuf[i] = 0; + return(tmpbuf); + } + + void vopen_smtp_relay() + { + char *ipaddr; + time_t mytime; + int err; + + mytime = time(NULL); + ipaddr = getenv("TCPREMOTEIP"); + if ( ipaddr == NULL ) { + return; + } + + if ( ipaddr != NULL && ipaddr[0] == ':') { + ipaddr +=2; + while(*ipaddr!=':') ++ipaddr; + ++ipaddr; + } + + if ( (err=vauth_open()) != 0 ) exit(0); + + sprintf( SqlBuf, + "replace into relay ( ip_addr, timestamp ) values ( '%s', %d )", + ipaddr, (int)mytime); + if (mysql_query(&mysql,SqlBuf)) { + vcreate_relay_table(); + + sprintf( SqlBuf, + "replace into relay ( ip_addr, timestamp ) values ( '%s', %d )", + ipaddr, (int)mytime); + if (mysql_query(&mysql,SqlBuf)) { + fprintf(stderr, "error inserting into ip_addr table\n"); + } + } + res = mysql_store_result(&mysql); + mysql_free_result(res); + return; + } + + void vupdate_rules(int fdm) + { + sprintf(SqlBuf, "select ip_addr from relay"); + if (mysql_query(&mysql,SqlBuf)) { + vcreate_relay_table(); + sprintf(SqlBuf, "select ip_addr from relay"); + if (mysql_query(&mysql,SqlBuf)) { + printf("vmysql: vupdate_rules could not create relay table\n"); + return; + } + } + if (!(res = mysql_use_result(&mysql))) { + printf("vsql_getpw: store result failed\n"); + return; + } + while((row = mysql_fetch_row(res))) { + sprintf(SqlBuf, "%s:allow,RELAYCLIENT=\"\"\n", row[0]); + write(fdm,SqlBuf, slen(SqlBuf)); + } + mysql_free_result(res); + + } + + void vclear_open_smtp(time_t clear_minutes, time_t mytime) + { + time_t delete_time; + int err; + + if ( (err=vauth_open()) != 0 ) exit(0); + delete_time = mytime - clear_minutes; + + sprintf( SqlBuf, "delete from relay where timestamp <= %d", + (int)delete_time); + if (mysql_query(&mysql,SqlBuf)) { + vcreate_relay_table(); + return; + } + } + + void vcreate_relay_table() + { + sprintf( SqlBuf, "create table relay ( %s )", RELAY_TABLE_LAYOUT ); + if (mysql_query(&mysql,SqlBuf)) { + fprintf(stderr, "could not create relay table %s\n", SqlBuf); + return; + } + res = mysql_store_result(&mysql); + mysql_free_result(res); + return; + } + + void vclose() + { + /* disconnection from the database */ + if ( is_open == 1 ) { + is_open = 0; + mysql_close(&mysql); + } + } + *** ../vpopmail-4.9.7/vopen_smtp.h Sat Dec 23 17:01:39 2000 --- vopen_smtp.h Sat Dec 23 09:15:16 2000 *************** *** 0 **** --- 1,34 ---- + /* + * vopen_smtp.h + * part of the vchkpw package + * + * Copyright (C) 1999 Inter7 Internet Technologies, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + #define VPOPMAIL_MYSQL_H + + /* Edit to match your set up */ + #define MYSQL_SERVER "localhost" + #define MYSQL_USER "root" + #define MYSQL_PASSWD "secret" + /* End of setup section*/ + + /* defaults - no need to change */ + #define MYSQL_DEFAULT_TABLE "vpopmail" + #define MYSQL_DATABASE "vpopmail" + #define MYSQL_DOT_CHAR '_' + + #define RELAY_TABLE_LAYOUT "ip_addr char(18) not null, timestamp char(12), unique index (ip_addr)" *** ../vpopmail-4.9.7/vpopmail.c Thu Dec 14 10:12:45 2000 --- vpopmail.c Sat Dec 23 14:22:29 2000 *************** *** 1681,1687 **** int open_smtp_relay() { #ifdef POP_AUTH_OPEN_RELAY ! #ifdef USE_SQL vopen_smtp_relay(); update_rules(); #else --- 1681,1687 ---- int open_smtp_relay() { #ifdef POP_AUTH_OPEN_RELAY ! #ifdef POP_AUTH_USE_MYSQL vopen_smtp_relay(); update_rules(); #else *************** *** 1814,1820 **** FILE *fs; unsigned long pid; int wstat; ! #ifndef USE_SQL char *tmpstr; #endif --- 1814,1820 ---- FILE *fs; unsigned long pid; int wstat; ! #ifndef POP_AUTH_USE_MYSQL char *tmpstr; #endif *************** *** 1823,1829 **** return; } ! #ifdef USE_SQL vupdate_rules(fdm); #else fs = fopen(OPEN_SMTP_CUR_FILE, "r"); --- 1823,1829 ---- return; } ! #ifdef POP_AUTH_USE_MYSQL vupdate_rules(fdm); #else fs = fopen(OPEN_SMTP_CUR_FILE, "r");