Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 278332 - mail-client/mutt-1.5.20: does not open /var/spool/mail/MBOX in Read/Write mode.
Summary: mail-client/mutt-1.5.20: does not open /var/spool/mail/MBOX in Read/Write mode.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-19 15:19 UTC by OKUMURA N. Shin-ya
Modified: 2009-07-30 15:40 UTC (History)
0 users

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 OKUMURA N. Shin-ya 2009-07-19 15:19:01 UTC
mail-client/mutt-1.5.20-r1 does not open /var/spool/mail/${LOGNAME} (mbox) in read/write mode.
mail-client/mutt-1.5.19-r1 does.

I have not tried in MMDF or Maildir yet.

Reproducible: Sometimes

Steps to Reproduce:
1. mutt
2. type 'd' (delete)

Actual Results:  
mutt says, 'Mailbox is read-only.'


Expected Results:  
mutt displays 'D' on the mail item.


Without KDE-4.2.x, the above might not be happens. (not confirmed yet)
Comment 1 Fabian Groffen gentoo-dev 2009-07-21 06:59:50 UTC
how is your /var/spool/mail/${LOGNAME} mounted?
Comment 2 OKUMURA N. Shin-ya 2009-07-21 14:22:06 UTC
$ fgrep ' /var ' /proc/mounts 
/dev/hdd1 /var reiserfs rw,noatime 0 0
$
Comment 3 Fabian Groffen gentoo-dev 2009-07-22 09:17:10 UTC
If this happens, can you actually change the folder to read/write mode?  The fs is not by chance read-only?  You don't accidentially use Esc-c to open the mailbox?
Comment 4 OKUMURA N. Shin-ya 2009-07-23 14:52:03 UTC
Now, I am trying again with mutt-1.5.20-r1.

> If this happens, can you actually change the folder to read/write mode?

Yes, I can in ~/Mail.
No, I cannot in /var/spool/mail.

> The fs is not by chance read-only?

Never.
I can write to /var/spool/mail/MBOX with /usr/bin/vim and /usr/bin/touch it.

$ ls -ld /var/spool/mail
drwxrwxr-x 2 root mail 216 2009-07-23 22:51 /var/spool/mail
$ ls -l /var/spool/mail/ons
-rw------- 1 ons mail 2288073 2009-07-23 22:51 /var/spool/mail/ons
$ touch /var/spool/mail/ons
$ ls -l /var/spool/mail/ons
-rw------- 1 ons mail 2288073 2009-07-23 23:40 /var/spool/mail/ons
$ 

> You don't accidentially use Esc-c to open the mailbox?

No. I don't.
/var/spool/mail/${LOGNAME} is opened as R/O with typing 'c' and '/var/spool/mail/ons.
With Esc-c, R/O also.
Comment 5 OKUMURA N. Shin-ya 2009-07-23 15:38:15 UTC
Now I try to make install vanilla mutt-1.5.19 into /usr/local/bin.
--

$ which -a mutt
/usr/local/bin/mutt
/usr/bin/mutt
$ /usr/local/bin/mutt -v
Mutt 1.5.19 (2009-01-05)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.30-gentoo-r1 (x86_64)
ncurses: ncurses 5.7.20081102 (compiled with 5.7)
libidn: 1.15 (compiled with 1.15)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Feb  2 2008 05:24:12)
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  -USE_FCNTL  +USE_FLOCK   
-USE_POP  -USE_IMAP  -USE_SMTP  
-USE_SSL_OPENSSL  -USE_SSL_GNUTLS  -USE_SASL  -USE_GSS  -HAVE_GETADDRINFO  
-HAVE_REGCOMP  +USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  +CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/spool/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@mutt.org>.
To report a bug, please visit http://bugs.mutt.org/.

$ /usr/bin/mutt -v
Mutt 1.5.20 (2009-06-14)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.30-gentoo-r1 (x86_64)
ncurses: ncurses 5.7.20081102 (compiled with 5.7)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Feb  2 2008 05:24:12)
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  -USE_FCNTL  +USE_FLOCK   
-USE_POP  +USE_IMAP  -USE_SMTP  
+USE_SSL_OPENSSL  -USE_SSL_GNUTLS  +USE_SASL  -USE_GSS  +HAVE_GETADDRINFO  
-HAVE_REGCOMP  +USE_GNU_REGEX  +COMPRESSED  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  -CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  -HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/spool/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc/mutt"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <mutt-dev@mutt.org>.

dgc.subjrx
fg.smarttime
vvv.initials
vvv.quote
patch-1.5.6.dw.mbox-hook.1
rr.compressed
patch-1.5.4.lpr.collapse_flagged Lukas P. Ruf <lukas.ruf@lpr.ch>
$ 

--
And then, I switched dotlock to /usr/local/bin.
--

$ fgrep dotlock .muttrc
set dotlock_program=/usr/local/bin/mutt_dotlock
$

--
Now, /usr/bin/mutt (Gentoo mutt-1.5.20-r1) and /usr/local/bin/mutt (Vanilla mutt-1.5.19) works fine.

The next, I did dotlock to the default (/usr/bin).
--

