--- qmail-ldap-1.03-r6.ebuild 2006-03-07 17:06:15.000000000 -0500 +++ qmail-ldap-1.03-r6.ebuild 2006-03-08 11:23:26.000000000 -0500 @@ -40,13 +40,6 @@ # Where the rules for tcpserver will be kept: TCPRULES_DIR=/etc/tcprules.d -if use vmail ; then - # Set up this way so we can get $VMAILUSER during - # pkg_config without having to pass more environtment - # variables. This text will appear in the "comment" - # field for $VMAILUSER in /etc/passwd - vmailgecos="Virtual Mail user for qmail-ldap" -fi pkg_setup() { @@ -142,6 +135,10 @@ # What user/group name to use for the virtual user: [ -z "${VMAILUSER}" ] && VMAILUSER="vmail" + + + # What user/group name to use for the virtual user: + [ -z "${VMAILUSER}" ] && VMAILUSER="vmail" # The home directory for $VMAILUSER. All user mail # will be kept in a subdirectory of $VMAILHOME @@ -267,10 +264,6 @@ einfo "Modifying qmail-ldap to work with virtual mail accounts" sed -i -e 's/"homeDirectory"/"notreallyahomeDirectory"/' ${S}/qmail-ldap.h - echo "11184" > ${WORKDIR}/ldapuid - echo "2110" > ${WORKDIR}/ldapgid - echo "${VMAILHOME}" > ${WORKDIR}/ldapmessagestore - if [ -n "${VDOMAINS}" ] ; then EPATCH_SINGLE_MSG="Applying patch to allow vpopmail-style virtual domains" \ @@ -444,11 +437,6 @@ use spp && doins ${FILESDIR}/control/smtpplugins newins ${FILESDIR}/dot_qmail defaultdelivery use ssl && doins ${FILESDIR}/${PVR}/servercert.cnf - if use vmail; then - doins ${WORKDIR}/ldapuid - doins ${WORKDIR}/ldapgid - doins ${WORKDIR}/ldapmessagestore - fi einfo "Adding qmail.schema to OpenLDAP's schema directory" diropts -o root -g root -m 0755 @@ -569,7 +557,7 @@ if use vmail ; then enewgroup ${VMAILUSER} 2110 - enewuser "${VMAILUSER}" 11184 /bin/bash "${VMAILHOME}" "${VMAILUSER}" "-c${vmailgecos}" + enewuser "${VMAILUSER}" 11184 /bin/bash "${VMAILHOME}" "${VMAILUSER}" "-cVirtual Mail user for qmail-ldap" diropts -m0770 -o ${VMAILUSER} -g ${VMAILUSER} keepdir ${VMAILHOME} fi @@ -605,9 +593,6 @@ if ! use notlsbeforeauth ; then einfo "Enabling STARTTLS before SMTP AUTH" no_relay_string="${no_relay_string},SMTPAUTH=\"TLSREQUIRED\"" - #else - # ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" - # no_relay_string="${no_relay_string},SMTPAUTH=\"\"" fi else ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" @@ -681,5 +666,18 @@ [ ! -f ${ROOT}var/qmail/control/ldaprebind ] && \ einfo "Allowing qmail-ldap to rebind to the LDAP server (allows for stricter ACLs on passwords)" && \ echo "1" > ${ROOT}var/qmail/control/ldaprebind - + if use vmail ; then + local `bzgrep ^VMAILUSER /var/db/pkg/${CATEGORY}/${PF}/environment.bz2` + varray=( `egetent passwd ${VMAILUSER} |awk -F : {'print $3" "$4" "$6'}` ) + + [ ! -f ${ROOT}var/qmail/control/ldapuid ] && \ + einfo "Setting ${VMAILUSER}'s uid in ${ROOT}var/qmail/control/ldapuid" + echo "${varray[0]}" > ${ROOT}var/qmail/control/ldapuid + [ ! -f ${ROOT}var/qmail/control/ldapgid ] && \ + einfo "Setting ${VMAILUSER}'s gid in ${ROOT}var/qmail/control/ldapgid" + echo "${varray[1]}" > ${ROOT}var/qmail/control/ldapgid + [ ! -f ${ROOT}var/qmail/control/ldapmessagestore ] && \ + einfo "Setting ${VMAILUSER}'s home directory in ${ROOT}var/qmail/control/ldapmessagestore" + echo "${varray[2]}" > ${ROOT}var/qmail/control/ldapmessagestore + fi } --- Manifest 2006-03-07 17:08:29.000000000 -0500 +++ Manifest 2006-03-08 11:23:52.000000000 -0500 @@ -68,4 +68,4 @@ MD5 9709a485d0c2187a4e22faa276bd2c76 files/tcprules/tcp.smtp.sample 1837 MD5 c07e4481988f254eed6c443fe156f2ca metadata.xml 487 MD5 dc2c75f0d62603303366b549b275ce4a qmail-ldap-1.03-r5.ebuild 19593 -MD5 4c3ac56e6d3a7d0b960e384498afd6e7 qmail-ldap-1.03-r6.ebuild 23283 +MD5 4f77cdbd3c177e420ca9b0635734e046 qmail-ldap-1.03-r6.ebuild 23539