Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!hplabs!hplabsz!marvit From: marvit@hplpm.hpl.hp.com (Peter Marvit) Newsgroups: comp.mail.mh Subject: Re: fill subject field in 'forw' Message-ID: Date: 29 Nov 89 02:25:14 GMT References: <3060001@hpgnd.HP.COM> Sender: news@hplabsz.HPL.HP.COM Organization: Hewlett-Packard Laboratories, Palo Alto, CA Lines: 123 In-reply-to: chris@hpgnd.HP.COM's message of 28 Nov 89 10:06:52 GMT > i'd like the cmd 'forw' to fill the subject field automatically > with the subject of the message to be forwarded. > > Is there any way to achieve that ? [[ The short answer, you can't since forw is non-programtic. However, here is a kluge I put together a while ago for some collegues. If you need a lengthy explanation of why, e-mail me. On the other hand, forw'ding from mh-e within GnuEmacs does this right thing, since Gnu does extra processing! -PM ]] Ok fans, here's the Mail Heretic's prescription for getting "forw" to include the original header. 1. Cut at the dotted lines the chuck of code at the end of this message and unpack the following file in your ~/Mail directory. Edit forw-test.form to include your own "From" field, or delete that line entirely. 2. As root, mv /usr/local/bin/mh/forw /usr/local/bin/mh/forw.orig ln /usr/local/bin/mh/repl /usr/local/bin/mh/forw Note that you must call the original forw by its new name if you use it. 3. Edit the "forw" entry in your ~/.mh_profile so it looks something like this: forw: forw-test.form -filter mhl.forw-test -annotate -inplace Ignore "-annotate" and "-inplace" if you don't use them. If you do, however, your forwarded messages will be marked as "replied to". If you want to get *really* fancy and annotate them properly, I can build you a shell script which will do this, albeit imperfectly. 4. Note: you can no longer forward more than one message at a time! -Peter #---------------------------------- cut here ---------------------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by marvit at hplpm on Wed Dec 16 09:46:10 1987 # # This archive contains: # mhl.forw-test forw-test.form # # Existing files will not be overwritten. # Modification/access file times will be preserved. # Error checking via wc(1) will be performed. # Error checking via sum(1) will be performed. if test -f mhl.forw-test then echo Will not overwrite existing file mhl.forw-test exit 1 fi echo x - mhl.forw-test sed 's/^@//' >mhl.forw-test <<'@EOF' width=133,overflowtext=,overflowoffset=10 leftadjust,compress,compwidth=9 : :------- Forwarded Message : Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>" @From: To: cc: Subject: : body:nocomponent,width=133,overflowoffset=0,noleftadjust,nocompress : :------- End of Forwarded Message @EOF set -- `sum forw-test.form <<'@EOF' To: \n\ cc: \n\ bcc: \n\ fcc: \n\ @From: Peter Marvit \n\ X-Mailer: mh6.5\n\ %<{subject}Subject: [Forwarded:] %{subject}\n%>\ -------- @EOF set -- `sum