[comp.mail.mh] Saving messages

gfink@iris.ucdavis.edu (George Fink) (12/13/89)

This may be apparent in some document or other, but I can't find it,
and its really irritating me.

How do you save a mail message off to a file after it has been inc'ed?
The only way I can think of is to cd to the folder's directory, then
cp it somewhere else.

This is only really necessary if you mail code or something that you
need to use in some other context, but it happens enough that there
must be an easy way to do this.

AdThanksvance,

--George (email, please - gfink@iris)
George Fink			|  gfink@{clover,iris}.ucdavis.edu
University of California, Davis	|  ucbvax!ucdavis!{clover,iris}!gfink

asa@mentor.cc.purdue.edu (Viswamitra T) (12/13/89)

In article <6260@ucdavis.ucdavis.edu> gfink@iris.ucdavis.edu (George Fink) writes:
>
>How do you save a mail message off to a file after it has been inc'ed?

If the command is something different than, rather easier than

	show <message number>  >  <filename>

	put me on the mailing list too.
>AdThanksvance,

Thanks

>--George (email, please - gfink@iris)

__
Viswamitra  (email:  asa@mentor.cc.purdue.edu)

ken@cs.rochester.edu (Ken Yap) (12/13/89)

|>How do you save a mail message off to a file after it has been inc'ed?
|
|If the command is something different than, rather easier than
|
|	show <message number>  >  <filename>

You want to be careful with this: some mhl templates fold lines at column 79
or something like that, breaking programs and shar files. Personally I
prefer

	cp `mhpath +inbox NN` filename

emv@math.lsa.umich.edu (Edward Vielmetti) (12/13/89)

I have two different "show" procedures.  From the .mh_profile:

sho: -showproc cat
show: -showproc mhl

Make 'sho' a link to '/usr/new/bin/show' or wherever your show program
lives.  This way I use 'show' to see a message formatted, and 'sho'
to see it as it is w/o header munging.

--Ed

shah@cs.cornell.edu (Amitabh Shah) (12/13/89)

In article <6260@ucdavis.ucdavis.edu>, gfink@iris (George Fink) writes:
>
>How do you save a mail message off to a file after it has been inc'ed?
>The only way I can think of is to cd to the folder's directory, then
>cp it somewhere else.

If you use mh within emacs (mh-e) then any inc'ed message can be written to a
file using ">" command. With standard mh, you can do "show message > file", but
beware that the file would have the format of your mhl filter.

-amitabh.
_______________________________________________________________________________
Amitabh Shah                                    shah@cs.cornell.edu--(INTERNET)
Dept. of Computer Science                       shah@cornell------------(CSNET)
Upson Hall -- Cornell University                { ... }!cornell!shah-----(UUCP)
Ithaca NY 14853-7501                            (607) 255-8597----------(VOICE)

tr@madeleine.ctt.bellcore.com (tom reingold) (12/13/89)

On the subject of "Saving messages", gfink@iris.ucdavis.edu (George
Fink) writes:

$ This may be apparent in some document or other, but I can't find it,
$ and its really irritating me.
$ 
$ How do you save a mail message off to a file after it has been inc'ed?
$ The only way I can think of is to cd to the folder's directory, then
$ cp it somewhere else.
$ 
$ This is only really necessary if you mail code or something that you
$ need to use in some other context, but it happens enough that there
$ must be an easy way to do this.

You can use

	show > file

which might format it slightly.  If you want no formatting at all, use

	show -noshowproc > file

Tom Reingold                   |INTERNET:       tr@bellcore.com
Bellcore                       |UUCP:           bellcore!tr
444 Hoes La room 1H217         |PHONE:          (201) 699-7058 [work],
Piscataway, NJ 08854-4182      |                (201) 287-2345 [home]

allbery@ncoast.org (Brandon S. Allbery) (12/14/89)

In article <35117@cornell.UUCP> shah@cs.cornell.edu (Amitabh Shah) writes:

   In article <6260@ucdavis.ucdavis.edu>, gfink@iris (George Fink) writes:
   >How do you save a mail message off to a file after it has been inc'ed?
   >The only way I can think of is to cd to the folder's directory, then
   >cp it somewhere else.

   If you use mh within emacs (mh-e) then any inc'ed message can be written to a
   file using ">" command. With standard mh, you can do "show message > file", but
   beware that the file would have the format of your mhl filter.

If you want just the body of the file, try:

		sed '1,/^$/d' `mhpath +folder message`

I have a number of shell scripts which do this, extract files with filenames
on the subject line (as "Subject: Transmittal: filename"), extract uuencoded
files, extract shar files, extract and apply patch files (even catching the
flags listed in the message if the patch is created by metaconfig), etc.

++Brandon
--
Brandon S. Allbery    allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)*
expnet.all: Experiments in *net management and organization.  Mail me for info.
-- 
Brandon S. Allbery    allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)*
expnet.all: Experiments in *net management and organization.  Mail me for info.

bd@HP-SES.SDE.HP.COM (12/15/89)

> How do you save a mail message off to a file after it has been inc'ed?

My favorite (instead of -showproc cat) is:

	show -noshow >file

The name of the option is regrettably obscure, but it's easy to remember.

-- bd

bd@HP-SES.SDE.HP.COM (12/15/89)

> 	show -noshowproc > file

So THAT's where "-noshow" comes from!  It's an abbreviation!
-- bd