🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #1933

Re: How to convert from Babyl (RMAIL) format back to Mail? HELP!

#1933
From: hrue
Date: Sat, 12 Dec 1992 10:39
54 lines
2131 bytes
something i picked up somewhere, sometime.
-hr

----------------------------------------------------------------------
#!/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

if [ $# -eq 0 ]; then
    cat $0
    exit 
fi


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
----------------------------------------------------------------------
--
       |^^^^^^|        ___________________________________
       |      |       /                                    \
       |      |      | Haavard Rue                          |
       | (o)(o)      | The Norwegian Instiute of Technology |
      @      _)      | Department of Mathemathical Sciences |
       | ,___|     ,,| N-7034 Trondheim NTH, Norway         |
       |   /   ..''  | fax:+47-7-593524, hrue@imf.unit.no   |
      /____\          \____________________________________/
Technical Details
Message-ID: <HRUE.92Dec12103941@nazgul.sima.sintef.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ugle.unit.no!hrue
References: <JKH.92Dec12030020@whisker.lotus.ie>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.help
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!ugle.unit.no!hrue
From: hrue@sima.sintef.no (hrue)
Subject: Re: How to convert from Babyl (RMAIL) format back to Mail?  HELP!
In-Reply-To: jkh@whisker.lotus.ie's message of Sat, 12 Dec 1992 03:00:20 GMT
Message-ID: <HRUE.92Dec12103941@nazgul.sima.sintef.no>
Sender: news@ugle.unit.no (NetNews Administrator)
Organization: SINTEF Industrial Mathematics, Trondheim, Norway
References: <JKH.92Dec12030020@whisker.lotus.ie>
Distribution: gnu
Date: 12 Dec 92 10:39:41
Lines: 54