[Date Prev][Date Next] [Chronological] [Thread] [Top]

patch



-----BEGIN PGP SIGNED MESSAGE-----

Patch by Turbo Fredriksson <turbo@nocrew.org>:
Having the whole system (ie, users/groups/hosts etc) in the db, and
have that as a login db duplicates a lot of info (qmailUID -> uidnumber
etc), so having the option to use the first type of db is configured
in the Makefile. These are the changes in keywords:
        Original patch		Turbo's patch
	mail			krbname
	qmailUser		uid
	qmailUID		uidnumber
	qmailGID		gidnumber
	mailMessageStore	homedirectory

Configurable with the option 'USERDB=-DUSE_USERDB' in the Makefile...


diff -urN qmail-1.03.debian_ldap/Makefile qmail-1.03.debian_ldap_turbo/Makefile
- --- qmail-1.03.debian_ldap/Makefile	Wed Jan  5 02:38:50 2000
+++ qmail-1.03.debian_ldap_turbo/Makefile	Wed Jan  5 00:54:05 2000
@@ -22,6 +22,11 @@
 # to enable the auto-homedir-make feature uncomment the next line
 HDIRMAKE=-DAUTOHOMEDIRMAKE
 
+# to use a 'real' user database instead of only a qmail-db (that
+# is, to have the whole system, users/groups etc, in a LDAP db,
+# and not only the qmail users) uncomment the following line.
+USERDB=-DUSE_USERDB
+
 # to have pop3 passwords checked by binding to the ldap-server
 # uncomment the next line
 QLDAPBIND=-DQLDAP_BIND
@@ -360,7 +365,7 @@
 auto_qmail.h fmt.h check.h qlx.h compatibility.h digest_md4.h digest_md5.h \
 digest_rmd160.h digest_sha1.h
 	./compile $(LDAPON) $(SHADOWOPTS) $(PWOPTS) $(HDIRMAKE) $(QLDAPBIND) \
- -	$(DEBUG) $(LDAPINCLUDES) checkpassword.c
+	$(DEBUG) $(LDAPINCLUDES) $(USERDB) checkpassword.c
 
 chkshsgr: \
 load chkshsgr.o
@@ -1331,7 +1336,7 @@
 slurpclose.h auto_qmail.h auto_uids.h qlx.h check.c check.h str.h \
 getln.c getln2.c
 	./compile $(LDAPON) $(LSPAWN_LOG) $(HDIRMAKE) \
- -	$(LDAPINCLUDES) qmail-lspawn.c
+	$(LDAPINCLUDES) $(USERDB) qmail-lspawn.c
 
 qmail-newmrh: \
 load qmail-newmrh.o cdbmss.o getln.a open.a cdbmake.a seek.a case.a \
@@ -1401,7 +1406,7 @@
 substdio.h alloc.h open.h prioq.h datetime.h gen_alloc.h scan.h fmt.h \
 str.h exit.h maildir.h strerr.h readwrite.h timeoutread.h \
 timeoutwrite.h
- -	./compile $(LDAPON) $(MNW) $(MDIRMAKE) qmail-pop3d.c
+	./compile $(LDAPON) $(MNW) $(MDIRMAKE) $(USERDB) qmail-pop3d.c
 
 qmail-popup: \
 load qmail-popup.o commands.o timeoutread.o timeoutwrite.o now.o \
diff -urN qmail-1.03.debian_ldap/QLDAPINSTALL qmail-1.03.debian_ldap_turbo/QLDAPINSTALL
- --- qmail-1.03.debian_ldap/QLDAPINSTALL	Tue Jan  4 23:59:34 2000
+++ qmail-1.03.debian_ldap_turbo/QLDAPINSTALL	Wed Jan  5 09:06:54 2000
@@ -14,6 +14,17 @@
 planned - support for mail clusters
 
 NEWS:
+ Patch by Turbo Fredriksson <turbo@nocrew.org>:
+ Having the whole system (ie, users/groups/hosts etc) in the db, and
+ have that as a login db duplicates a lot of info (qmailUID -> uidnumber
+ etc), so having the option to use the first type of db is configured
+ in the Makefile. These are the changes in keywords:
+	Original patch		Turbo's patch
+	mail			krbname
+	qmailUser		uid
+	qmailUID		uidnumber
+	qmailGID		gidnumber
+	mailMessageStore	homedirectory
 
  a catch all mail for one domain system is now available. The default
  catchall account is "catchall@domain.com". You can change that to any
@@ -124,6 +135,9 @@
    - HDIRMAKE=-DAUTOHOMEDIRMAKE (compiles the auto-HOMEdir-make-patch 
      into the release, you need the ~control/dirmaker file to turn the 
      patch on, see CONFIG FILES)
