Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 837707 - acct-user/mail: /var/spool/mail should be /var/mail
Summary: acct-user/mail: /var/spool/mail should be /var/mail
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Quality Assurance Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-10 19:35 UTC by Jonas Stein
Modified: 2022-04-22 08:37 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Stein gentoo-dev 2022-04-10 19:35:25 UTC
"5.11. /var/mail : User mailbox files (optional)
5.11.1. Purpose

The mail spool must be accessible through /var/mail and the mail spool files must take the form <username>. [44]

User mailbox files in this location must be stored in the standard UNIX mailbox format.
Rationale

The logical location for this directory was changed from /var/spool/mail in order to bring FHS in-line with nearly every UNIX distribution. This change is important for inter-operability since a single /var/mail is often shared between multiple hosts and multiple UNIX distribution (despite NFS locking issues).

It is important to note that there is no requirement to physically move the mail spool to this location. However, programs and header files must be changed to use /var/mail."
https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#varmailUserMailboxFiles

The following packages need changes:

qgrep "/var/spool/mail"
mail-filter/procmail/procmail-3.22-r15.ebuild:		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
mail-filter/procmail/procmail-3.22-r15.ebuild:		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
net-mail/mailutils/mailutils-3.14-r1.ebuild:		--with-mail-spool=/var/spool/mail \
net-mail/mailutils/mailutils-3.13-r1.ebuild:		--with-mail-spool=/var/spool/mail \
net-mail/mailutils/mailutils-3.12-r4.ebuild:		--with-mail-spool=/var/spool/mail \
mail-client/mutt/mutt-2.2.1.ebuild:		myconf+=( "--with-mailpath=${EPREFIX}/var/spool/mail" )
mail-client/mutt/mutt-2.2.2.ebuild:		myconf+=( "--with-mailpath=${EPREFIX}/var/spool/mail" )
mail-client/mutt/mutt-2.0.7.ebuild:		myconf+=( "--with-mailpath=${EPREFIX}/var/spool/mail" )
mail-client/s-nail/s-nail-14.9.22.ebuild:		VAL_MAIL='/var/spool/mail'
mail-client/s-nail/s-nail-14.9.24.ebuild:		VAL_MAIL='/var/spool/mail'
acct-user/mail/mail-0-r1.ebuild:ACCT_USER_HOME=/var/spool/mail
acct-user/postmaster/postmaster-0-r1.ebuild:ACCT_USER_HOME=/var/spool/mail
mail-mta/opensmtpd/opensmtpd-6.8.0_p2-r1.ebuild:		--with-path-mbox=/var/spool/mail \
mail-mta/postfix/postfix-3.7.0-r1.ebuild:		mypostconf="mail_spool_directory=/var/spool/mail"
mail-mta/postfix/postfix-3.8_pre20220407.ebuild:		mypostconf="mail_spool_directory=/var/spool/mail"
mail-mta/postfix/postfix-3.6.5-r2.ebuild:		mypostconf="mail_spool_directory=/var/spool/mail"


Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2022-04-10 20:43:42 UTC
> It is important to note that there is no requirement to physically move the mail spool to this location. However, programs and header files must be changed to use /var/mail."

Sounds like we should just symlink /var/mail to /var/spool/mail.
Comment 2 Eray Aslan gentoo-dev 2022-04-11 06:22:56 UTC
(In reply to Mike Gilbert from comment #1)
> Sounds like we should just symlink /var/mail to /var/spool/mail.

and we do via net-mail/mailbase

(In reply to Jonas Stein from comment #0)
> However, programs and header files must be
> changed to use /var/mail."

Noted. OK.
Comment 3 Ulrich Müller gentoo-dev 2022-04-11 17:48:45 UTC
(In reply to Mike Gilbert from comment #1)
> Sounds like we should just symlink /var/mail to /var/spool/mail.

Or the other way around? What is the advantage of having it in /var/spool/mail, other than backwards compatibility?
Comment 4 Mike Gilbert gentoo-dev 2022-04-11 17:55:21 UTC
(In reply to Ulrich Müller from comment #3)

It's easier/safer to create a symlink than to move data.
Comment 5 Ulrich Müller gentoo-dev 2022-04-11 19:26:40 UTC
(In reply to Mike Gilbert from comment #4)
> It's easier/safer to create a symlink than to move data.

Right. That's the backwards compatibility argument (and probably it doesn't matter much which way around the symlink is).


(In reply to Jonas Stein from comment #0)
> This change is important for inter-operability since a single /var/mail is
> often shared between multiple hosts and multiple UNIX distribution (despite
> NFS locking issues).

I wonder how many people do that in 2022. :)
Comment 6 Mike Gilbert gentoo-dev 2022-04-11 19:40:45 UTC
The symlink direction matters for existing systems that already have data stored in /var/spool/mail. The data would need to moved somehow before the symlink is created at /var/spool/mail.
Comment 7 Ulrich Müller gentoo-dev 2022-04-11 21:23:48 UTC
(In reply to Mike Gilbert from comment #6)
> The symlink direction matters for existing systems that already have data
> stored in /var/spool/mail. The data would need to moved somehow before the
> symlink is created at /var/spool/mail.

I don't think that we actually disagree here. For the functionality, it doesn't matter if we have /var/mail -> spool/mail or /var/spool/mail -> ../mail, and backwards compatibility prefers the former.
Comment 8 Larry the Git Cow gentoo-dev 2022-04-22 08:37:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c47ea1f2cf76cd9ef093eea23c795a109dd4e4ca

commit c47ea1f2cf76cd9ef093eea23c795a109dd4e4ca
Author:     Eray Aslan <eras@gentoo.org>
AuthorDate: 2022-04-22 08:29:56 +0000
Commit:     Eray Aslan <eras@gentoo.org>
CommitDate: 2022-04-22 08:36:00 +0000

    mail-mta/postfix: add 3.8_pre20220421, drop 3.8_pre20220417
    
    configure mail_spool_directory as /var/mail instead of /var/spool/mail
    
    Bug: https://bugs.gentoo.org/837707
    Signed-off-by: Eray Aslan <eras@gentoo.org>

 mail-mta/postfix/Manifest                                          | 2 +-
 ...stfix-3.8_pre20220417.ebuild => postfix-3.8_pre20220421.ebuild} | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)