[comp.emacs] un-BABYL-ify mail files

luke@mtuno.ATT.COM (s.l.jones) (12/07/89)

Does anyone have a program to un-BABYL-format about three years
worth of mail?  (Call it 280 KB.)  I would sincerely appreciate
such a thing, if one exists.

Thanks---we're talking major gratitude here---in advance,
Luke
-- 
S. Luke Jones,  luke@mtung.att.com  or  ...!att!mtung!luke    201/957-2733
AT&T Inf###Bell Labs, Rm. MT 2E-337, 200 Laurel Ave., Middletown, NJ 07748
DISCLAIMER: the opinions presented herein are solely my own, *NOT* AT&T's.
"System Test? That's for idiots!" --- me, misquoting "Dirty" Harry Calahan

montnaro@sprite.crd.ge.com (Skip Montanaro) (12/07/89)

In article <2771@mtuno.ATT.COM> luke@mtuno.ATT.COM (s.l.jones) writes:

   Does anyone have a program to un-BABYL-format about three years
   worth of mail?

I modified Nate Hess's script/ELisp files awhile ago. The result:

#!/bin/sh
#
# usage:	rmail-to-mail file1 file2 ...
#
# result:	file1~     is the original Babyl file
#		file1      is an empty Babyl file
#		file1.mail is a UNIX mail file with the messages from file1

cat > /tmp/$$.el << EOF
;;;
;;; Author:  Nathan Hess  (woodstock@hobbes.intel.com)
;;;
;;

(let ((file-to-be-converted (buffer-file-name))
      (message-count 0)
      (rmail-delete-after-output t)
      (unix-style-file-name (concat (buffer-file-name) ".mail")))
  (kill-buffer (current-buffer))
  (rmail file-to-be-converted)
  (rmail-show-message 1)
  (while (not (rmail-output unix-style-file-name))
    (setq message-count (1+ message-count)))
  (rmail-quit))
EOF

for f in "$@" ; do
    echo ">>> Doing $f"
    emacs -batch $f -l /tmp/$$.el -kill
    echo ">>> Done"
done

rm -f /tmp/$$.el

exit 0



--
Skip (montanaro@crdgw1.ge.com)