Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP Newsgroups: comp.unix.questions Subject: Re: tricky mail aliases Message-ID: <1137@bsu-cs.UUCP> Date: Sat, 12-Sep-87 13:19:57 EDT Article-I.D.: bsu-cs.1137 Posted: Sat Sep 12 13:19:57 1987 Date-Received: Sun, 13-Sep-87 08:31:02 EDT References: <264@mv06.ecf.toronto.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 36 Keywords: saving outgoing mail to particular files In article <264@mv06.ecf.toronto.edu> drascic@ecf.toronto.edu (SpIKe) writes: >I would like to organize my correspondance so that all letters to and >from a particular person would be stored in a single file. The following solution works under 4.3BSD, using the Berkeley mail program. 1. In .mailrc, put the line: alias tojoe "|sendtojoe" 2. Create an executable script called "sendtojoe" that contains: #! /bin/sh tee -a mbox.joe | mail joe To avoid an infinite loop, I used "tojoe" as the initial address, and later "joe" gets used for the actual delivery. The "-a" option to tee tells it to append to the argument file. You might try just using "joe" everywhere, but replacing the "mail" in the script (which refers to /usr/ucb/mail) with "/bin/mail" to avoid an infinite loop. I didn't try this. A much better solution is to use the MH mail system, and specify "Fcc: +inbox" in your template. Then all mail outgoing is saved in the "inbox" folder, and you can later refile as necessary with refile `pick +inbox -to joe -or -from joe` +joe which searches for all mail to or from Joe and refiles it in a folder called "joe". None of this is guaranteed to work under System V. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi