Added suuport for vpopmail

This commit is contained in:
Michiel Broek 2002-02-24 21:20:25 +00:00
parent 2013b2bb89
commit f708e66b94
7 changed files with 84 additions and 13 deletions

View File

@ -4594,6 +4594,8 @@ v0.33.20 10-Feb-2002
installed as user mbse. The location of the source isn't installed as user mbse. The location of the source isn't
important anymore to install the maptabs. important anymore to install the maptabs.
Updated German, Spanish and Galego languages. Updated German, Spanish and Galego languages.
The location of the sourcefiles is not important anymore.
Added detection of vpopmail in default installation path.
common.a: common.a:
Added 2 functions to return the OS name and CPU family. Added 2 functions to return the OS name and CPU family.
@ -4665,3 +4667,12 @@ v0.33.20 10-Feb-2002
hatch: hatch:
A new shellscript to hatch files in a tic area. A new shellscript to hatch files in a tic area.
mbuseradd:
Added support for vpopmail, vadduser command.
mbpasswd:
Added support for vpopmail, vpasswd command.
mbuser:
Added support for vpopmail, vdeluser command.

View File

@ -105,6 +105,9 @@
/* Define to support /etc/login.access login access control. */ /* Define to support /etc/login.access login access control. */
#undef LOGIN_ACCESS #undef LOGIN_ACCESS
/* Path to vpopmail. */
#undef _VPOPMAIL_PATH
/* Path for wtmp file. */ /* Path for wtmp file. */
#undef _WTMP_FILE #undef _WTMP_FILE

39
configure vendored
View File

