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