On Fri, Dec 16, 2022 at 02:21:41AM +0000, Tim Chase wrote:
> According to the POSIX definitions for mail(1) & mailx(1), the
> (s)ave command should save to "mbox" if the filename is not specified
> 
> > Save the specified messages in the file named by the pathname
> > file, or the mbox if the file argument is omitted
> 
> (newer spec)
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/mailx.html#tag_20_75_13_33
> 
> > s [file]
> >  Save the message in the named file (mbox is default).
> 
> (older spec)
> https://pubs.opengroup.org/onlinepubs/7908799/xcu/mail.html#tag_001_014_1339
> 
> 
> 
> However, when exercising this functionality, mail(1) on OpenBSD
> (also tested on FreeBSD where the same issue manifests[1]) doesn't
> support this:
> 
>   demo$ echo test | mail -s "test" demo # send self a message
>   demo$ mail
>   Mail version 8.1 6/6/93.  Type ? for help.
>   "/var/mail/demo": 1 message 1 new
>   >N  1 d...@localhost.my.do  Thu Dec 15 19:34  19/775   "test"
>   & s
>   No file specified.
> 
> While I'm not positive on the solution, I think it involves tweaking
> the save1() function in src/usr.bin/mail/cmd2.c such that instead
> of failing if it can't snarf(), it should set `file` to "mbox" or
> "&" so that expand() points to the mbox as required by POSIX.
> 
> -tkc
> 
> [1]
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268402
> 

hi.

currently mail(1) has these entries in FILES:

    FILES
         /var/mail/*                 post office (unless overridden
                                     by the MAIL environment
                                     variable)
         ~/mbox                      user's old mail

isn;t it the case that openbsd uses mailboxes in /var/mail by default,
instead of ~/mbox, as displayed?

it seems that mail(1) is really out of date regarding default mail spool
entries, but i may well have misunderstood the situation. once it's
clear, i can see if we need a code fix (out of my hands) or doc fix.

jmc

Reply via email to