+   - USERDB=-DUSE_USERDB Lets you have the whole user/group/host etc
+     system in the LDAP db, without duplicating information (qmailUID
+     -> uidnumber etc). See above for changes in the LDIF format.
 
    - QLDAPBIND=-DQLDAP_BIND (when password are checked trought the
      ldap-server (not checkpassword))
@@ -174,6 +188,10 @@
      WARNING: don't make the debug version accessible to other users
 
 6. Create the LDAP user database and start the LDAP server
+   This is of course not necessary if you used the MigrationTools from
+   the OpenLDAP site to create a user/group/hosts db. You should however
+   Take a look at what extra LDAP parameter fields that you want to use,
+   and add those to your database...
 
 7. Create the proper ~control/ldap* files for qldap
 
@@ -181,48 +199,40 @@
 
 
 CONFIG FILES:
- -
 ~control/ldapserver
- -
  Space separated list of Hostnames or IP addresses of LDAP servers
  Required
  Example: ldap.nrg4u.com
 
 ~control/ldapbasedn
- -
  The base DN from where the search in the LDAP tree begins
  Default: NULL
  Example: o=Internet Pipeline, c=CH
  Note: Referrals are ignored
 
 ~control/ldaplogin
- -
  Username for the LDAP server connection
  Default: NULL
  Note: The user must have enough rights to lookup all user information
 
 ~control/ldappassword
- -
  Password for the LDAP server connection
  Default: NULL
  Note: The password is in clear text
 
 ~control/ldaplocaldelivery
- -
  Use the ~users/get-pw mechanism if the LDAP lookup finds nothing
  Default: enabled
  Example: 1
  Note: boolean, use 0 (zero) or 1 (one)
 
 ~control/ldapdefaultquota
- -
  The default amount of space one user can use
  Default: unlimited
  Example: 1000
  Note: Is written in KBytes, is overridden by mailQuota
 
 ~control/ldapdefaultdotmode
- -
  The default interpretation of .qmail files
  Default: ldaponly
  Example: both
@@ -230,35 +240,30 @@
  Note: Works only for deliveries based on LDAP lookups
 
 ~control/ldapmessagestore
- -
- - The default added path for mailMessageStore without trailing /
+ The default added path for mailMessageStore/homedirectory without trailing /
  Default: NULL
  Example: /maildisk/
  Note: Used in virtual users environments
 
 ~control/ldapusername
- -
  The default username used in virtual users environments
  Default: NULL
  Example: popusers
  Note: Must be an existing username
 
 ~control/ldapuid
- -
  The default UID used in virtual users environments
  Default: NULL
  Example: 1010
  Note: Must match the username, must be above 100
 
 ~control/ldapgid
- -
  The default GID used in virtual users environments
  Default: NULL
  Example: 1010
  Note: Must match the username, must be above 100
 
 ~control/custombouncetext
- -
  Additional custom text in bounce messages, e.g. for providing contact
  information of your ISP or messages in your language
  Default: NULL
@@ -266,7 +271,6 @@
  Note: Multiline
 
 ~control/quotawarning
- -
  Custom text in quota warning message, e.g. for providing contact information
  of your ISP
  Default: NULL
@@ -274,7 +278,6 @@
  Note: Multiline. Needs to be present to make qmail-quotawarn work
 
 ~control/ldappasswdappend
- -
  The default appendix to homedir-pathes form local passwd lookups
  Default: ./
  Example: ./Maildir/
@@ -282,7 +285,6 @@
        this with a .qmail file in every homedir
 
 ~control/tarpitcount
- -
  Tarpitcount is the number of RCPT TOs you accept before you start tarpitting
  Default: 0 (which means no tarpitting)
  Example: 5
@@ -290,7 +292,6 @@
        environment (with tcpserver).
 
 ~control/tarpitdelay
- -
  Tarpitdelay is the number of seconds of delay to introduce after each
  subsequent RCPT TO.
  Default: 5
@@ -299,7 +300,6 @@
        environment (with tcpserver).
 
 ~control/badrcptto
- -
  This file lists recipient addresses that should be rejected.
  Default: none
  Example: user@domain or @domain
@@ -308,7 +308,6 @@
        will get lots of double bounces.
 
 ~control/dirmaker
- -
  Absolute path to your program/script that creates missing homedirs
  Default: none (off)
  Example: /var/qmail/bin/create_homedir
@@ -331,55 +330,46 @@
 LDAP PARAMETER FIELDS:
 NOTE: keywords have to match exactly, so pay attention.
 
- -mail
- -
+krbname
  The users email address
  Required
  Example: jdoe@foo.bar
 
 mailAlternateAddress
- -
  Secondary (alias) mailaddresses for the same user
  Example: jd@foo.bar
 
- -qmailUser
- -
+uid
  Username of the user on the mailsystem
  Example: jdoe
  Note: Can be omitted in a virtual users environment
 
