Re: mailbox file permissions and timestamps
On Wed, 30 Mar 2011 11:11:08 +0200, Stanisław Findeisen wrote:
> What are the correct mailbox file mode bitmasks in /var/mail? This is
> what I have:
>
> :/var/mail$ ls -al
> total 20
> drwxrwsr-x 2 root mail 4096 2011-03-30 10:00 .
> drwxr-xr-x 16 root root 4096 2010-01-14 20:21 ..
> -rw------- 1 root mail 582 2010-04-13 21:31 root
> -rw------- 1 u1 mail 528 2011-01-31 09:56 u1
> -rw-rw---- 1 u2 mail 528 2011-03-30 10:00 u2
I also have such perms for my mbox file (with Exim):
sm01@stt008:~$ ls -al /var/mail
total 0
drwxrwsr-x 2 root mail 72 feb 15 22:03 .
drwxr-xr-x 15 root root 360 nov 14 2009 ..
-rw-rw---- 1 sm01 mail 0 feb 15 22:03 sm01
> Is this correct?? The u1 user account is disabled, while u2 is active.
> The 'mail' group seems to have no users.
sm01@stt008:~$ grep mail /etc/group
mail:x:8:
> I was also looking at Access, Modify and Change times of u2 file using
> stat utility. It looks that Modify and Change times get updated on new
> mail coming in (Postfix) (Access time remains the same), while all 3
> get updated on mail being pop3 (dovecot). If there is no new mail to
> pop3, then the timestamps do not change. I thought Access is about read
> or write, and Modify is about metadata (name, mode...) modification??!
> What is going on?
>
> I am running 5.0.8 (Lenny).
sm01@stt008:~$ stat /var/mail/sm01
File: «/var/mail/sm01»
Size: 0 Blocks: 0 IO Block: 4096 fichero
regular vacío
Device: 803h/2051d Inode: 58853 Links: 1
Access: (0660/-rw-rw----) Uid: ( 1000/ sm01) Gid: ( 8/ mail)
Access: 2011-03-30 13:58:53.000000000 +0200
Modify: 2011-03-30 13:47:20.000000000 +0200
Change: 2011-03-30 13:47:20.000000000 +0200
sm01@stt008:~$ cat /var/mail/sm01
sm01@stt008:~$ stat /var/mail/sm01
File: «/var/mail/sm01»
Size: 0 Blocks: 0 IO Block: 4096 fichero
regular vacío
Device: 803h/2051d Inode: 58853 Links: 1
Access: (0660/-rw-rw----) Uid: ( 1000/ sm01) Gid: ( 8/ mail)
Access: 2011-03-30 13:59:07.000000000 +0200
Modify: 2011-03-30 13:47:20.000000000 +0200
Change: 2011-03-30 13:47:20.000000000 +0200
The file successfully alters "access" data after issuing the cat command.
sm01@stt008:~$ mail sm01 -s test
test
.
Cc:
sm01@stt008:~$ stat /var/mail/sm01
File: «/var/mail/sm01»
Size: 534 Blocks: 8 IO Block: 4096 fichero
regular
Device: 803h/2051d Inode: 58853 Links: 1
Access: (0660/-rw-rw----) Uid: ( 1000/ sm01) Gid: ( 8/ mail)
Access: 2011-03-30 13:59:07.000000000 +0200
Modify: 2011-03-30 13:59:51.000000000 +0200
Change: 2011-03-30 13:59:51.000000000 +0200
But does not change when it receives new mail...
sm01@stt008:~$ mail
sm01@stt008:~$ stat /var/mail/sm01
File: «/var/mail/sm01»
Size: 0 Blocks: 0 IO Block: 4096 fichero
regular vacío
Device: 803h/2051d Inode: 58853 Links: 1
Access: (0660/-rw-rw----) Uid: ( 1000/ sm01) Gid: ( 8/ mail)
Access: 2011-03-30 14:00:58.000000000 +0200
Modify: 2011-03-30 14:02:10.000000000 +0200
Change: 2011-03-30 14:02:10.000000000 +0200
And is again altered when someone reads the file.
Greetings,
--
Camaleón
Reply to: