Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!quanta.eng.ohio-state.edu!icarus!kaul From: kaul@icarus.eng.ohio-state.edu (Rich Kaul) Newsgroups: comp.emacs Subject: Re: RMAIL to mail format? Message-ID: Date: 8 Jun 90 14:59:08 GMT References: <7193.266eb0d6@eva.slu.se> Sender: news@quanta.eng.ohio-state.edu Organization: The Ohio State University Dept of Electrical Engineering Lines: 51 In-reply-to: robert@eva.slu.se's message of 7 Jun 90 18:53:57 GMT In article <7193.266eb0d6@eva.slu.se> robert@eva.slu.se writes: I like to test the ELM mail system... How do I convert RMAIL with 150 messages to ordinary mail format? I use the following little shell script. It has the advantage that you can use your emacs for other things while you convert whole directories... -rich #!/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 -=- Rich Kaul | "Every man is given the key to the door kaul@icarus.eng.ohio-state.edu | of heaven; unfortunately, the same key or ...!osu-cis!kaul | opens the door to hell."