- -qmailUID
- -
+uidnumber
  UID of the user on the mailsystem
  Example: 1010
  Note: Can be omitted in a virtual users environment
 
- -qmailGID
- -
+gidnumber
  GID of the user on the mailsystem
  Example: 1010
  Note: Can be omitted in a virtual users environment
 
- -mailMessageStore
- -
+homedirectory
  Path to the maildir/mbox on the mail system
  Example: /home/jdoe/
  Note: Can be written relative in a virtual users environment
 
 mailQuota
- -
  The amount of space the user can use until all further msg get bounced
  Example: 1000
  Note: In KBytes, overrides ldapdefaultquota
 
 mailForwardingAddress
- -
  Addresses to forward all incoming messages, multi field
  Example: jdoe@new.place
  Note: 
 
 mailHost
- -
  On which qmail server the messagestore of this user is located
  Example: qmail3.nrg4u.com
  Note: Currently not in use. Will be used in the future for qmail-ldap
@@ -387,13 +377,11 @@
        on the homeserver of the user.
 
 deliveryProgramPath
- -
  Program to execute with all incoming messages, multi field
  Example: /usr/bin/program -c -s
  Note: the same as |/usr/bin/program -c -s in .qmail
 
 deliveryMode
- -
  multi field entries of these keywords
  - normal: resets to the normal .qmail behavior
            (Maildir/box delivery only if no forwards or programs are executed)
@@ -414,13 +402,11 @@
        are set, so handle them with care.
        
 mailReplyText
- -
  A reply text for every incoming message (multiline)
  Example: I'm on vacation until next monday
  Note: works only if deliveryMode is set to reply
 
 qmailDotMode
- -
  The default interpretation of .qmail files
  Values: both, dotonly, ldaponly, none (just Maildir/box delivery)
  Default: set by file ~control/ldapdefaultdotmode
@@ -428,21 +414,18 @@
        overrides ldapdefaultdotmode
 
 uid
- -
  The username for POP3 delivery
  Example: jdoe
  Note: 
 
 userPassword
- -
  The password for POP3 delivery
  Example: testit
  Note: Can be encrypted with {SHA}, {MD4}, {MD5}, {NS-MTA-MD5}, crypt
  or cleartext
 
 
- -EXAMPLE QLDAP LDIF FILE:
- -
+EXAMPLE QLDAP LDIF FILE (original QmailLDAP patch):
 dn: cn=Andre Oppermann, o=Internet Pipeline, c=CH
 cn: Andre Oppermann
 sn: Oppermann
@@ -460,9 +443,27 @@
 uid: opi
 userPassword: {MD5}b28a87511da157f147ed4766b0474a8a
 
+EXAMPLE QLDAP LDIF FILE (with the USERDB option)
+dn: cn=Andre Oppermann, o=Internet Pipeline, c=CH
+cn: Andre Oppermann
+sn: Oppermann
+objectClass: top
+objectClass: person
+objectClass: inetOrgPerson
+objectClass: qmailUser
+krbname: opi@opi.flirtbox.ch
+mailHost: opi.flirtbox.ch
+homedirectory: /usr/home/opi/maildir/
+mailQuota: 1000
+uidnumber: 1001
+gidnumber: 1001
+uid: opi
+userPassword: {MD5}b28a87511da157f147ed4766b0474a8a
+
+As seen here, we still need the 'objectClass: qmailUser'. It's basicly the
+same, with only slight changes, se below for the schema changes...
 
 EXAMPLE SLAPD.CONF FILE:
- -
 include         /usr/local/etc/ldap/slapd.at.conf
 include         /usr/local/etc/ldap/slapd.oc.conf
 schemacheck     on
@@ -481,8 +482,7 @@
 index           default none
 
 
- -ADD THIS SCHEMA TO SLAPD.OC.CONF
- -
+ADD THIS SCHEMA TO SLAPD.OC.CONF (original QmailLDAP patch):
 objectclass qmailUser
         requires
                 objectclass,
@@ -503,4 +503,22 @@
                 mailReplyText,
                 qmailDotMode
 