@ -5501,6 +5501,23 @@ echo "${ECHO_T}$logdir" >&6
fi fi
done done
echo "$as_me:5504: checking location of vpopmail" >&5
echo $ECHO_N "checking location of vpopmail... $ECHO_C" >&6
for vpop in /var/qmail/vpopmail/bin NONE; do
if test "$vpop" = "NONE"; then
echo "$as_me:5508: result: not found" >&5
echo "${ECHO_T}not found" >&6
elif test -x $vpop/vadduser; then
cat >>confdefs.h <<EOF
#define _VPOPMAIL_PATH "$vpop"
EOF
echo "$as_me:5515: result: $vpop" >&5
echo "${ECHO_T}$vpop" >&6
break
fi
done
ac_config_files="$ac_config_files Makefile.global mbfido/paths.h unix/login.defs INSTALL FILE_ID.DIZ" ac_config_files="$ac_config_files Makefile.global mbfido/paths.h unix/login.defs INSTALL FILE_ID.DIZ"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -5581,7 +5598,7 @@ DEFS=-DHAVE_CONFIG_H
: ${CONFIG_STATUS=./config.status} : ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS" ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:5584: creating $CONFIG_STATUS" >&5 { echo "$as_me:5601: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;} echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL #! $SHELL
@ -5756,7 +5773,7 @@ cat >>$CONFIG_STATUS <<\EOF
echo "$ac_cs_version"; exit 0 ;; echo "$ac_cs_version"; exit 0 ;;
--he | --h) --he | --h)
# Conflict between --help and --header # Conflict between --help and --header
{ { echo "$as_me:5759: error: ambiguous option: $1 { { echo "$as_me:5776: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5 Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1 echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;} Try \`$0 --help' for more information." >&2;}
@ -5784,12 +5801,12 @@ Try \`$0 --help' for more information." >&2;}
'config.h' ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; 'config.h' ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
# This is an error. # This is an error.
-*) { { echo "$as_me:5787: error: unrecognized option: $1 -*) { { echo "$as_me:5804: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5 Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1 echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;} Try \`$0 --help' for more information." >&2;}
{ (exit 1); exit 1; }; } ;; { (exit 1); exit 1; }; } ;;
*) { { echo "$as_me:5792: error: invalid argument: $1" >&5 *) { { echo "$as_me:5809: error: invalid argument: $1" >&5
echo "$as_me: error: invalid argument: $1" >&2;} echo "$as_me: error: invalid argument: $1" >&2;}
{ (exit 1); exit 1; }; };; { (exit 1); exit 1; }; };;
esac esac
@ -6028,7 +6045,7 @@ done; }
esac esac
if test x"$ac_file" != x-; then if test x"$ac_file" != x-; then
{ echo "$as_me:6031: creating $ac_file" >&5 { echo "$as_me:6048: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;} echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file" rm -f "$ac_file"
fi fi
@ -6046,7 +6063,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;; -) echo $tmp/stdin ;;
[\\/$]*) [\\/$]*)
# Absolute (can't be DOS-style, as IFS=:) # Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:6049: error: cannot find input file: $f" >&5 test -f "$f" || { { echo "$as_me:6066: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;} echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
echo $f;; echo $f;;
@ -6059,7 +6076,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f echo $srcdir/$f
else else
# /dev/null tree # /dev/null tree
{ { echo "$as_me:6062: error: cannot find input file: $f" >&5 { { echo "$as_me:6079: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;} echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi;; fi;;
@ -6119,7 +6136,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;; * ) ac_file_in=$ac_file.in ;;
esac esac
test x"$ac_file" != x- && { echo "$as_me:6122: creating $ac_file" >&5 test x"$ac_file" != x- && { echo "$as_me:6139: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;} echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the # First look for the input files in the build tree, otherwise in the
@ -6130,7 +6147,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;; -) echo $tmp/stdin ;;
[\\/$]*) [\\/$]*)
# Absolute (can't be DOS-style, as IFS=:) # Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || { { echo "$as_me:6133: error: cannot find input file: $f" >&5 test -f "$f" || { { echo "$as_me:6150: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;} echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
echo $f;; echo $f;;
@ -6143,7 +6160,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f echo $srcdir/$f
else else
# /dev/null tree # /dev/null tree
{ { echo "$as_me:6146: error: cannot find input file: $f" >&5 { { echo "$as_me:6163: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;} echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi;; fi;;
@ -6260,7 +6277,7 @@ cat >>$CONFIG_STATUS <<\EOF
rm -f $tmp/in rm -f $tmp/in
if test x"$ac_file" != x-; then if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
{ echo "$as_me:6263: $ac_file is unchanged" >&5 { echo "$as_me:6280: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;} echo "$as_me: $ac_file is unchanged" >&6;}
else else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \

View File

@ -38,10 +38,8 @@ AC_CHECK_PROG(INSTALL, install, install)
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_YACC AC_PROG_YACC
dnl AC_PROG_LEX
AC_CHECK_PROG(TAR, tar, tar) AC_CHECK_PROG(TAR, tar, tar)
AC_CHECK_PROG(ZIP, zip, zip) AC_CHECK_PROG(ZIP, zip, zip)
dnl AM_PROG_LEX
AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:) AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:)
CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes" CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes"
@ -198,6 +196,16 @@ for logdir in /var/log /var/adm /usr/adm /etc; do
fi fi
done done
AC_MSG_CHECKING(location of vpopmail)
for vpop in /var/qmail/vpopmail/bin NONE; do
if test "$vpop" = "NONE"; then
AC_MSG_RESULT(not found)
elif test -x $vpop/vadduser; then
AC_DEFINE_UNQUOTED(_VPOPMAIL_PATH, "$vpop")
AC_MSG_RESULT($vpop)
break
fi
done
AC_OUTPUT( AC_OUTPUT(

View File

@ -176,6 +176,9 @@ void UserPack(int days, int level, int pack)
long oldsize, curpos; long oldsize, curpos;
int updated, delete = 0, rc, highest = 0, record = 0, sysop = FALSE; int updated, delete = 0, rc, highest = 0, record = 0, sysop = FALSE;
time_t Last; time_t Last;
#ifdef _VPOPMAIL_PATH
char *cmd;
#endif
fnin = calloc(PATH_MAX, sizeof(char)); fnin = calloc(PATH_MAX, sizeof(char));
fnout = calloc(PATH_MAX, sizeof(char)); fnout = calloc(PATH_MAX, sizeof(char));
@ -321,6 +324,13 @@ void UserPack(int days, int level, int pack)
#else #else
rc = execute((char *)"/usr/sbin/pw userdel ", usr.Name, NULL, rc = execute((char *)"/usr/sbin/pw userdel ", usr.Name, NULL,
(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");
#endif
#ifdef _VPOPMAIL_PATH
cmd = xstrcpy((char *)_VPOPMAIL_PATH);
cmd = xstrcat(cmd, (char *)"/vdeluser ");
rc = execute(cmd, usr.Name, NULL,
(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");
free(cmd);
#endif #endif
if (chdir(CFG.bbs_usersdir) == 0) if (chdir(CFG.bbs_usersdir) == 0)
rc = execute((char *)"/bin/rm -Rf ", usr.Name, NULL, rc = execute((char *)"/bin/rm -Rf ", usr.Name, NULL,

View File

@ -732,6 +732,7 @@ int main(int argc, char *argv[])
int pfd, tfd; int pfd, tfd;
#endif #endif
char *cp; char *cp;
char temp[128];
/* /*
* Init $MBSE_ROOT/etc/login.defs file before the *pw gets overwritten. * Init $MBSE_ROOT/etc/login.defs file before the *pw gets overwritten.
@ -910,6 +911,17 @@ int main(int argc, char *argv[])
#endif /* __FreeBSD__ */ #endif /* __FreeBSD__ */
#ifdef _VPOPMAIL_PATH
sprintf(temp, "%s/vpasswd %s %s", _VPOPMAIL_PATH, argv[2], argv[3]);
fflush(stdout);
fflush(stdin);
if (system(temp) != 0) {
perror("mbpasswd: Failed to change vpopmail password\n");
syslog(LOG_ERR, "Failed to change vpopmail password");
}
#endif
syslog(LOG_NOTICE, "password for `%s' changed by user `%s'", name, myname); syslog(LOG_NOTICE, "password for `%s' changed by user `%s'", name, myname);
closelog(); closelog();
exit(E_SUCCESS); exit(E_SUCCESS);

View File

@ -267,6 +267,16 @@ int main(int argc, char *argv[])
sprintf(temp, "%s/%s/Maildir/tmp", argv[4], argv[2]); sprintf(temp, "%s/%s/Maildir/tmp", argv[4], argv[2]);
makedir(temp, 0700, pwuser->pw_uid, pwent->pw_gid); makedir(temp, 0700, pwuser->pw_uid, pwent->pw_gid);
#ifdef _VPOPMAIL_PATH
sprintf(temp, "%s/vadduser %s %s", _VPOPMAIL_PATH, argv[2], argv[2]);
fflush(stdout);
fflush(stdin);
if (system(temp) != 0) {
perror("mbuseradd: Failed to create vpopmail account\n");
}
#endif
free(shell); free(shell);
free(PassEnt); free(PassEnt);
free(temp); free(temp);