http://sourceforge.net/p/qmailadmin/patches/28/ Add a call to cracklib to enforce strong passwords. Requires some combination of aclocal/automake/autoconf to create a new configure file. Applies cleanly to 1.2.9 or earlier. Index: user.c =================================================================== --- user.c (revision 7) +++ user.c (revision 10) @@ -37,6 +37,9 @@ #include "qmailadminx.h" #include "vpopmail.h" #include "vauth.h" +#ifdef CRACKLIB +# include +#endif #define HOOKS 1 @@ -762,6 +765,14 @@ vclose(); exit(0); } +#ifdef CRACKLIB + if ((tmpstr = FascistCheck(Password1, CRACKLIB)) != NULL ) { + sprintf(StatusMessage, "Bad password - %s\n", tmpstr); + moduser(); + vclose(); + exit(0); + } +#endif ret_code = vpasswd( ActionUser, Domain, Password1, USE_POP); if ( ret_code != VA_SUCCESS ) { sprintf(StatusMessage, "%s (%s)", get_html_text("140"), Index: configure.in =================================================================== --- configure.in (revision 7) +++ configure.in (revision 10) @@ -27,6 +27,7 @@ dnl Checks for libraries. AC_CHECK_LIB(crypt,crypt) AC_CHECK_LIB(shadow,crypt) +AC_CHECK_LIB(crack,FascistCheck) #AC_CHECK_LIB(m,floor) #AC_CHECK_LIB(nsl, gethostbyaddr) #AC_CHECK_LIB(socket, getsockname) @@ -370,6 +371,31 @@ AC_DEFINE_UNQUOTED(SPAM_COMMAND, "$spam_command","") AC_SUBST(SPAM_COMMAND) +cracklib=no +AC_ARG_ENABLE(cracklib, [ --enable-cracklib=PATH Path to cracklib dictionary.], + cracklib="$enableval", + [ + if test "$cracklib" = "" + then + AC_MSG_ERROR([Unable to find your cracklib directory, specify --enable-cracklib.]) + fi + ] ) + +if test "$cracklib" = "yes" +then + cracklib="/usr/lib/cracklib_dict" +fi + +case $cracklib in +0*|n*|N*) + echo "checking whether to use password checking... no" + ;; +*) + AC_DEFINE_UNQUOTED(CRACKLIB,"$cracklib","") + echo "checking whether to use password checking... yes" + ;; +esac + HELP=no AC_ARG_ENABLE(help, [ --enable-help Display help links on login page.], HELP="$enableval",) @@ -432,4 +458,7 @@ then echo " spam command = "$spam_command"" fi - +if test "$cracklib" != "no" +then + echo "cracklib dictionary= "$cracklib"" +fi