|
|
# Where the rules for tcpserver will be kept: | # Where the rules for tcpserver will be kept: |
TCPRULES_DIR=/etc/tcprules.d | 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() { | pkg_setup() { |
| |
|
|
| |
# What user/group name to use for the virtual user: | # What user/group name to use for the virtual user: |
[ -z "${VMAILUSER}" ] && VMAILUSER="vmail" | [ -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 | # The home directory for $VMAILUSER. All user mail |
# will be kept in a subdirectory of $VMAILHOME | # will be kept in a subdirectory of $VMAILHOME |
|
|
einfo "Modifying qmail-ldap to work with virtual mail accounts" | einfo "Modifying qmail-ldap to work with virtual mail accounts" |
sed -i -e 's/"homeDirectory"/"notreallyahomeDirectory"/' ${S}/qmail-ldap.h | 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 | if [ -n "${VDOMAINS}" ] ; then |
| |
EPATCH_SINGLE_MSG="Applying patch to allow vpopmail-style virtual domains" \ | EPATCH_SINGLE_MSG="Applying patch to allow vpopmail-style virtual domains" \ |
|
|
use spp && doins ${FILESDIR}/control/smtpplugins | use spp && doins ${FILESDIR}/control/smtpplugins |
newins ${FILESDIR}/dot_qmail defaultdelivery | newins ${FILESDIR}/dot_qmail defaultdelivery |
use ssl && doins ${FILESDIR}/${PVR}/servercert.cnf | 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" | einfo "Adding qmail.schema to OpenLDAP's schema directory" |
diropts -o root -g root -m 0755 | diropts -o root -g root -m 0755 |
|
|
| |
if use vmail ; then | if use vmail ; then |
enewgroup ${VMAILUSER} 2110 | 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} | diropts -m0770 -o ${VMAILUSER} -g ${VMAILUSER} |
keepdir ${VMAILHOME} | keepdir ${VMAILHOME} |
fi | fi |
|
|
if ! use notlsbeforeauth ; then | if ! use notlsbeforeauth ; then |
einfo "Enabling STARTTLS before SMTP AUTH" | einfo "Enabling STARTTLS before SMTP AUTH" |
no_relay_string="${no_relay_string},SMTPAUTH=\"TLSREQUIRED\"" | no_relay_string="${no_relay_string},SMTPAUTH=\"TLSREQUIRED\"" |
#else |
|
# ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" |
|
# no_relay_string="${no_relay_string},SMTPAUTH=\"\"" |
|
fi | fi |
else | else |
ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" | ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" |
|
|
[ ! -f ${ROOT}var/qmail/control/ldaprebind ] && \ | [ ! -f ${ROOT}var/qmail/control/ldaprebind ] && \ |
einfo "Allowing qmail-ldap to rebind to the LDAP server (allows for stricter ACLs on passwords)" && \ | einfo "Allowing qmail-ldap to rebind to the LDAP server (allows for stricter ACLs on passwords)" && \ |
echo "1" > ${ROOT}var/qmail/control/ldaprebind | 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 |
} | } |
|
|
MD5 9709a485d0c2187a4e22faa276bd2c76 files/tcprules/tcp.smtp.sample 1837 | MD5 9709a485d0c2187a4e22faa276bd2c76 files/tcprules/tcp.smtp.sample 1837 |
MD5 c07e4481988f254eed6c443fe156f2ca metadata.xml 487 | MD5 c07e4481988f254eed6c443fe156f2ca metadata.xml 487 |
MD5 dc2c75f0d62603303366b549b275ce4a qmail-ldap-1.03-r5.ebuild 19593 | 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 |