Lines 40-59
Link Here
|
40 |
# Where the rules for tcpserver will be kept: |
40 |
# Where the rules for tcpserver will be kept: |
41 |
TCPRULES_DIR=/etc/tcprules.d |
41 |
TCPRULES_DIR=/etc/tcprules.d |
42 |
|
42 |
|
43 |
if use vmail ; then |
|
|
44 |
# Set up this way so we can get $VMAILUSER during |
45 |
# pkg_config without having to pass more environtment |
46 |
# variables. This text will appear in the "comment" |
47 |
# field for $VMAILUSER in /etc/passwd |
48 |
vmailgecos="Virtual Mail user for qmail-ldap" |
49 |
fi |
50 |
|
51 |
pkg_setup() { |
52 |
|
53 |
! use readvars && [[ -z $LDAPFLAGS ]] && [[ -z $VMAILUSER ]] \ |
54 |
&& [[ -z $VDOMAINS ]] && explain_vars |
55 |
} |
56 |
|
57 |
explain_vars() { |
43 |
explain_vars() { |
58 |
echo "" |
44 |
echo "" |
59 |
ewarn "This ebuild comes with some environment variables you can set" |
45 |
ewarn "This ebuild comes with some environment variables you can set" |
Lines 132-137
Link Here
|
132 |
exit 1 |
118 |
exit 1 |
133 |
} |
119 |
} |
134 |
|
120 |
|
|
|
121 |
! use readvars && [[ -z $LDAPFLAGS ]] && [[ -z $VMAILUSER ]] \ |
122 |
&& [[ -z $VDOMAINS ]] && explain_vars |
123 |
pkg_setup() { |
124 |
# Gentoo 2006.0 doesn't have qmail system users by default |
125 |
# Thanks to Falador on the forums for pointing this out! |
126 |
|
127 |
# These apparently need to be here because the qmail code checks for some |
128 |
# of these while compiling. Yay! :-P |
129 |
einfo "Creating users and groups for qmail system users if necessary ..." |
130 |
enewgroup qmail 201 |
131 |
enewgroup nofiles 200 |
132 |
enewuser alias 200 /bin/true /var/qmail/alias nofiles "-cSystem account for qmail alias" |
133 |
enewuser qmaild 201 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
134 |
enewuser qmaill 202 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
135 |
enewuser qmailp 203 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
136 |
enewuser qmailq 204 /bin/true /var/qmail qmail "-cSystem account for qmail queue" |
137 |
enewuser qmailr 205 /bin/true /var/qmail qmail "-cSystem account for qmail" |
138 |
enewuser qmails 206 /bin/true /var/qmail qmail "-cSystem account for qmail" |
139 |
} |
135 |
src_unpack() { |
140 |
src_unpack() { |
136 |
|
141 |
|
137 |
|
142 |
|
Lines 142-147
Link Here
|
142 |
|
147 |
|
143 |
# What user/group name to use for the virtual user: |
148 |
# What user/group name to use for the virtual user: |
144 |
[ -z "${VMAILUSER}" ] && VMAILUSER="vmail" |
149 |
[ -z "${VMAILUSER}" ] && VMAILUSER="vmail" |
|
|
150 |
|
151 |
|
152 |
# What user/group name to use for the virtual user: |
153 |
[ -z "${VMAILUSER}" ] && VMAILUSER="vmail" |
145 |
|
154 |
|
146 |
# The home directory for $VMAILUSER. All user mail |
155 |
# The home directory for $VMAILUSER. All user mail |
147 |
# will be kept in a subdirectory of $VMAILHOME |
156 |
# will be kept in a subdirectory of $VMAILHOME |
Lines 267-276
Link Here
|
267 |
einfo "Modifying qmail-ldap to work with virtual mail accounts" |
276 |
einfo "Modifying qmail-ldap to work with virtual mail accounts" |
268 |
sed -i -e 's/"homeDirectory"/"notreallyahomeDirectory"/' ${S}/qmail-ldap.h |
277 |
sed -i -e 's/"homeDirectory"/"notreallyahomeDirectory"/' ${S}/qmail-ldap.h |
269 |
|
278 |
|
270 |
echo "11184" > ${WORKDIR}/ldapuid |
|
|
271 |
echo "2110" > ${WORKDIR}/ldapgid |
272 |
echo "${VMAILHOME}" > ${WORKDIR}/ldapmessagestore |
273 |
|
274 |
if [ -n "${VDOMAINS}" ] ; then |
279 |
if [ -n "${VDOMAINS}" ] ; then |
275 |
|
280 |
|
276 |
EPATCH_SINGLE_MSG="Applying patch to allow vpopmail-style virtual domains" \ |
281 |
EPATCH_SINGLE_MSG="Applying patch to allow vpopmail-style virtual domains" \ |
Lines 444-454
Link Here
|
444 |
use spp && doins ${FILESDIR}/control/smtpplugins |
449 |
use spp && doins ${FILESDIR}/control/smtpplugins |
445 |
newins ${FILESDIR}/dot_qmail defaultdelivery |
450 |
newins ${FILESDIR}/dot_qmail defaultdelivery |
446 |
use ssl && doins ${FILESDIR}/${PVR}/servercert.cnf |
451 |
use ssl && doins ${FILESDIR}/${PVR}/servercert.cnf |
447 |
if use vmail; then |
|
|
448 |
doins ${WORKDIR}/ldapuid |
449 |
doins ${WORKDIR}/ldapgid |
450 |
doins ${WORKDIR}/ldapmessagestore |
451 |
fi |
452 |
|
452 |
|
453 |
einfo "Adding qmail.schema to OpenLDAP's schema directory" |
453 |
einfo "Adding qmail.schema to OpenLDAP's schema directory" |
454 |
diropts -o root -g root -m 0755 |
454 |
diropts -o root -g root -m 0755 |
Lines 566-575
Link Here
|
566 |
eerror "You may have already moved them, but please check." |
566 |
eerror "You may have already moved them, but please check." |
567 |
echo |
567 |
echo |
568 |
fi |
568 |
fi |
569 |
|
569 |
|
|
|
570 |
# Gentoo 2006.0 doesn't have qmail system users by default |
571 |
# Thanks to Falador on the forums for pointing this out! |
572 |
einfo "Creating users and groups for qmail system users if necessary ..." |
573 |
enewgroup qmail 201 |
574 |
enewgroup nofiles 200 |
575 |
enewuser alias 200 /bin/true /var/qmail/alias nofiles "-cSystem account for qmail alias" |
576 |
enewuser qmaild 201 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
577 |
enewuser qmaill 202 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
578 |
enewuser qmailp 203 /bin/true /var/qmail nofiles "-cSystem account for qmail" |
579 |
enewuser qmailq 204 /bin/true /var/qmail qmail "-cSystem account for qmail queue" |
580 |
enewuser qmailr 205 /bin/true /var/qmail qmail "-cSystem account for qmail" |
581 |
enewuser qmails 206 /bin/true /var/qmail qmail "-cSystem account for qmail" |
582 |
|
570 |
if use vmail ; then |
583 |
if use vmail ; then |
|
|
584 |
einfo "Creating user and group for ${VMAILUSER} account ..." |
571 |
enewgroup ${VMAILUSER} 2110 |
585 |
enewgroup ${VMAILUSER} 2110 |
572 |
enewuser "${VMAILUSER}" 11184 /bin/bash "${VMAILHOME}" "${VMAILUSER}" "-c${vmailgecos}" |
586 |
enewuser "${VMAILUSER}" 11184 /bin/bash "${VMAILHOME}" "${VMAILUSER}" "-cVirtual Mail user for qmail-ldap" |
573 |
diropts -m0770 -o ${VMAILUSER} -g ${VMAILUSER} |
587 |
diropts -m0770 -o ${VMAILUSER} -g ${VMAILUSER} |
574 |
keepdir ${VMAILHOME} |
588 |
keepdir ${VMAILHOME} |
575 |
fi |
589 |
fi |
Lines 605-613
Link Here
|
605 |
if ! use notlsbeforeauth ; then |
619 |
if ! use notlsbeforeauth ; then |
606 |
einfo "Enabling STARTTLS before SMTP AUTH" |
620 |
einfo "Enabling STARTTLS before SMTP AUTH" |
607 |
no_relay_string="${no_relay_string},SMTPAUTH=\"TLSREQUIRED\"" |
621 |
no_relay_string="${no_relay_string},SMTPAUTH=\"TLSREQUIRED\"" |
608 |
#else |
|
|
609 |
# ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" |
610 |
# no_relay_string="${no_relay_string},SMTPAUTH=\"\"" |
611 |
fi |
622 |
fi |
612 |
else |
623 |
else |
613 |
ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" |
624 |
ewarn "Enabling SMTP AUTH **WITHOUT** STARTTLS" |
Lines 681-685
Link Here
|
681 |
[ ! -f ${ROOT}var/qmail/control/ldaprebind ] && \ |
692 |
[ ! -f ${ROOT}var/qmail/control/ldaprebind ] && \ |
682 |
einfo "Allowing qmail-ldap to rebind to the LDAP server (allows for stricter ACLs on passwords)" && \ |
693 |
einfo "Allowing qmail-ldap to rebind to the LDAP server (allows for stricter ACLs on passwords)" && \ |
683 |
echo "1" > ${ROOT}var/qmail/control/ldaprebind |
694 |
echo "1" > ${ROOT}var/qmail/control/ldaprebind |
684 |
|
695 |
if use vmail ; then |
|
|
696 |
local `bzgrep ^VMAILUSER /var/db/pkg/${CATEGORY}/${PF}/environment.bz2` |
697 |
varray=( `egetent passwd ${VMAILUSER} |awk -F : {'print $3" "$4" "$6'}` ) |
698 |
|
699 |
[ ! -f ${ROOT}var/qmail/control/ldapuid ] && \ |
700 |
einfo "Setting ${VMAILUSER}'s uid in ${ROOT}var/qmail/control/ldapuid" |
701 |
echo "${varray[0]}" > ${ROOT}var/qmail/control/ldapuid |
702 |
[ ! -f ${ROOT}var/qmail/control/ldapgid ] && \ |
703 |
einfo "Setting ${VMAILUSER}'s gid in ${ROOT}var/qmail/control/ldapgid" |
704 |
echo "${varray[1]}" > ${ROOT}var/qmail/control/ldapgid |
705 |
[ ! -f ${ROOT}var/qmail/control/ldapmessagestore ] && \ |
706 |
einfo "Setting ${VMAILUSER}'s home directory in ${ROOT}var/qmail/control/ldapmessagestore" |
707 |
echo "${varray[2]}" > ${ROOT}var/qmail/control/ldapmessagestore |
708 |
fi |
685 |
} |
709 |
} |