home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Mail / appnmail-1.8-Solaris / mailapp-utilities / mbox2bsd < prev    next >
Encoding:
Text File  |  1996-11-24  |  1010 b   |  30 lines

  1. #!/usr/local/bin/perl
  2. # -*-Perl-*-
  3. ###############################################################################
  4. #
  5. # File:         mbox2bsd
  6. # RCS:          /usr/local/sources/CVS/mailapp-utilities/mbox2bsd,v 1.1.1.1 1996/11/24 14:56:16 tom Exp
  7. # Description:  A quick hack to convert mailboxes to BSD format (handles NeXTmail)
  8. # Author:       Carl Edman
  9. # Created:      Sun Mar 31 14:34:54 1996
  10. # Modified:     Sun Mar 31 14:35:21 1996 (Carl Edman) cedman@capitalist.princeton.edu
  11. # Language:     Perl
  12. # Package:      N/A
  13. # Status:       Experimental (Do Not Distribute)
  14. #
  15. # (C) Copyright 1996, but otherwise this file is perfect freeware.
  16. #
  17. ###############################################################################
  18.  
  19. $ascii="";
  20.     
  21. while(<>) {
  22.     print $_;
  23.     if (/^Next-Reference: +([^ ]*),/o) {
  24.         $path=substr($ARGV,$[,rindex($ARGV,'/')+1);
  25.         $ascii=`rtf-ascii $path/$1/index.rtf`;
  26.         chop $ascii;
  27.     }
  28.     if (/^$/o && ($ascii ne "")) { print $ascii; print "\n"; $ascii=""; }
  29. }
  30.