- -
+ADD THIS SCHEMA TO SLAPD.OC.CONF (with the USERDB option)
+objectclass qmailUser
+        requires
+                objectclass,
+                krbname,
+                homedirectory,
+                uid,
+                userPassword
+        allows
+                mailAlternateAddress,
+                uidnumber,
+                gidnumber,
+                mailQuota,
+                mailForwardingAddress,
+                mailHost,
+                deliveryProgramPath,
+                deliveryMode,
+                mailReplyText,
+                qmailDotMode
diff -urN qmail-1.03.debian_ldap/debian/changelog qmail-1.03.debian_ldap_turbo/debian/changelog
- --- qmail-1.03.debian_ldap/debian/changelog	Tue Jan  4 23:58:53 2000
+++ qmail-1.03.debian_ldap_turbo/debian/changelog	Wed Jan  5 03:14:50 2000
@@ -1,3 +1,13 @@
+qmail (1.03-8.1) unstable; urgency=low
+
+  * Added the qmail-ldap patch from 19990805.
+  * Modified the final result to have less duplicate information in the
+    database, such as 'qmailUser -> uid' etc, which the MigrationTools
+    created for me. See the QLDAPINSTALL file for more details.
+  * checkpassword should have permission 700, not 755 (owned by root).
+
+ -- Turbo Fredriksson <turbo@debian.org>  Wed,  5 Jan 2000 03:14:36 +0100
+
 qmail (1.03-8) unstable; urgency=low
 
   * Fixed even MORE bugs in preinst ... This time I have used code from the New Rider's Debian book (Closes #48720, #45203)
diff -urN qmail-1.03.debian_ldap/debian/rules qmail-1.03.debian_ldap_turbo/debian/rules
- --- qmail-1.03.debian_ldap/debian/rules	Tue Jan  4 23:58:54 2000
+++ qmail-1.03.debian_ldap_turbo/debian/rules	Wed Jan  5 04:27:50 2000
@@ -14,6 +14,7 @@
 	$(MAKE) -C contrib/checkpassword-0.76/
 	$(MAKE) man
 	$(MAKE)
+	$(MAKE) qldap
 	# check that the local user ID's match the standard ones
 	@diff -u debian/debian-default_uids.c auto_uids.c || ( echo -e "\nError:\n Your system has user/group ids that differ from the debian default.\n Please rectify this.  The easiest way to do this is normally to cut&paste\n the qmail sections from /etc/passwd.dpkg-dist and /etc/group.dpkg-dist,\n into /etc/passwd and /etc/group respectively (relpacing the old values).\n" ; exit 1 )
 	touch build
@@ -50,6 +51,9 @@
 	./auto-str auto_qmail debian/tmp/var/qmail > auto_qmail.c
 	$(MAKE) install
 	./install
+# Install the LDAP binaries
+	install -o root -g qmail -m 755 qmail-reply debian/tmp/usr/sbin
+	install -o root -g qmail -m 755 qmail-quotawarn debian/tmp/usr/sbin
 	mv debian/tmp/var/qmail/queue debian/tmp/var/spool/qmail
 	#mv debian/tmp/var/qmail/control/* debian/tmp/etc/qmail
 	mv debian/tmp/var/qmail/alias debian/tmp/var/lib/qmail
@@ -69,7 +73,7 @@
 # Move /var/qmail/bin programs to either /usr/bin or /usr/sbin
 	bash debian/debianize-binary-tree
 # Install checkpassword in /usr/bin
- -	install -o root -g root -m 755 contrib/checkpassword-0.76/checkpassword debian/tmp/usr/bin
+	install -o root -g root -m 700 contrib/checkpassword-0.76/checkpassword debian/tmp/usr/bin
 # Install mbox2maildir in /usr/bin
 	install -o root -g root -m 755 contrib/mbox2maildir/mbox2maildir debian/tmp/usr/bin
 # Create /usr/lib/sendmail symlink for backward compatibility.
@@ -79,6 +83,7 @@
 	install -o root -g root -m 755 dnsip debian/tmp/usr/lib/qmail/qmailconfig-dnsip
 	install -o root -g root -m 755 ipmeprint debian/tmp/usr/lib/qmail/qmailconfig-ipmeprint
 	install -o root -g root -m 755 dnsptr debian/tmp/usr/lib/qmail/qmailconfig-dnsptr
+	#install -o root -g root -m 755 ldapcfg.sh debian/tmp/usr/lib/qmail/qmailconfig-ldap
 # install qmail-procmail script
 	install -o root -g root -m 755 debian/qmail-procmail debian/tmp/usr/sbin/qmail-procmail
 # install newaliases script
@@ -93,7 +98,7 @@
 	    -e 's|\./dnsip|/usr/lib/qmail/qmailconfig-dnsip|g' \
 	    -e 's|\./dnsfq|/usr/lib/qmail/qmailconfig-dnsfq|g' \
 	    -e 's|\./ipmeprint|/usr/lib/qmail/qmailconfig-ipmeprint|g' \
- -		config >debian/tmp/usr/lib/qmail/qmailconfig
+		config.sh >debian/tmp/usr/lib/qmail/qmailconfig
 	chmod 755 debian/tmp/usr/lib/qmail/qmailconfig
 # Install /etc/init.d/qmail
 	install -o root -g root -m 755 debian/init.d debian/tmp/etc/init.d/qmail