$ fgrep dotlock .muttrc
#set dotlock_program=/usr/local/bin/mutt_dotlock
$ /usr/bin/mutt -D | fgrep dotlock
dotlock_program="/usr/bin/mutt_dotlock"
$ /usr/local/bin/mutt -D | fgrep dotlock
dotlock_program="/usr/bin/mutt_dotlock"
$

--
Now, both of the two opens /var/spool/mail/MBOX as R/O.
Comment 6 OKUMURA N. Shin-ya 2009-07-23 16:06:13 UTC
/usr/bin/mutt_dotlock (Gentoo mutt-1.5.20-r1) and /usr/local/bin/mutt_dotlock (Vanilla mutt-1.5.19) has diffrent permisson from each other.
It may be the reason, may not?

Makefile of mutt-1.5.20 says, mutt_dotlock must be chgrp-ed to mail and setgid-ed.
--

$ ll /usr/bin/mutt_dotlock /usr/local/bin/mutt_dotlock 
-rwxr-s--x 1 root root  47472 2009-07-23 22:33 /usr/bin/mutt_dotlock
-rwxr-sr-x 1 root mail 134274 2009-07-24 00:22 /usr/local/bin/mutt_dotlock
$ fgrep -n -A2 -B1 chgrp mutt-1.5.19/Makefile
1066-   if test -f $(DESTDIR)$(bindir)/mutt_dotlock && test xmail != x ; then \
1067:           chgrp mail $(DESTDIR)$(bindir)/mutt_dotlock && \
1068-           chmod 2755 $(DESTDIR)$(bindir)/mutt_dotlock || \
1069-           { echo "Can't fix mutt_dotlock's permissions!" >&2 ; exit 1 ; } \
$ fgrep -n -A2 -B1 chgrp mutt-1.5.20/Makefile
1192-   if test -f $(DESTDIR)$(bindir)/mutt_dotlock && test xmail != x ; then \
1193:           chgrp mail $(DESTDIR)$(bindir)/mutt_dotlock && \
1194-           chmod 2755 $(DESTDIR)$(bindir)/mutt_dotlock || \
1195-           { echo "Can't fix mutt_dotlock's permissions!" >&2 ; exit 1 ; } \
$
Comment 7 Fabian Groffen gentoo-dev 2009-07-23 17:02:36 UTC
reopening, seems we get close to the cause of this
Comment 8 Fabian Groffen gentoo-dev 2009-07-23 17:14:18 UTC
the ebuild passes this onto configure:
--enable-external-dotlock

this seems to enable use of the mutt_dotlock program, otherwise it will compile in some dotlock support
Comment 9 Fabian Groffen gentoo-dev 2009-07-23 17:23:46 UTC
ok, it just controls whether there should be a built-in dotlock, or a separate program, in both cases the same code.

Could you check if your var/log/messages reports a setuid or something that fails?
Comment 10 Fabian Groffen gentoo-dev 2009-07-23 17:32:04 UTC
what does
  ls -la /usr{,/local}/bin/mutt_dotlock
show for permissions?
Comment 11 Fabian Groffen gentoo-dev 2009-07-23 17:36:43 UTC
I think I found it.

what's your UID (with what user are you emerging)?
Comment 12 OKUMURA N. Shin-ya 2009-07-24 10:28:08 UTC
> Could you check if your var/log/messages reports a setuid or something that fails?

I don't found anything, as far as I know.

> ls -la /usr{,/local}/bin/mutt_dotlock

As above;
$ ls -la /usr{,/local}/bin/mutt_dotlock
-rwxr-s--x 1 root root  47472 2009-07-23 22:33 /usr/bin/mutt_dotlock
-rwxr-sr-x 1 root mail 134274 2009-07-24 00:22 /usr/local/bin/mutt_dotlock

> what's your UID (with what user are you emerging)?

$  LANG=C id -u
501
$ 

I usually do emerge by root.
Comment 13 Fabian Groffen gentoo-dev 2009-07-24 10:29:27 UTC
do you have userpriv in FEATURES?
Comment 14 Fabian Groffen gentoo-dev 2009-07-24 10:30:24 UTC
Anyway, I found the configure script doing some checks for maildir and mbox.  For the former it thinks no setuid is necessary, for the latter it is.  Perhaps we should just fix it from the ebuild to be correct.
Comment 15 OKUMURA N. Shin-ya 2009-07-24 10:41:53 UTC
> do you have userpriv in FEATURES?

Yes I do.

# emerge --info | fgrep -i feature
FEATURES="assume-digests ccache collision-protect cvs distlocks fixpackages multilib-strict parallel-fetch protect-owned sandbox sfperms sign splitdebug strict stricter unmerge-orphans userfetch userpriv usersandbox"
Comment 16 Fabian Groffen gentoo-dev 2009-07-29 19:56:41 UTC
I tried to fix this in 1.5.20-r4, can you please give it a try?
Comment 17 OKUMURA N. Shin-ya 2009-07-30 12:58:45 UTC
Sure, where shall I get the ebuild (or patch)?
Comment 18 Fabian Groffen gentoo-dev 2009-07-30 12:59:26 UTC
just emerge --sync
Comment 19 OKUMURA N. Shin-ya 2009-07-30 15:40:46 UTC
It works fine, thanks a lot!