Commit 2e129e7e authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

Moved checkpassword to dovecot_checkpassword.

Started manpage for dovecot_checkpassword.
Updated debian/rules to use cdbs
Made sure added link from checkpassword to dovecot_checkpassword
parent fe7b69fb
all: docs
man/exim_rewrite_scan.man: sbin/exim_rewrite_scan
man/%.man: ./sbin/%
[ -d man ] || mkdir man
RUBYLIB=./lib ./sbin/exim_rewrite_scan --help | sed -e 's/^=\+$$//' | txt2man -s 1 -t exim_rewrite_scan | sed -e 's/\\\\fB/\\fB/' > man/exim_rewrite_scan.man
RUBYLIB=./lib $< --help | sed -e 's/^=\+$$//' | txt2man -s 1 | sed -e 's/\\\\fB/\\fB/' > $@
docs: man/exim_rewrite_scan.man
docs: man/exim_rewrite_scan.man man/dovecot_checkpassword.man
clean:
$(RM) man/exim_rewrite_scan.man
$(RM) exim4/exim4.conf
$(RM) exim4/exim4.conf.tmp
$(RM) dovecot/dovecot.conf
$(RM) dovecot/dovecot.conf.tmp
$(RM) -r man
/usr/sbin/dovecot_checkpassword /usr/sbin/checkpassword
bytemark-vhost-email (20100517144051) lucid; urgency=low
* Split dovecot config into a multiple file layout (like exim4)
* Unified exim4 and dovecot makefiles
* Exim4 now uses dovecot sasl for authentication.
* Exim4 no longer delays mail following errors in forward files
* Regex in /usr/sbin/checkpassword sanitised
* Bytemark antispam config removed.
-- Patrick J Cherry <patrick@bytemark.co.uk> Mon, 17 May 2010 14:40:51 +0100
bytemark-vhost-email (20090707183051) stable; urgency=low
* Fixed exim4 config to defer mail from non-bytemark antispam hosts if
......
......@@ -3,7 +3,7 @@ Section: mail
Priority: extra
Maintainer: Steve Kemp <steve@bytemark.co.uk>
Uploaders: Patrick J Cherry <patch@bytemark.co.uk>
Build-Depends: debhelper (>= 4.0.0), rdoc, txt2man
Build-Depends: debhelper (>= 4.0.0), rdoc, txt2man, cdbs, perl
Standards-Version: 3.8.0
Package: bytemark-vhost-email
......
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
include /usr/share/cdbs/1/rules/debhelper.mk
configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp
build: build-stamp
make all
build-stamp: configure-stamp
dh_testdir
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
dh_clean
make clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_install
dh_installdocs
dh_installman
dh_installcron cron.d/
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build arch-dependent files here
binary-arch:
# nothing to do
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
......@@ -3,7 +3,7 @@
# http://wiki.dovecot.org/PasswordDatabase/CheckPassword
passdb checkpassword {
# Path for checkpassword binary
args = /usr/sbin/checkpassword
args = /usr/sbin/dovecot_checkpassword
}
......@@ -19,6 +19,8 @@ vhost_forward:
allow_fail
allow_defer
allow_filter
# Syntax errors do not prevent delivery.
skip_syntax_errors
# This stops this router from trying to change uid/gid whilst verifying the
# address by skipping this router. The address will get validated by the
# next router.
......
#!/usr/bin/perl -w
# checkpassword.pl
#
# http://cr.yp.to/checkpwd/interface.html
# http://wiki.dovecot.org/PasswordDatabase/CheckPassword
#
# To test;
# echo -e -n "admin@skxtrial.vm.bytemark.co.uk\0a very secret password\0abc\0andtherest" | ./checkpassword 3<&0 ; echo $?
#
=head1 NAME
dovecot_checkpassword -- Password checking script for dovecot
=cut
=head1 DESCRIPTION
This script is used in checking passwords using the checkpwd interface
developed for qmail against the values set for users of the Bytemark Symbiosis
system.
=cut
=head1 OPTIONS
--help Show the help information for this script.
--manual Read the manual for this script.
=cut
=head1 USAGE
This script reads a username, terminated by NULL, followed by a password
terminated by NULL from file descriptor 3. It then checks the result against
the value in /srv/domain/mailboxes/localpart/password. The result of this
comparison is then returned as an exit status.
The password file can plain text or use any hash supported by crypt(3).
On successful completion, this program returns details about the user's UID,
GUID, home directory, and mailbox based on the ownership of the directory
containing the user's mailbox.
=cut
=head1 EXAMPLES
To test the interface, use the following command
echo -e -n "test@example.com\0a very secret password\0" | dovecot_checkpassword 3<&0 ; echo $?
where "test@example.com" is the username and "a very secret password" is the
password. The exit status determines the result of the lookup.
=cut
=head1 EXIT STATUS
This script returns 0 for success, 1 for permanent failure, and 111 for
temporary failure.
=cut
=head1 SEE ALSO
dovecot(1), http://cr.yp.to/checkpwd/interface.html, http://wiki.dovecot.org/PasswordDatabase/CheckPassword
=cut
=head1 AUTHOR
Patrick J Cherry <patrick@bytemark.co.uk>
=cut
#
use strict;
use User::pwent;
use File::stat;
use Sys::Syslog;
use Getopt::Long;
use Pod::Usage;
my $HELP = 0;
my $MANUAL = 0;
# Parse options.
#
if (
!GetOptions(
"help", \$HELP,
"manual", \$MANUAL
) )
{
exit;
}
pod2usage(1) if $HELP;
pod2usage( -verbose => 2 ) if $MANUAL;
my $VHOST_DIR="srv";
my $VHOST_MAILBOX_DIR="mailboxes";
......@@ -38,7 +116,7 @@ $service = $ENV{'SERVICE'} if defined $ENV{'SERVICE'};
my($length, $buffer);
# Open syslog
openlog("checkpassword","ndelay,perror","mail");
openlog("dovecot_checkpassword","ndelay,perror","mail");
# Read from file descriptor 3
if( open (FD, "<&=3")) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment