home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / pmm2elm.zip / pmm2elm.sh next >
Text File  |  1997-02-15  |  3KB  |  83 lines

  1. #! sh
  2. # $Id: pmm2elm.sh,v 1.1 1997/02/16 00:59:21 stefand Exp $
  3. # pmm2sh.sh: Create ELM or YARN mail folders from  PMMail mail folders.
  4. #
  5. # This converts the mail in PMMail (1.x) folders into a format the
  6. # OS/2 port of elm 2.3 by Kai Uwe Rommel can handle: Messages 
  7. # are separated by 20 ^A (Ctrl-A) characters.
  8. # (In vi, e.g., enter those by hitting Ctrl-V -Ctrl-A).
  9. # Actually, it doesn't _convert_ the PMMail folder, as it doesn't
  10. # change the PMMail folder, it just creates ELM folders.
  11. # If you change the 20 ^A to a full stop, and ^L^@^@ you can also
  12. # use it to change the stuff to MAILBOX folders YARN understands.
  13. #
  14. # This script relies on the following to be installed on your
  15. # computer: sh.exe (tested with sh.exe from ksh527rt.zip), and
  16. # cat.exe and mv.exe. They require the emx runtime library 
  17. # (emxrt.zip)and all that can be found on ususal OS/2 ftp sites.
  18. # Put this script somewhere in your path.
  19. #
  20. # To create a mail folder, say from the folder 'John', open a
  21. # command line window, start sh.exe, and go to the directory where 
  22. # that folder lives, e.g.:
  23. #
  24. #  sh.exe
  25. #  cd  E:/bin/os2/pmmail/pmmail/stefan0.act/Mail0.FLD/John0.FLD
  26. # There you will find a lot of files with the extension *.msg, and
  27. # these are your messages. Simply type:
  28. #
  29. #  pmm2elm *.msg > jdoe
  30. #
  31. # and you will have an ELM mail folder of the name 'jdoe'.
  32. # Now you can move that one into your $MAIL directory, and elm
  33. # will find it:
  34. #
  35. #  mv -i jdoe f:/usr/sad/mail
  36. #
  37. # If the folder 'John' exists already it will complain, then you 
  38. # can simply append the stuff from PMMail to the existing ELM folder:
  39. #
  40. #  cat jdoe >> f:/usr/sad/mail/jdoe
  41. #
  42. # and elm is happy with that, too. 
  43. # If you have a large directory structure you will want to make that
  44. # more automatic, but I don't, and it is a bit hard to guess from
  45. # PMMails 8.3 folder names what the ELM folder name is that you want.
  46. # In the above example the PMMail folder for John actually becomes the
  47. # ELM folder jdoe, which is what his email name might be (say:
  48. # John is jdoe@bla.blub).
  49. # Also, one can probably do all that neatly with REXX, but people who
  50. # use elm are likely to have all the GNU stuff (sh, mv, cat, ..)
  51. # anyway.
  52. #
  53. # As always: Back up your ELM or YARN folders before you play with this,
  54. # and it comes without any explicit or implied warranty, you use it at
  55. # your own risk.
  56. #          
  57. # Stefan A. Deutscher, 15-Feb-1997  
  58. # (sad@utk.edu, stefand@ibm.net, stefand@elphy.irz.hu-berlin.de)
  59. #
  60.  
  61.  
  62.  
  63. if [ $# -eq 0 -o "$1" = "-h" ]; then
  64.  echo "Usage: [sh] pmm2elm.sh pattern > output_folder"
  65.  echo
  66.  echo "Example:   sh pmm2elm.sh *.msg  > peter"
  67.  echo "           pmm2elm    *.msg  > jdoe"
  68. fi
  69.  
  70. while [  $# -gt 0 -a -f "$1"  ] 
  71. do
  72.  echo 
  73.  cat $1
  74.  shift
  75. done
  76.  
  77. # $Log: pmm2elm.sh,v $
  78. # Revision 1.1  1997/02/16 00:59:21  stefand
  79. # Initial revision
  80. #
  81. # end of pmm2elm.sh
  82.