Skip to content

Commit

Permalink
Merge pull request #5 from sagredo-dev/pwd-strength
Browse files Browse the repository at this point in the history
Password strength enforcement
  • Loading branch information
sagredo-dev authored Dec 18, 2024
2 parents 4f57da4 + 55d6122 commit ca75d16
Show file tree
Hide file tree
Showing 21 changed files with 3,035 additions and 1,968 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,34 @@ Makefile

# vpopmail
vauth.c
authvchkpw
clearopensmtp
dotqmail2valias
vaddaliasdomain
vadddomain
vadduser
valias
vchangepw
vchkpw
vconvert
vdeldomain
vdelivermail
vdeloldusers
vdeluser
vdominfo
vipmap
vkill
vlist
vmakedotqmail
vmkpasswd
vmoddomlimits
vmoduser
vpasswd
vpopbull
vpopmaild
vrcptcheck
vsavealiasdomains
vsetuserquota
vusagec
vuserinfo
vverifypw
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Numbers in square brackets ([]) are tracker items on SourceForge with patch
or info related to the entry. <http://sourceforge.net/projects/vpopmail/>

unreleased
- Added configurable password strength enforcement (Matt Brookings' 5.5.0-dev version)
- Dropped min pwd length feature

5.6.3 - Released Oct 19, 2024
- bug fixed: passwords with length > 8 were denied if sha-512 was disabled

Expand Down
19 changes: 12 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ else
EXTRA_DIST=README.* vcdb.c vldap.c vmysql.c voracle.pc vpgsql.c vsybase.c
endif

noinst_HEADERS=md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h vutil.h vlogger.h
noinst_HEADERS=md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h vutil.h vlogger.h pwstr.h

COMMONSOURCES=vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c backfill.c client.c conf.c ippp.c vlogger.c
COMMONSOURCES=vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c backfill.c client.c conf.c ippp.c vlogger.c pwstr.c

CONFIG_CLEAN_FILES=vauth.c
CONFIG_CLEAN_FILES=vauth.c
if BUILD_CDB
CONFIG_CLEAN_FILES+=cdb/conf-cc cdb/conf-ld cdb/compile cdb/load
CONFIG_CLEAN_FILES+=cdb/conf-cc cdb/conf-ld cdb/compile cdb/load
endif

INSTALL_PROGRAM= ${INSTALL} -o @vpopuser@ -m 711 -g @vpopgroup@ $(AM_INSTALL_PROGRAM_FLAGS)
Expand All @@ -29,10 +29,11 @@ MYSQLCONF=$(DESTDIR)@vpopmaildir@/etc/vpopmail.mysql
VLIMITS=$(DESTDIR)@vpopmaildir@/etc/vlimits.default
VUSAGECCONF=$(DESTDIR)@vpopmaildir@/etc/vusagec.conf
DOVECOT_SQL=$(DESTDIR)@vpopmaildir@/etc/disable-many-domains_procedures.sql
PWD_STRENGTH=$(DESTDIR)@vpopmaildir@/etc/password_strength.conf

noinst_LIBRARIES=libvpopmail.a

libvpopmail_a_SOURCES=$(COMMONSOURCES)
libvpopmail_a_SOURCES=$(COMMONSOURCES)
if BUILD_CDB
libvpopmail_a_LIBADD = cdb/*.o
endif
Expand All @@ -48,7 +49,7 @@ vpopmailbin_PROGRAMS = vchkpw vdelivermail clearopensmtp vadddomain \

vusagec_SOURCES = vusagec.c client.c conf.c ippp.c
vusagec_LDADD = libvpopmail.a @auth_libs@

vuserinfo_SOURCES = vuserinfo.c maildirquota.c
vuserinfo_LDADD = libvpopmail.a @auth_libs@

Expand Down Expand Up @@ -156,7 +157,7 @@ vusage-msg:
@echo " Then follow the INSTALL file to install"
@echo ""
@echo "****************************************************"
@echo ""
@echo ""

install-exec-am:
for d in bin doc etc include lib ; do \
Expand Down Expand Up @@ -192,6 +193,10 @@ install-data-local:
vlimits.default $(VLIMITS); \
fi

if test ! -r $(PWD_STRENGTH); then \
$(INSTALL) -m 644 password_strength.conf $(PWD_STRENGTH); \
fi

if test "@USE_MYSQL@" = "1"; then \
if test ! -r $(MYSQLCONF); then \
echo "# MYSQL CONNECTION SETTINGS FOR VPOPMAIL" >> $(MYSQLCONF); \
Expand Down
96 changes: 61 additions & 35 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.2 from Makefile.am.
# Makefile.in generated by automake 1.17 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# Copyright (C) 1994-2024 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -74,6 +74,8 @@ am__make_running_with_option = \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
am__rm_f = rm -f $(am__rm_f_notfound)
am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
Expand All @@ -92,7 +94,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@BUILD_CDB_TRUE@am__append_1 = cdb/conf-cc cdb/conf-ld cdb/compile cdb/load
@BUILD_CDB_TRUE@am__append_1 = cdb/conf-cc cdb/conf-ld cdb/compile cdb/load
vpopmailbin_PROGRAMS = vchkpw$(EXEEXT) vdelivermail$(EXEEXT) \
clearopensmtp$(EXEEXT) vadddomain$(EXEEXT) vdeldomain$(EXEEXT) \
vpasswd$(EXEEXT) vadduser$(EXEEXT) vdeluser$(EXEEXT) \
Expand Down Expand Up @@ -121,12 +123,13 @@ am__installdirs = "$(DESTDIR)$(vpopmailbindir)"
PROGRAMS = $(vpopmailbin_PROGRAMS)
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
ARFLAGS = cr
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libvpopmail_a_AR = $(AR) $(ARFLAGS)
libvpopmail_a_RANLIB = $(RANLIB)
@BUILD_CDB_TRUE@libvpopmail_a_DEPENDENCIES = cdb/*.o
am__objects_1 = libvpopmail_a-vpopmail.$(OBJEXT) \
libvpopmail_a-md5.$(OBJEXT) libvpopmail_a-bigdir.$(OBJEXT) \
Expand All @@ -138,7 +141,8 @@ am__objects_1 = libvpopmail_a-vpopmail.$(OBJEXT) \
libvpopmail_a-vutil.$(OBJEXT) libvpopmail_a-vlistlib.$(OBJEXT) \
libvpopmail_a-backfill.$(OBJEXT) \
libvpopmail_a-client.$(OBJEXT) libvpopmail_a-conf.$(OBJEXT) \
libvpopmail_a-ippp.$(OBJEXT) libvpopmail_a-vlogger.$(OBJEXT)
libvpopmail_a-ippp.$(OBJEXT) libvpopmail_a-vlogger.$(OBJEXT) \
libvpopmail_a-pwstr.$(OBJEXT)
am_libvpopmail_a_OBJECTS = $(am__objects_1)
libvpopmail_a_OBJECTS = $(am_libvpopmail_a_OBJECTS)
am_authvchkpw_OBJECTS = authvchkpw.$(OBJEXT) hmac_md5.$(OBJEXT)
Expand Down Expand Up @@ -335,20 +339,17 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = cdb
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
ChangeLog compile config.guess config.sub install-sh ltmain.sh \
missing mkinstalldirs
ChangeLog README.md compile config.guess config.sub install-sh \
ltmain.sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \
; rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
Expand Down Expand Up @@ -378,12 +379,16 @@ am__relativize = \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
GZIP_ENV = -9
DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
distcleancheck_listfiles = \
find . \( -type f -a \! \
\( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
Expand All @@ -394,15 +399,17 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = -I. @auth_inc@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
Expand Down Expand Up @@ -441,8 +448,10 @@ ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@
am__untar = @am__untar@
am__xargs_n = @am__xargs_n@
auth_inc = @auth_inc@
auth_libs = @auth_libs@
bindir = @bindir@
Expand Down Expand Up @@ -493,15 +502,16 @@ vpopuser = @vpopuser@
@BUILD_CDB_TRUE@SUBDIRS = cdb
@BUILD_CDB_FALSE@EXTRA_DIST = README.* vcdb.c vldap.c vmysql.c voracle.pc vpgsql.c vsybase.c
@BUILD_CDB_TRUE@EXTRA_DIST = README.* cdb/* vcdb.c vldap.c vmysql.c voracle.pc vpgsql.c vsybase.c
noinst_HEADERS = md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h vutil.h vlogger.h
COMMONSOURCES = vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c backfill.c client.c conf.c ippp.c vlogger.c
noinst_HEADERS = md5.h vpopmail.h file_lock.h vauth.h vlimits.h maildirquota.h vcdb.h vldap.h vmysql.h voracle.h vpgsql.h vsybase.h vlog.h global.h hmac_md5.h seek.h vutil.h vlogger.h pwstr.h
COMMONSOURCES = vpopmail.c md5.c bigdir.c vauth.c file_lock.c vpalias.c seek.c vlimits.c maildirquota.c vutil.c vlistlib.c backfill.c client.c conf.c ippp.c vlogger.c pwstr.c
CONFIG_CLEAN_FILES = vauth.c $(am__append_1)
MYSQLCONF = $(DESTDIR)@vpopmaildir@/etc/vpopmail.mysql
VLIMITS = $(DESTDIR)@vpopmaildir@/etc/vlimits.default
VUSAGECCONF = $(DESTDIR)@vpopmaildir@/etc/vusagec.conf
DOVECOT_SQL = $(DESTDIR)@vpopmaildir@/etc/disable-many-domains_procedures.sql
PWD_STRENGTH = $(DESTDIR)@vpopmaildir@/etc/password_strength.conf
noinst_LIBRARIES = libvpopmail.a
libvpopmail_a_SOURCES = $(COMMONSOURCES)
libvpopmail_a_SOURCES = $(COMMONSOURCES)
@BUILD_CDB_TRUE@libvpopmail_a_LIBADD = cdb/*.o
libvpopmail_a_CFLAGS = -fPIC
vpopmailbindir = @vpopmaildir@/bin
Expand Down Expand Up @@ -613,12 +623,12 @@ config.h: stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1

stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(AM_V_at)rm -f stamp-h1
$(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
$(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER))
$(AM_V_at)rm -f stamp-h1
$(AM_V_at)touch $@

distclean-hdr:
-rm -f config.h stamp-h1
Expand Down Expand Up @@ -660,18 +670,18 @@ uninstall-vpopmailbinPROGRAMS:
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(vpopmailbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(vpopmailbindir)" && rm -f $$files
cd "$(DESTDIR)$(vpopmailbindir)" && $(am__rm_f) $$files

clean-vpopmailbinPROGRAMS:
-test -z "$(vpopmailbin_PROGRAMS)" || rm -f $(vpopmailbin_PROGRAMS)
-$(am__rm_f) $(vpopmailbin_PROGRAMS)

clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-$(am__rm_f) $(noinst_LIBRARIES)

libvpopmail.a: $(libvpopmail_a_OBJECTS) $(libvpopmail_a_DEPENDENCIES) $(EXTRA_libvpopmail_a_DEPENDENCIES)
$(AM_V_at)-rm -f libvpopmail.a
$(AM_V_AR)$(libvpopmail_a_AR) libvpopmail.a $(libvpopmail_a_OBJECTS) $(libvpopmail_a_LIBADD)
$(AM_V_at)$(RANLIB) libvpopmail.a
$(AM_V_at)$(libvpopmail_a_RANLIB) libvpopmail.a

authvchkpw$(EXEEXT): $(authvchkpw_OBJECTS) $(authvchkpw_DEPENDENCIES) $(EXTRA_authvchkpw_DEPENDENCIES)
@rm -f authvchkpw$(EXEEXT)
Expand Down Expand Up @@ -905,6 +915,12 @@ libvpopmail_a-vlogger.o: vlogger.c
libvpopmail_a-vlogger.obj: vlogger.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvpopmail_a_CFLAGS) $(CFLAGS) -c -o libvpopmail_a-vlogger.obj `if test -f 'vlogger.c'; then $(CYGPATH_W) 'vlogger.c'; else $(CYGPATH_W) '$(srcdir)/vlogger.c'; fi`

libvpopmail_a-pwstr.o: pwstr.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvpopmail_a_CFLAGS) $(CFLAGS) -c -o libvpopmail_a-pwstr.o `test -f 'pwstr.c' || echo '$(srcdir)/'`pwstr.c

libvpopmail_a-pwstr.obj: pwstr.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvpopmail_a_CFLAGS) $(CFLAGS) -c -o libvpopmail_a-pwstr.obj `if test -f 'pwstr.c'; then $(CYGPATH_W) 'pwstr.c'; else $(CYGPATH_W) '$(srcdir)/pwstr.c'; fi`

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
Expand Down Expand Up @@ -1010,13 +1026,12 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files

distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am

distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
$(AM_V_at)$(MKDIR_P) "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
Expand Down Expand Up @@ -1130,7 +1145,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
Expand All @@ -1140,7 +1155,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
Expand All @@ -1160,7 +1175,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
Expand Down Expand Up @@ -1242,8 +1257,8 @@ mostlyclean-generic:
clean-generic:

distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
Expand Down Expand Up @@ -1357,7 +1372,7 @@ vusage-msg:
@echo " Then follow the INSTALL file to install"
@echo ""
@echo "****************************************************"
@echo ""
@echo ""

install-exec-am:
for d in bin doc etc include lib ; do \
Expand Down Expand Up @@ -1393,6 +1408,10 @@ install-data-local:
vlimits.default $(VLIMITS); \
fi

if test ! -r $(PWD_STRENGTH); then \
$(INSTALL) -m 644 password_strength.conf $(PWD_STRENGTH); \
fi

if test "@USE_MYSQL@" = "1"; then \
if test ! -r $(MYSQLCONF); then \
echo "# MYSQL CONNECTION SETTINGS FOR VPOPMAIL" >> $(MYSQLCONF); \
Expand Down Expand Up @@ -1464,3 +1483,10 @@ pre-dist:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

# Tell GNU make to disable its built-in pattern rules.
%:: %,v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%
Loading

0 comments on commit ca75d16

Please sign in to comment.