Using emacs rmail to read from a different source
Using emacs rmail to read from a different source
When you read your email using
emacs rmail,
your mail file is called
RMAIL
and when you get new mail (by typing
"g"),
the mail is input from
/var/mail/username
(where
"username"
is your login name).
It is possible to specify the input source for an rmail format file,
useful in the case where you might be routing incoming mail with
procmail.
(See
"Using
procmail to filter spam".)
Suppose, as in the page referenced above, you are routing probable
incoming spam into a file called
spam in your
mail
subdirectory.
Here is how you would create an
RMAIL
format file,
SPAM,
using that as input so that you could read it just like you do your
regular email.
-
Type
"i"
when in
emacs rmail mode (eg, when you're reading your regular
email).
emacs
will ask you for an
RMAIL
format file to read.
-
Type the name of the file you wish to create (eg,
"SPAM")
followed by a carriage return.
-
Since the file doesn't exist already,
emacs
will create it for you, showing you something like this:
BABYL OPTIONS: -*- rmail -*-
Version: 5
Labels:
Note: This is the header of an rmail file.
Note: If you are seeing it in rmail,
Note: it means the file has no messages in it.
-
We need to add one line to the headers to define the input source.
Type
"w"
to enter write mode on the file.
(Recall that unlike in most
emacs
buffers, what you type in
RMAIL
mode is usually interpreted as commands.)
-
Add the line
Mail: /fac/u/username/mail/spam
(where
"/fac/u/username/mail/spam"
is the full path to the file from which you want to get new messages)
at the end of the buffer.
-
Save the file
("^X ^S").
-
Kill the buffer
("^X k"
followed by a carriage return).
(This is done because the next time you read this file,
emacs
will learn where to get its input from.)
This will leave you back in your
RMAIL
buffer.
-
Read the new file back in by typing
"i"
followed by the filename
("SPAM")
and a carriage return.
(You will always use this method to get to this file.)
-
Now when you type
"g"
messages will be moved from the Unix mail format file
SPAM,
into the
RMAIL
format file,
SPAM.
All your normal mail reading commands will work at this point.
This page last updated April 2, 2002.