Commit 01323bdd 01323bdd87d45a0212e0f9900f058ec6dc338559 by Sergey Poznyakoff

* auth/virtual.c (getpwnam_virtual): Close file.

* doc/texinfo/programs.texi: Document virtmode.
* testsuite/Makefile.am (EXTRA_DIST): Remove
* testsuite/makespool: Remove.
1 parent 11637b0f
2008-10-19 Sergey Poznyakoff <gray@gnu.org.ua>
* auth/virtual.c (getpwnam_virtual): Close file.
* doc/texinfo/programs.texi: Document virtmode.
* testsuite/Makefile.am (EXTRA_DIST): Remove
* testsuite/makespool: Remove.
* NEWS: Update.
* doc/texinfo/libmuauth.texi: Update.
* doc/texinfo/mailutils.texi: Update.
......
......@@ -99,12 +99,15 @@ getpwnam_virtual (const char *u)
free (filename);
if (pfile)
{
while ((pw = fgetpwent (pfile)) != NULL)
{
if (strlen (pw->pw_name) == delim && !strncmp (u, pw->pw_name, delim))
if (strlen (pw->pw_name) == delim
&& strncmp (u, pw->pw_name, delim) == 0)
break;
}
fclose (pfile);
}
return pw;
}
......
......@@ -1617,7 +1617,6 @@ This statement takes effect only if @samp{pam} is listed in
@node Virtdomain Statement
@subsection Virtdomain Statement
@UNREVISED
@kwindex virtdomain
@subheading Syntax
@smallexample
......@@ -1628,8 +1627,49 @@ virtdomain @{
@end smallexample
@subheading Description
The @code{virtdomain} statement configures virtual mail domain
database. @dfn{Virtual mail domain}...@FIXME
@dfn{Virtual mail domains} make it possible to handle several
mail domains each having a separate set of users, on a single server.
The domains are completely independent of each other, i.e. the same
user name can be present in several domains and represent different
users.
When authenticating to a server with virtual domain support enabled,
users must supply their usernames with domain parts. The server strips
off the domain part and uses it as a name of UNIX-format password
database file, located in the @dfn{domain password directory}. The
latter is set using @code{passwd-dir} statement.
@deffn {Configuration} passwd-dir @var{dir}
Set virtual domain password directory.
@end deffn
For example, when authenticating user @samp{smith@@domain.tld},
the server will use password file named @file{@var{dir}/domain.tld}.
This file must be in UNIX passwd format (@pxref{password
file,,,passwd(5), passwd(5) man page}), with encrypted passwords
stored in it (as of GNU Mailutils version @value{VERSION}, there is no
support for shadow files in virtual password directories, although
this is planned for future versions). Here is an example record from
this file:
@smallexample
smith:Wbld/G2Q2Le2w:1000:1000:Email Account:/var/mail/domain/smith:/dev/null
@end smallexample
Notice, that it must contain user names without domain parts.
The @code{pw_dir} field (the 6th field) is used to determine the
location of the maildrop for this user. It is defined as
@file{@var{pw_dir}/INBOX}. In our example, the maildrop for user
@samp{smith} will be located in file @file{/var/mail/domain/smith}.
If user did not supply his domain name, or if no matching record was
found in the password file, or if the file matching the domain name
does not exist, then GNU Mailutils falls back to alternative method.
First, it tries to determine the IP address of the remote party. Then
the domain name corresponding to that address is looked up in the DNS
system. Finally, this domain name is used as a name of the password
file.
@node Radius Statement
@subsection Radius Statement
......
......@@ -17,7 +17,6 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
EXTRA_DIST = makespool
test_dirs = lib etc spool folder
dist-hook:
......
#! /bin/sh
# GNU Mailutils -- a suite of utilities for electronic mail
# Copyright (C) 2002, 2007 Free Software Foundation, Inc.
#
# GNU Mailutils 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 3, or (at your option)
# any later version.
#
# GNU Mailutils 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 GNU Mailutils; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
REGEXP=""
case "$1" in
"-r") shift
rm -rf $*
exit 0;;
"-subst") REGEXP="$2"
shift 2;;
esac
mkdirhier() {
dir=""
for d in `echo $1|sed 's,/, ,g'`
do
dir="$dir/$d"
test -d $dir || mkdir $dir
done
}
while [ $# -gt 0 ]
do
SRCDIR=${1:?}
DSTDIR=${2:?}
shift 2
if [ ! -d $SRCDIR ]; then
echo "$SRCDIR not a directory" >&2
exit 1
fi
if [ ! -r $SRCDIR/DISTFILES ]; then
echo "$SRCDIR/DISTFILES does not exist" >&2
exit 1
fi
mkdirhier $DSTDIR
chmod -R u+w $DSTDIR
rm -rf $DSTDIR/*
cat $SRCDIR/DISTFILES |
while read NAME
do
case "$NAME" in
*.in) newname=`echo $NAME|sed 's/\(.*\)\.in$/\1/'`
sed "$REGEXP" $SRCDIR/$NAME > $DSTDIR/$newname;;
*) newname=$NAME
cp $SRCDIR/$NAME $DSTDIR/$newname;;
esac
chmod u+w $DSTDIR/$newname
done
done