mail(1) save command does not work as in the man page

Anton Shterenlikht mexas at bristol.ac.uk
Wed Jul 25 15:44:18 UTC 2012


According to the man mail(1):

     save    (s) Takes a message list and a filename and appends each message
             in turn to the end of the file.  The filename in quotes, followed
             by the line count and character count is echoed on the user's
             terminal.

However, it seems the mail is copied, but not
deleted on exit:

$ mail -f mbox
Mail version 8.1 6/6/93.  Type ? for help.
"mbox": 1 message
>   1 mexas at bristol.ac.uk   Wed Jul 25 16:36  46/2045  "kuku"
& s 1 somefile       
"somefile" [New file]
& h
>*  1 mexas at bristol.ac.uk   Wed Jul 25 16:36  46/2045  "kuku"
& q

$ mail -f somefile 
Mail version 8.1 6/6/93.  Type ? for help.
"somefile": 1 message
>   1 mexas at bristol.ac.uk   Wed Jul 25 16:36  46/2045  "kuku"
& q

So the mail was copied to <somefile> file, as expected.
However, it's still in mbox file too:

$ mail -f mbox 
Mail version 8.1 6/6/93.  Type ? for help.
"mbox": 1 message
>   1 mexas at bristol.ac.uk   Wed Jul 25 16:36  46/2045  "kuku"
& q
$ 

This shouldn't happen. According to the man page
the expected behaviour is that message 1 should
be deleted from mbox on quit.

Any comments?



More information about the freebsd-questions mailing list