[comp.emacs] RMAIL Question

mr@ogre.cica.indiana.edu (Michael Regoli) (02/15/91)

][

I've goofed.  I was playing around with rmail on our emacs version
(18.56.10) and little did I know it was going to trash my mbox file
and convert it to an rmail file.

So, now I don't LIKE rmail (:-), and I want my mbox back!  Is there a
way to automatically convert all 90 messages back to Mail format?  I
know when you're on a message and type C-o, you can save that message
to a Unix-mail style file...

Thanks for the help!


--
--
michael regoli
mr@ogre.cica.indiana.edu
regoli@iubacs.BITNET
..rutgers!iuvax!ogre!mr

melling@cs.psu.edu (Michael D Mellinger) (02/15/91)

Create a macro. C-( C-o RET n C-).  Then repeat it 89 times by typing
M-89 C-x e.  Do this on a copy of your RMAIL file.  I think the macro
is right, but I am guessing.  I use VM(visual mailer) now.

-Mike

warsaw@nlm.nih.gov (Barry A. Warsaw) (02/15/91)

	Michael> Is there a way to automatically convert all 90 messages
	Michael> back to Mail format?

You can anon-ftp rmailtovm.el from durer.cme.nist.gov [129.6.32.4]. It
converts a Babyl format file to Unix mail format.  Look under pub/gnu.

-Barry

mr@ogre.cica.indiana.edu (Michael Regoli) (02/15/91)

In <_.9G5m6n@cs.psu.edu> melling@cs.psu.edu (Michael D Mellinger) writes:


>Create a macro. C-( C-o RET n C-).  Then repeat it 89 times by typing
>M-89 C-x e.  Do this on a copy of your RMAIL file.  I think the macro
>is right, but I am guessing.  I use VM(visual mailer) now.

>-Mike

Thanks to all the replies.  The best solution (below) cleaned up the
file perfectly.  My thanks to all!

--CUT--

#!/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"
#    mv -f $f.mail $f
#    rm -f $f~
done

rm -f /tmp/$$.el

exit 0

--CUT--

--
--
michael regoli
mr@ogre.cica.indiana.edu
regoli@iubacs.BITNET
..rutgers!iuvax!ogre!mr