From: sdm7g@elvis.med.Virginia.EDU (Steven D. Majewski)
Newsgroups: comp.unix.admin,comp.mail.misc
Subject: Re: VMS to UNIX transition, e-mail questions
Date: 26 Jan 93 23:57:47 GMT
Distribution: usa
Organization: University of Virginia

In article <C1GuE7.LtF@ra.nrl.navy.mil> browning@ccfsun.nrl.navy.mil
writes: 
>
>A concern has been raised about "old" messages stored in VMS
>MAIL.MAI files.  If our users simply forward them to the
>UNIX platform or the file server, the original date of
>receipt will no longer appear when the UNIX user lists the
>message headers, i.e. they will see the date of transfer
>instead.  This should not be a problem for users who took
>our e-mail course and organized their messages in folders,
>as was highly recommended.  However, we anticipate that a
>number of these users will have many (a year's worth)
>messages stored in one folder, "MAIL", and that their most
>common method of searching through the messages listing is
>by scanning the receipt dates.
>


How hard it is depends (partly) on which mail-reader you use. 
There is no real standard (yet) for Unix mailboxes, and some
mail readers are fussier than other. 

MUSH may be the most accepting of the lot. 
For the others - what they will be fussy about is the exact format of
the date in the "From " line. 

What will work for mush is:

on VMS:
Mail>EXTRACT /ALL mailbox.vms

and then ftp ( or transfer in some way) the mailbox.vms file to the unix system.


Run the file thru 'awk' with the following script:

# awk.cmd
# if "\f\nFrom:" then assume it is beginning of a VMS Mail message
#   write out a couple of newlines, change "From:" to "From " and 
#   skip any VMS comments that might be on the line between the 
#   address and the date. ( If might be possible for comment string 
#   to lead the address, but all of the messages I have start with
#   the address. ) 
/\014/  { 
	  getline;
	  if ( $1 ~ /From:/ ) { 
	    print "\n\n\n" ;
	    print "From " $2 "\t" $(NF-1) " " $NF ;
	    NF = NF - 2 ; 
	  }
	  else { print "\f" ; } 
	}
{ print; } 
# end


e.g.:

 awk -f awk.cmd <mailbox.vms >mailbox.unix 



 'mush -f mailbox.unix '

should now work and display the correct date information. 
But elm,pine and some other mailers will still not like the VMS format of 
the dates. 

( Saving all of the messages to another file with mush didn't fix the 
  date problem. I don't know if piping them all to another file or to
  a save command works any better. ) 

If you need to fix the header fields further, try the 'formail' 
program in the 'procmail' package from: 
         Stephen R. van den Berg (AKA BuGless).   
	   berg@physik.tu-muenchen.de
	   berg@pool.informatik.rwth-aachen.de

I found this quite useful when I accidentally munged my mailbox into MH 
format, and couldn't find another way to restore it. 


===============================================================================
 Steven D. Majewski			University of Virginia 
 sdm7g@Virginia.EDU			Box 449 Health Sciences Center
 Voice: (804)-982-0831			1300 Jefferson Park Avenue
 FAX:   (804)-982-1616			Charlottesville, VA 22908
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Former UVA Department of Physiology, now Department of Molecular Physiology
and Biological Physics! [ Still the same spacious offices in Jordan Hall 
- only the letterhead has changed! ]