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