From: shah@fnsony.fnal.gov (Hemant Shah)
Newsgroups: comp.unix.admin
Subject: Re: VMS to UNIX transition, e-mail questions
Date: 26 Jan 1993 18:10:05 GMT
Organization: Fermi National Accelerator Laboratory, Batavia, IL
Distribution: usa
Reply-To: shah@fnsony.fnal.gov
NNTP-Posting-Host: fnsony.fnal.gov

In article <C1GuE7.LtF@ra.nrl.navy.mil>, browning@ccfsun.nrl.navy.mil (Donald R. Browning) writes:
|> Our site provides e-mail service on a VAXcluster for
|> approximately 200 administrative users.  Most of these are
|> novice users for whom e-mail is the primary, and in many
|> cases the exclusive, reason for accessing our systems.  Our
|> VMS VAXes are being phased out this year, replaced by a UNIX
|> platform.  Some of these users will be able to fall back on
|> VAXes in their divisions; while others, with PCs or Macs,
|> will be supplied with a POPmail interface to access messages
|> stored on our UNIX-based file server system.  However, we
|> expect that many users will need to make the transition to
|> the UNIX mail utility.
|> 
|> 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.
|> 
|> With this situation in mind, I would like to pose the
|> following questions:
|> 
|> 
|> 	  1) If your site has gone through a transition like
|> 	  this, how did you handle the e-mail message
|> 	  storage?
|> 	  
|> 	  2) Has anyone written a utility that will convert
|> 	  VMS mail headers into a format that can be
|> 	  "recognized" by the UNIX Mail utility?  Ideally, 
|> 	  we would like to create an extracted file of VMS 
|> 	  mail, convert it, and then ftp the file to our
|> 	  UNIX platform as the user's "mbox" file.
|> 	  
|> 	  3) Are there other important considerations that
|> 	  we have overlooked?
|> 
|> 
|> Please e-mail responses.
|> 
|> 
|> 
|> -- 
|> 
|> 
|> 				Donald R. Browning
|> 				Code 5841.3 

Here is the FORTRAN program I have received from Dan Fox. 
I have not yet tried it this program myself, but some users have tried and they
were happy :-)


From: fox@vulcan.noarl.navy.mil (Dan Fox)

I just sent this to Francisco...  It was how I converted all the VAX
mail folders over to files that unix mail would understand.  There were
a few reported failures, but it handled all my mail folders properly.


c--------------------------------------------------------------
c  program:  mailfix
c--------------------------------------------------------------
c  purpose:  convert VAX mail to UNIX
c--------------------------------------------------------------
c  version:  1.0 : 25 Oct 1989 : D N Fox : NORDA Code 323
c--------------------------------------------------------------
c  procedure:
c     1. On the VAX side, if you have any new mail, read it
c        and exit MAIL so that when you come back into MAIL,
c        you have no new messages.
c     2. Select all messages using something like:
c             mail> select/since=01-jan-1900
c     3. Save all these to a file:
c             mail> extract/all dua10:[scratch.you]vax.mail
c     4. ftp this file to your Sun
c     5. On the Sun side, run the 'mailfix' program:
c             cat vax.mail | mailfix > mbox_vax
c     6. Now you can read 'mbox_vax' as a normal mailbox.
c        In Mailtool, you can enter this name on the file line
c        and click on the 'folder' button.  
c--------------------------------------------------------------
      character*1 buffer(200000)
      nchar=1
      do imsg=1,9999
c  read until a ^L (or EOF) is encountered
        call getmsg(buffer,200000,nchar,ierr)
c  if this is a real message, fix it and write it out
        if(nchar.gt.1) then
          call fixmsg(buffer,nchar)
          call putmsg(buffer,nchar)
        endif
c  set up for remainder of next msg
        buffer(1)=char(12)
        nchar=2
c  did we run into EOF?
        if(ierr.ne.0) call exit(0)
      enddo
      end
c--------------------------------------------------------------
      subroutine getmsg(msg,maxlen,nchar,ierr)
c--------------------------------------------------------------
c  on entry, nchar points to where to put the first character
c  read.  on exit, nchar points to the last valid character
      character*1 c,newpag,msg(*)
      integer getc
      newpag=char(12)
      i1=nchar
      do i=i1,maxlen
c  read a character
        ierr=getc( c )
c  if EOF, return
        if(ierr.ne.0) return
c  if it's a ^L character just return with what we've got so far
        if(c.eq.newpag) return
c  otherwise, save it...
        msg(i)=c
        nchar=i
      enddo
c  if we get here, we ran out of space - that's an error!!
      return
      end
c--------------------------------------------------------------
      subroutine fixmsg(msg,nchar)
c--------------------------------------------------------------
      character*1 msg(*)
      character*5 test
c  make sure we have one that needs fixing...
      do i=1,5
        test(i:i)=msg(2+i)
      enddo
      if(test.eq.'From:') then
        msg(1)=msg(2)
        msg(7)=' '
      endif
      return
      end
c--------------------------------------------------------------
      subroutine putmsg(msg,nchar)
c--------------------------------------------------------------
      character*1 c,msg(*)
      integer putc
      do i=1,nchar
        c=msg(i)
        ierr=putc( c )
      enddo
      return
      end



-- 
-------------------------------------------------------------------------------
Hemant Shah                            | All the opinions expressed are my own
Fermi National Accelerator Laboratory  | and does not necessarily reflect
Systems Integration Group              | those of Fermilab.
E-mail :shah@fnal.fnal.gov             |
 Voice : (708) 840-8071	               | I haven't lost my mind
   Fax : (708) 840-2783                | it's backed on tape somewhere.
-------------------------------------------------------------------------------
Newsgroups: comp.unix.admin