1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit pam eutils user
7 DESCRIPTION="MTA layout package"
9 HOMEPAGE="https://www.gentoo.org/"
13 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
16 RDEPEND="pam? ( virtual/pam )"
22 enewuser mail 8 -1 /var/spool/mail mail
23 enewuser postmaster 14 -1 /var/spool/mail
29 doins "${FILESDIR}"/aliases || die
31 doins "${FILESDIR}"/mailcap || die
33 keepdir /var/spool/mail
34 fowners root:mail /var/spool/mail
35 fperms 0775 /var/spool/mail
36 dosym /var/spool/mail /var/mail
38 newpamd "${FILESDIR}"/common-pamd-include pop
39 newpamd "${FILESDIR}"/common-pamd-include imap
42 for p in pop3 pop3s pops ; do
43 dosym pop /etc/pam.d/${p} || die
45 for p in imap4 imap4s imaps ; do
46 dosym imap /etc/pam.d/${p} || die
51 get_permissions_oct() {
52 if [[ ${USERLAND} = GNU ]] ; then
54 elif [[ ${USERLAND} = BSD ]] ; then
55 stat -f%p "${ROOT}$1" | cut -c 3-
60 if [[ "$(get_permissions_oct /var/spool/mail)" != "775" ]] ; then
62 ewarn "Your ${ROOT}/var/spool/mail/ directory permissions differ from"
63 ewarn " those which mailbase set when you first installed it (0775)."
64 ewarn " If you did not change them on purpose, consider running:"
66 ewarn " chmod 0775 ${ROOT}/var/spool/mail/"