@@ -104,7 +109,7 @@
 	install -o root -g root -m 644 debian/changelog debian/tmp/usr/doc/qmail/changelog.Debian
 	install -m 644 -p BLURB* FAQ INSTALL* INTERNALS README PIC.* \
 		SECURITY SENDMAIL SYSDEPS THANKS THOUGHTS TODO UPGRADE \
- -		BIN* REMOVE* TEST* VERSION CHANGES \
+		BIN* REMOVE* TEST* VERSION CHANGES QLDAPINSTALL \
 		debian/tmp/usr/doc/qmail/
 	install -m 644 -p debian/README.debian debian/tmp/usr/doc/qmail/README.Debian
 	install -m 644 -p debian/TODO debian/tmp/usr/doc/qmail/TODO.Debian
diff -urN qmail-1.03.debian_ldap/ldapcfg.sh qmail-1.03.debian_ldap_turbo/ldapcfg.sh
- --- qmail-1.03.debian_ldap/ldapcfg.sh	Thu Jan  1 01:00:00 1970
+++ qmail-1.03.debian_ldap_turbo/ldapcfg.sh	Wed Jan  5 07:07:21 2000
@@ -0,0 +1,227 @@
+#!/bin/bash
+
+# Configure the QMail LDAP files
+# Author: Turbo Fredriksson <turbo@nocrew.org>
+# Id:     QmailLDAPConfig v0.1 Wed,  5 Jan 2000 04:37:47 +0100
+
+# Files to change and there meaning...
+# FILE: custombouncetext	Additional custom text in bounce messages, e.g. for providing contact
+# FILE: quotawarning		Custom text in quota warning message, e.g. for providing contact information
+# FILE: tarpitcount		Tarpitcount is the number of RCPT TOs you accept before you start tarpitting
+# FILE: tarpitdelay		Tarpitdelay is the number of seconds of delay to introduce after each
+# FILE: badrcptto		This file lists recipient addresses that should be rejected.
+
+# --------------------------------------------------------------------------------------------------
+
+# FILE: ldapserver		Space separated list of Hostnames or IP addresses of LDAP servers
+set -- `/bin/ps ax | grep slapd | grep -v grep`
+if [ "$1" != "" ]; then
+    echo
+    echo "I found that there is a SLAPD server running here. Do you want to use that for your"
+    echo -n "Qmail LDAP database (using 'localhost' as server) [Y/n] "
+    read s
+    if [ "$s" = "n" -o "$s" = "N" ]; then
+	echo -n "Oki, give me the FQDN (Fully Quallified Domain Name) of the LDAP server please: "
+	read LDAPSERVER
+    else
+	LDAPSERVER=localhost
+    fi
+else
+    echo "I could not find a SLAPD server running on this computer, so you must give me the"
+    echo -n "FQDN (Fully Quallified Domain Name) of the LDAP server please: "
+    read LDAPSERVER
+fi
+
+# FILE: ldapbasedn		The base DN from where the search in the LDAP tree begins
+if [ "$LDAPSERVER" = "localhost" -a -f /etc/openldap/slapd.conf ]; then
+    set -- `grep ^suffix /etc/openldap/slapd.conf` ; shift
+    if [ "$1" != "" ]; then
+	echo
+	echo "I found that you Base DN is $1."
+	echo -n "Do you want to use that for Qmail LDAP's base search point? [Y/n] "
+	read s
+	if [ "$s" = "n" -o "$s" = "N" ]; then
+	    echo -n "Oki, please give me the correct Base DN to start the searches from: "
+	    read LDAPBASEDN
+	else
+	    LDAPBASEDN=`echo $1 | sed -e 's/\"//g' -e 's/\ //g'`
+	fi
+    fi
+fi
+if [ "$LDAPBASEDN" = "" ]; then
+    echo -n "Please give me the correct Base DN to start the searches from: "
+    read LDAPBASEDN
+fi
+
+# FILE: ldaplogin		Username for the LDAP server connection
+# FILE: ldappassword		Password for the LDAP server connection
+echo
+echo "Does the SLAPD server allow anonymous connects to retrive the uid/homedirectory etc?"
+echo -n "(Most servers do, and if you do not know, please answer Y here) [Y/n] "
+read s
+if [ "$s" = "n" -o "$s" = "N" ]; then
+    echo "Oki, give me the (full) Bind DN for the LDAP server: "
+    read LDAPLOGIN
+    echo "Now I need the password to: "
+    read LDAPPASSWORD
+else
+    LDAPLOGIN="<none>"
+    LDAPPASSWORD="<none>"
+fi
+
+# FILE: ldaplocaldelivery	Use the ~users/get-pw mechanism if the LDAP lookup finds nothing
+echo
+echo "There is a option to have a external script (~users/get-pw) that can be used if the LDAP lookup"
+echo -n "doesn't find any matching entry in the database. Do you want to use that? [y/N] "
+read s
+if [ "$s" = "y" -o "$s" = "Y" ]; then
+    LDAPLOCALDELIVERY=1
+else
+    LDAPLOCALDELIVERY=0
+fi
+
+# FILE: ldapdefaultquota	The default amount of space one user can use
+echo
+echo -n "Do you want to impose a default mail quota for you users (can be overridden by mailQuota)? [y/N] "
+read s
+if [ "$s" = "y" -o "$s" = "Y" ]; then
+    echo -n "Very well then, how much (in KByte)? "
+    read LDAPDEFAULTQUOTA
+else
+    LDAPDEFAULTQUOTA="<none>"
+fi
+
+# FILE: ldapdefaultdotmode	The default interpretation of .qmail files
+# ???????
+
+# FILE: ldapmessagestore	The default added path for mailMessageStore/homedirectory without trailing /
+echo
+echo -n "What path should be added to the users homedirectory for delivering the mail to? [/Maildir/] "
+read s
+if [ "$s" = "" ]; then
+    LDAPMESSAGESTORE=/Maildir/
+else
+    LDAPMESSAGESTORE=$s
+fi
+
+# FILE: ldappasswdappend	The default appendix to homedir-pathes form local passwd lookups
+echo
+echo "Should this be the default appendix for local passwd lookups to?"
+echo "Note: Only needed if you start qmail with something other and overwrite"
+echo -n "      this with a .qmail file in every homedir. [y/n/I] (I as in Ignore) "
+read s
+if [ "$s" = "y" -o "$s" = "Y" ]; then
+    LDAPPASSWDAPPEND=$LDAPMESSAGESTORE
+elif [ "$s" = "n" -o "$s" = "N" ]; then
+    echo -n "What should the default appendix for local lookups be? "
+    read LDAPPASSWDAPPEND
+else
+    LDAPPASSWDAPPEND="<none>"
+fi
+
+echo
+echo "Are you planning on using QmailLDAP in a virtual user environment (ie, to not deliver"
+echo -n "to real users) [y/N] "
+read s
+if [ "$s" = "y" -o "$s" = "Y" ]; then
+    # FILE: ldapusername		The default username used in virtual users environments
+    echo "What chould the default username be, for use in a virtual user environment (optional)"
+    echo -n "If supplied, this must be an existing username (Press <ENTER> to not use it) "
+    read s
+    if [ "$s" = "" ]; then
+	LDAPUSERNAME="<none>"
+    else
+	LDAPUSERNAME=$s
+    fi
+
+    # FILE: ldapuid			The default UID used in virtual users environments
+    echo "What chould the default user ID be, for use in a virtual user environment (optional)"
+    echo -n "If supplied, this must be above 100 (Press <ENTER> to not use it) "
+    read s
+    if [ "$s" = "" ]; then
+	LDAPUID="<none>"
+    else
+	LDAPUID=$s
+    fi
+
+    # FILE: ldapgid			The default GID used in virtual users environments
+    echo "What chould the default group ID be, for use in a virtual user environment (optional)"
+    echo -n "If supplied, this must be above 100 (Press <ENTER> to not use it) "
+    read s
+    if [ "$s" = "" ]; then
+	LDAPGID="<none>"
+    else
+	LDAPGID=$s
+    fi
+else
+    LDAPUSERNAME="<none>"
+    LDAPUID="<none>"
+    LDAPGID="<none>"
+fi
+
+# FILE: dirmaker		Absolute path to your program/script that creates missing homedirs
+echo
+echo -n "Are you planning on having missing homedirectories automaticly created with a script? [y/N] "
+read s
+if [ "$s" = "y" -o "$s" = "Y" ]; then
+    echo -n "Do you already Have a script, or do you want me to Create one for you (a very simple one)? [h/C] "
+    read s
+    if [ "$s" = "h" -o "$s" = "H" ]; then
+	echo -n "Then I would like to know WHERE that script is located in the filesystem: "
+	read DIRMAKER
+    else
+	echo "I will create the script ~qmaild/bin/create_homedir and use that for creating missing homedirs."
+	DIRMAKER="`dirname ~qmaild/bin/create_homedirs`/create_homedirs"
+	CREATE_DIRMAKER=1
+    fi
+else
+    DIRMAKER="<none>"
+    CREATE_DIRMAKER=0
+fi
+
+# --------------------------------------------------------------------------------------------------
+
+# Double check...
+echo
+echo
+echo "Is the choosen configuration correct?"
+echo "LDAPSERVER:        $LDAPSERVER"
+echo "LDAPBASEDN:        $LDAPBASEDN"
+echo "LDAPLOGIN:         $LDAPLOGIN"
+echo "LDAPPASSWORD:      $LDAPPASSWORD"
+if [ "$LDAPLOCALDELIVERY" = 1 ]; then
+    echo "LDAPLOCALDELIVERY: Yes"
+else
+    echo "LDAPLOCALDELIVERY: No"
+fi
+echo "LDAPDEFAULTQUOTA:  $LDAPDEFAULTQUOTA"
+echo "LDAPMESSAGESTORE:  $LDAPMESSAGESTORE"
+echo "LDAPPASSWDAPPEND:  $LDAPPASSWDAPPEND"
+echo "LDAPUSERNAME:      $LDAPUSERNAME"
+echo "LDAPUID:           $LDAPUID"
+echo "LDAPGID:           $LDAPGID"
+echo "DIRMAKER:          $DIRMAKER"
+
+echo
+echo -n "Okay? [Y/n] "
+read ok
+if [ "$s" = "n" -o "$s" = "N" ]; then
+    echo "Oki, I'm out'a here. Please run the script again..."
+    exit 1
+fi
+
+# --------------------------------------------------------------------------------------------------
+
+# Create the dirmaker script?
+if [ "$CREATE_DIRMAKER" == 1 ]; then
+    # Yes
+    cat > $DIRMAKER <<EOF
+#!/bin/sh
+
+mkdir \$1
+cd \$1
+maildirmake \$2 # this does not work if your aliasempty is './'
+EOF
+    chown root.qmail $DIRMAKER
+    chmod 700 $DIRMAKER
+fi
diff -urN qmail-1.03.debian_ldap/qmail-ldap.h qmail-1.03.debian_ldap_turbo/qmail-ldap.h
- --- qmail-1.03.debian_ldap/qmail-ldap.h	Tue Jan  4 23:59:37 2000
+++ qmail-1.03.debian_ldap_turbo/qmail-ldap.h	Wed Jan  5 01:37:41 2000
@@ -3,12 +3,20 @@
 
 
 /* ldap variables used in qmail-lspawn and checkpassword */
