[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: correct settings of /var/mail/user?

On Thu, Jul 08, 2021 at 04:35:48PM +0200, Hans wrote:
> Am Donnerstag, 8. Juli 2021, 16:27:38 CEST schrieb The Wanderer:
> Zhat is strange, as I also can not delete the file /var/mail/myusername 
> manually - just because of access rights.

You're not supposed to be able to delete that file.  You should, however,
be able to truncate it to zero bytes in size.

The issue that most people face with centralized /var/mail (or
/var/spool/mail) mbox files is locking.  You can't create a "dot-lock"
file in the spool directory, for the same reason that you can't delete
your inbox (or create your inbox, if it doesn't already exist).

Therefore, mutt normally includes a locking helper program, which is
setgid mail (or whatever is needed on the target platform), which can
create/remove dot-lock files in the spool directory.

On Debian, it looks like this:

unicorn:~$ dpkg -L mutt | grep lock
unicorn:~$ ls -ld /usr/bin/mutt_dotlock
-rwxr-sr-x 1 root mail 14496 Jun  6 15:11 /usr/bin/mutt_dotlock*

If you're getting errors about locking failure, it could be because
you're missing this.

If you're getting errors about not being able to delete your inbox file,
ignore those.  Or file a bug report asking the developers to kindly
tell mutt not to try doing things it shouldn't be doing.

I have no idea whether my current version of mutt would try to delete
a central-spool mbox file if I removed all of the messages from it, for
two reasons: I am *so* far from having an empty inbox that the concept
of removing all the messages is ludicrous, and I don't use a central-spool
mbox file.  I'm using $HOME/Maildir/.

Reply to: