From owner-freebsd-questions@FreeBSD.ORG Thu Jul 26 00:36:51 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2D3C106566C for ; Thu, 26 Jul 2012 00:36:51 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 635A98FC0C for ; Thu, 26 Jul 2012 00:36:51 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q6Q0bl9b086604; Wed, 25 Jul 2012 19:37:47 -0500 (CDT) Date: Wed, 25 Jul 2012 19:37:47 -0500 (CDT) From: Robert Bonomi Message-Id: <201207260037.q6Q0bl9b086604@mail.r-bonomi.com> To: freebsd-questions@freebsd.org, mexas@bristol.ac.uk In-Reply-To: <201207251544.q6PFi23j012353@mech-cluster241.men.bris.ac.uk> Cc: Subject: Re: mail(1) save command does not work as in the man page X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 00:36:51 -0000 > From owner-freebsd-questions@freebsd.org Wed Jul 25 10:47:21 2012 > Date: Wed, 25 Jul 2012 16:44:02 +0100 (BST) > From: Anton Shterenlikht > To: freebsd-questions@freebsd.org > Subject: mail(1) save command does not work as in the man page > > 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: *SOMETIMES* that is true. > > $ mail -f mbox > Mail version 8.1 6/6/93. Type ? for help. > "mbox": 1 message > > 1 mexas@bristol.ac.uk Wed Jul 25 16:36 46/2045 "kuku" > & s 1 somefile > "somefile" [New file] > & h > >* 1 mexas@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@bristol.ac.uk Wed Jul 25 16:36 46/2045 "kuku" > & q > > So the mail was copied to 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@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? This is the 'standard'/*EXPECTED* behavior of 'mail', and has been, since the early 1980s. (I still use 'mail' as my standard mail client'.) If invoked _without_ specifying a maibox, 1) mail that is written to another mailbox is deleted from the inbox on exit. 2) mail that was read, but _not_ written/deleted is saved to 'mbox'. If invoked *WITH* '-f', messages are not deleted/moved on exit. you must _explicitly_ perform any desired actions. You've found a bug in the _documentation_, not the progam. :)