+#ifdef USERDB
+#define LDAP_MAIL "krbname"
+#define LDAP_QMAILUSER "uid"
+#define LDAP_QMAILUID "uidnumber"
+#define LDAP_QMAILGID "gidnumber"
+#define LDAP_MAILSTORE "homedirectory"
+#else
 #define LDAP_MAIL "mail"
- -#define LDAP_MAILALTERNATE "mailAlternateAddress"
 #define LDAP_QMAILUSER "qmailUser"
 #define LDAP_QMAILUID "qmailUID"
 #define LDAP_QMAILGID "qmailGID"
 #define LDAP_MAILSTORE "mailMessageStore"
+#endif
+#define LDAP_MAILALTERNATE "mailAlternateAddress"
 #define LDAP_QUOTA "mailQuota"
 #define LDAP_FORWARDS "mailForwardingAddress"
 #define LDAP_PROGRAM "deliveryProgramPath"
diff -urN qmail-1.03.debian_ldap/qmail-lspawn.c qmail-1.03.debian_ldap_turbo/qmail-lspawn.c
- --- qmail-1.03.debian_ldap/qmail-lspawn.c	Wed Jan  5 00:08:20 2000
+++ qmail-1.03.debian_ldap_turbo/qmail-lspawn.c	Wed Jan  5 01:45:14 2000
@@ -349,6 +349,31 @@
          substdio_puts(ss, "DInternal error in ldap_search_ext_s. (LDAP-ERR #204)\n");
       REPORT_RETURN;
 
