From a23651fff5f44fcd001f588cb9b683c335c81540 Mon Sep 17 00:00:00 2001
From: Christian Wiese <morfoh@opensde.org>
Date: Wed, 7 Mar 2007 20:51:30 +0000
Subject: [PATCH] 	* improved qmail by adding domain aliasing support for
 qmail-ldap 	* Note: The Config option is just available for qmail-ldap and
 has to 		be set explicitely (default is off)!

git-svn-id: svn://svn.opensde.net/opensde/package/trunk@20284 10447126-35f2-4685-b0cf-6dd780d3921f
---
 mail/qmail/config.in       |  9 ++++++---
 mail/qmail/qmail-ldap.conf | 12 ++++++++++--
 mail/qmail/qmail.desc      |  3 ++-
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/mail/qmail/config.in b/mail/qmail/config.in
index f9b53c202..531db1440 100644
--- a/mail/qmail/config.in
+++ b/mail/qmail/config.in
@@ -1,8 +1,9 @@
 #!/bin/sh
-# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# --- SDE-COPYRIGHT-NOTE-BEGIN ---
 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
 # 
-# T2 SDE: package/.../qmail/config.in
+# Filename: package/.../qmail/config.in
+# Copyright (C) 2007 The OpenSDE Project
 # Copyright (C) 2004 - 2006 The T2 SDE Project
 # 
 # More information can be found in the files COPYING and README.
@@ -11,7 +12,7 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; version 2 of the License. A copy of the
 # GNU General Public License can be found in the file COPYING.
-# --- T2-COPYRIGHT-NOTE-END ---
+# --- SDE-COPYRIGHT-NOTE-END ---
 if pkgcheck qmail X; then
 	menu_begin MENU_PKG_QMAIL 'qmail package options'
 		comment 'WARNING: If you patch your copy of qmail its at your'
@@ -21,6 +22,8 @@ if pkgcheck qmail X; then
 
 		bool 'Enable LDAP backend' SDECFG_PKG_QMAIL_LDAP 0
 		if [ "$SDECFG_PKG_QMAIL_LDAP" == 1 ]; then
+			bool 'Enable Domain aliasing' \
+					SDECFG_PKG_QMAIL_LDAP_DOMAINALIAS 0
 			SDECFGSET_PKG_QMAIL_QMTP=0
 			SDECFGSET_PKG_QMAIL_QUEUE=0
 		fi
diff --git a/mail/qmail/qmail-ldap.conf b/mail/qmail/qmail-ldap.conf
index 7bc5460f6..b844f4d14 100644
--- a/mail/qmail/qmail-ldap.conf
+++ b/mail/qmail/qmail-ldap.conf
@@ -3,7 +3,7 @@
 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
 # 
 # Filename: package/.../qmail/qmail-ldap.conf
-# Copyright (C) 2006 The OpenSDE Project
+# Copyright (C) 2006 - 2007 The OpenSDE Project
 # Copyright (C) 2004 - 2006 The T2 SDE Project
 # 
 # More information can be found in the files COPYING and README.
@@ -17,10 +17,18 @@
 # qmail-ldap patch is complete, so we remove our patches.
 patchfiles="`match_source_file -p qmail-ldap`"
 
+LDAPFLAGS="-DALTQUEUE -DDASH_EXT"
+
+# Domain aliasing support for qmail-ldap
+if [ "$SDECFG_PKG_QMAIL_LDAP_DOMAINALIAS" == "1" ] ; then 
+	var_append patchfiles ' ' "$( match_source_file -p qldap-domainalias )"
+	var_append LDAPFLAGS ' ' "-DDOMAIN_ALIAS"
+fi
+
 var_append makeopt ' ' "LDAPLIBS='-L$( pkgprefix libdir openldap ) -lldap -llber'"
 var_append makeopt ' ' "SHADOWLIBS='-lcrypt -lshadow'"
 var_append makeopt ' ' "LDAPINCLUDES=-I$( pkgprefix includedir openldap )"
-var_append makeopt ' ' "LDAPFLAGS='-DALTQUEUE -DDASH_EXT'"
+var_append makeopt ' ' "LDAPFLAGS='$LDAPFLAGS'"
 var_append makeopt ' ' "MDIRMAKE=-DAUTOMAILDIRMAKE"
 var_append makeopt ' ' "HDIRMAKE=-DAUTOHOMEDIRMAKE"
 var_append makeopt ' ' "DEBUG=-DDEBUG"
diff --git a/mail/qmail/qmail.desc b/mail/qmail/qmail.desc
index 2952d2876..8399ce41b 100644
--- a/mail/qmail/qmail.desc
+++ b/mail/qmail/qmail.desc
@@ -2,7 +2,7 @@
 [COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
 [COPY] 
 [COPY] Filename: package/.../qmail/qmail.desc
-[COPY] Copyright (C) 2006 The OpenSDE Project
+[COPY] Copyright (C) 2006 - 2007 The OpenSDE Project
 [COPY] Copyright (C) 2004 - 2006 The T2 SDE Project
 [COPY] 
 [COPY] More information can be found in the files COPYING and README.
@@ -35,6 +35,7 @@
 [D] 2278742354 qmail-1.03.tar.gz -ftp://ftp.ntnu.no/pub/unix/mail/qmail/
 
 [D] 1018499428 qmail-ldap-1.03-20060201.patch.gz http://www.nrg4u.com/qmail/
+[D] 3274430562 qldap-domainalias.patch http://kristof.bajnok.hu/qmail/
 
 [D] 1555844601 qmail-patch-1.03-qmailqueue.diff !http://www.qmail.org/qmailqueue-patch