If /var/spool/mail is mounted from a remote machine, the mailbase ebuild fails. Reproducible: Always Steps to Reproduce: 1. nfs-mount /var/spool/mail 2. emerge mailbase 3. observe failure! Expected Results: perhaps it could ignore errors trying to set permissions on /var/spool/mail. In any case, it seems to set incorrect permissions: it sets the permissions to be 777, whereas they should be 1777.
which version mailbase? $ mount ... nfs_host:/nfs_share on /var/spool/mail type nfs (rw,addr=192.168.0.5,addr=192.168.0.5) # emerge mailbase ... * Caching service dependencies ... [ ok ] >>> net-mail/mailbase-0.00-r8 merged. # ls -ld /var/spool/mail drwxrwxr-x 2 root mail 72 Mar 14 12:35 /var/spool/mail The permission should be 775 and owned by root:mail. Please see bug #16749
mailbase-0.00-r8
>>> extracting mailbase-0.00-r8 >>> Merging net-mail/mailbase-0.00-r8 to / --- /etc/ --- /etc/mail/ >>> /etc/mail/aliases >>> /etc/mailcap --- /etc/pam.d/ >>> /etc/pam.d/pop >>> /etc/pam.d/pop3 -> /etc/pam.d/pop >>> /etc/pam.d/pop3s -> /etc/pam.d/pop >>> /etc/pam.d/pops -> /etc/pam.d/pop >>> /etc/pam.d/imap >>> /etc/pam.d/imap4 -> /etc/pam.d/imap >>> /etc/pam.d/imap4s -> /etc/pam.d/imap >>> /etc/pam.d/imaps -> /etc/pam.d/imap --- /var/ --- /var/spool/ --- /var/spool/mail/ !!! copy /var/tmp/portage-pkg/mailbase-0.00-r8/bin/var/spool/mail/.keep -> /var/spool/mail/.keep failed. !!! [Errno 1] Operation not permitted ---------------- #mount ... coremail:/var/spool/mail/ on /var/spool/mail type nfs (rw,addr=192.168.10.249) # ls -ld /var/spool/mail drwxrwxrwt 2 root mail 4096 Mar 14 17:00 /var/spool/mail
Incidentally, aren't perms of 775 incompatible with Postfix? Postfix adopts the privileges of the user that is receiving the email, thus the mail spool directory needs to be writable by all users that will receive email.
Also works fine here. You need the no_root_squash option on exports file. About the postfix perms thing, /var/spool/mail is gid mail so it should work fine. Cheers, Ferdy
I believe this breaks Postfix. Postfix delivers mail with the privileges of the recipient email. This, for email to be delivered to a new user, the new user must be in the "mail" group. If all users are in the "mail" group, then the DOS attack can still be performed. Postfix does NOT use a setgid mail binary to deliver email. It drops privileges to that of the recipient user.
why don't you set postfix to deliver mail to $HOME/.maildir ?
Anyway, the permissions of mailbase are also used by the default postfix installation and other package maintainers from other distros are also using 775 root:mail. Moreover, the O'Reilly book on Postfix disagree with you. It says the spool directory cannot be world writable and if it is, Postfix won't create new mailboxes while it still deliver mail to existing mailboxes. Cheers, Ferdy
*** Bug 91595 has been marked as a duplicate of this bug. ***
*** Bug 102719 has been marked as a duplicate of this bug. ***