+#ifdef USERDB
+      case 210:
+         substdio_puts(ss, "DLDAP attribute uid contains illegal characters. (LDAP-ERR #210)\n");
+      REPORT_RETURN;
+
+      case 211:
+         substdio_puts(ss, "DLDAP attribute uidnumber is too high/low or not numeric. (LDAP-ERR #211)\n");
+      REPORT_RETURN;
+
+      case 212:
+         substdio_puts(ss, "DLDAP attribute gidnumber is too high/low or not numeric. (LDAP-ERR #212)\n");
+      REPORT_RETURN;
+
+      case 213:
+         substdio_puts(ss, "DLDAP attribute homedirectory contains illegal characters. (LDAP-ERR #213)\n");
+      REPORT_RETURN;
+
+      case 214:
+         substdio_puts(ss, "DLDAP attribute homedirectory with ~control/ldapmessagestore contains illegal characters. (LDAP-ERR #214)\n");
+      REPORT_RETURN;
+
+      case 215:
+         substdio_puts(ss, "DLDAP attribute homedirectory is not given but mandatory. (LDAP-ERR #215)\n");
+      REPORT_RETURN;
+#else
       case 210:
          substdio_puts(ss, "DLDAP attribute qmailUser contains illegal characters. (LDAP-ERR #210)\n");
       REPORT_RETURN;
@@ -372,6 +397,7 @@
       case 215:
          substdio_puts(ss, "DLDAP attribute mailMessageStore is not given but mandatory. (LDAP-ERR #215)\n");
       REPORT_RETURN;
+#endif
 
       case 220:
          substdio_puts(ss, "DLDAP attribute mailForwardingAddress contains illegal characters. (LDAP-ERR #220)\n");
@@ -493,7 +519,11 @@
    }
 
    /* build the search string for the email address */
+#ifdef USERDB
+   if (!stralloc_copys(&filter,"(|(krbname=" ) ) _exit(QLX_NOMEM);
+#else
    if (!stralloc_copys(&filter,"(|(mail=" ) ) _exit(QLX_NOMEM);
+#endif
    if (!stralloc_cat(&filter,mail)) _exit(QLX_NOMEM);
    if (!stralloc_cats(&filter,")(mailalternateaddress=")) _exit(QLX_NOMEM);
    if (!stralloc_cat(&filter,mail)) _exit(QLX_NOMEM);
@@ -517,7 +547,11 @@
       i = mail->len;
       for (at = i - 1; r[at] != '@' && at >= 0 ; at--) ;
       /* build the search string for the email address */
+#ifdef USERDB
+      if (!stralloc_copys(&filter,"(|(krbname=" ) ) _exit(QLX_NOMEM);
+#else
       if (!stralloc_copys(&filter,"(|(mail=" ) ) _exit(QLX_NOMEM);
+#endif
       if (!stralloc_cats(&filter,LDAP_CATCH_ALL)) _exit(QLX_NOMEM);
       if (!stralloc_catb(&filter,r+at, i-at)) _exit(QLX_NOMEM);
       if (!stralloc_cats(&filter,")(mailalternateaddress=")) _exit(QLX_NOMEM);
@@ -560,7 +594,11 @@
 
    /* get the username for delivery on the local system */
    if ( (vals = ldap_get_values(ld,msg,LDAP_QMAILUSER)) != NULL ) {
+#ifdef USERDB
+//      DEBUG("uid: ", vals[0], "\n", 0);
+#else
 //      DEBUG("qmailUser: ", vals[0], "\n", 0);
+#endif
       if (!chck_users(vals[0]) ) return 20;
       /* set the value for qmail-local... */
       if (!stralloc_copys(&nughde, vals[0])) _exit(QLX_NOMEM);
@@ -576,7 +614,11 @@
 
    /* get the UID for delivery on the local system */
    if ( (vals = ldap_get_values(ld,msg,LDAP_QMAILUID)) != NULL ) {
+#ifdef USERDB
+//      DEBUG("uidnumber: ", vals[0], "\n", 0);
+#else
 //      DEBUG("qmailUID: ", vals[0], "\n", 0);
+#endif
       if (100 > chck_ids(vals[0]) ) return 21;
       if (!stralloc_cats(&nughde, vals[0])) _exit(QLX_NOMEM);
    } else {
@@ -590,7 +632,11 @@
 
    /* get the GID for delivery on the local system */
    if ( (vals = ldap_get_values(ld,msg,LDAP_QMAILGID)) != NULL ) {
+#ifdef USERDB
+//      DEBUG("gidnumber: ", vals[0], "\n", 0);
+#else
 //      DEBUG("qmailGID: ", vals[0], "\n", 0);
+#endif
       if ( 100 > chck_ids(vals[0]) ) return 22; 
       if (!stralloc_cats(&nughde, vals[0])) _exit(QLX_NOMEM);
    } else {
@@ -604,7 +650,11 @@
 
    /* get the path of the maildir or mbox */
    if ( (vals = ldap_get_values(ld,msg,LDAP_MAILSTORE)) != NULL ) {
+#ifdef USERDB
+//      DEBUG("homedirectory: ", vals[0], "\n", 0);
+#else
 //      DEBUG("mailMessageStore: ", vals[0], "\n", 0);
+#endif
       if (vals[0][0] != '/') {
          if (qldap_messagestore.s[0] != '/') return 46;
          if (qldap_messagestore.s[qldap_messagestore.len -1] != '/') return 47;

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv
Comment: Processed by Mailcrypt 3.5.5, an Emacs/PGP interface

iQCVAwUBOHMHwRZ4ByN4jNGpAQH1QgP+I+VdVemhg3BvyMPn2VPMkvyIiSt6kov0
b05nPWPmh2fBJwtPDHlnHaFb251U5JPE9WjvuDVNvIeh/uwe8Gos9FVU2Ln0mbZg
MErUYpolozMI6Cyt6QWk7IAFRy6QM2A7dv6g4mLRTIfFMe3/fnWx3/7/hq6Wnu9y
Y1o4F9bqPQs=
=auav
-----END PGP SIGNATURE-----
-- 
quiche smuggle Noriega Clinton Nazi ammunition CIA Semtex NORAD SEAL
Team 6 Mossad [Hello to all my fans in domestic surveillance] DES
Qaddafi nuclear