Difference between revisions of "CalMail conversion and Unix mail"
(Switched from gnumail to nail; updated comments about trying out the CalMail server) |
m (Fixed minor typo) |
||
Line 51: | Line 51: | ||
(If you currently do not have such a file, create it with just that one line.) | (If you currently do not have such a file, create it with just that one line.) | ||
− | Then, you should create a file '''.nailrc'' in your home directory, | + | Then, you should create a file '''.nailrc''' in your home directory, |
which should look something like this: | which should look something like this: | ||
unset hold | unset hold |
Revision as of 22:31, 24 March 2009
This page describes how to use CalMail using tools similar to the Unix mail program (mailx, generally accessed by typing "mail").
After conversion to CalMail on April 6, incoming mail will no longer be stored on our system. Instead, it will be stored on the CalMail server, and will need to be accessed by a mail reader capable of using the IMAP protocol. The Unix mail program does not have this capability, so if you are using this program then you will need to make some changes in how you access your email.
This page describes two ways in which you will be able to handle your email using the familiar mail program or workalikes. (Of course, our recommendation is to switch to a different mail client, or to use CalMail's web interface. In that case you should see the main CalMail conversion wiki page.)
The recommended way of accessing mail consists of using a newer version of the Unix mail program, called heirloom mailx. This name is rather awkward, so we'll call it by its previous name, nail. It functions very similarly to the original mail program, but it is capable of using IMAP (and has many other enhancements). Because of this, nail is able to treat the CalMail server as if it were your inbox.
An alternative way of accessing mail involves a program called fetchmail, which copies your mail from the CalMail server into a file in your home directory. You then access the mail using the standard Unix mail program (or any other mail program, for that matter).
It is also possible to use both methods in combination with each other.
If you have set up your CalMail password already, then you can experiment with these methods (although you won't be able to process incoming mail until after the transition). You can also try them with other IMAP or POP accounts that you may have. (Although the Math Department has its own IMAP server, it is not recommended that you use this particular server to try things out. It has a bad habit of corrupting users' mailboxes, especially those with large amounts of incoming mail.) (Note also that nail is currently installed only on Solaris machines, such as the login servers blue1 and blue3.)
Using nail
The "heirloom mailx" version of the Unix mail program (called nail) is capable of directly accessing your inbox on the CalMail server.
Initial setup
To set up nail for accessing your CalMail account, you need to add the following line to the file .mailrc in your home directory:
set NAIL_EXTRA_RC=~/.nailrc
(If you currently do not have such a file, create it with just that one line.)
Then, you should create a file .nailrc in your home directory, which should look something like this:
unset hold unset emptybox set crt bsdflags account calmail { set folder=imaps://username@math.berkeley.edu@calmail.berkeley.edu } account calmail
In the above, you should replace username with your Unix login name. When you start up nail, it will then ask for your CalMail password.
You can avoid having to type your password every time by adding a line
set password-username@math.berkeley.edu@calmail.berkeley.edu="password"
to your .nailrc file. Again, username should be replaced by your Unix login name and password by your CalMail password. This line can be anywhere in the file outside of the set of braces.
If you place your CalMail password in the .nailrc file, then you should ensure that this file is not publicly readable, by issuing the command
chmod 600 ~/.nailrc
More information on nail is available on its extensive man page, which can be obtained by typing:
man nail
Using fetchmail
Using the fetchmail program, you can copy your incoming mail from the CalMail server to a file within your home directory, and then read mail using your favorite mail client.
Initial setup
In the following descriptions, you should change username and password to your Math login name and your CalMail password, respectively. It is highly recommended that you use a different password for CalMail access than for logging in to the math system, since the CalMail password will likely be stored in a file in your home directory, and is vulnerable to being compromised.
After the transition, the directory /var/mail, which is used for storing users' inboxes, will no longer be available for that purpose. Therefore, you should choose a file within your home directory to use to hold incoming mail. The following examples use a file name "inbox", but you are free to change it to something else if you like.
In order for Unix mail to be able to find your new incoming mail box, you need to set an environment variable. To do this, add a line of the following form to the file .cshrc in your home directory:
setenv MAIL ~/inbox
Next, you need to provide fetchmail with the information it needs to be able to access your CalMail account. This is done by creating a file named .fetchmailrc in your home directory. This file should contain the following:
poll calmail.berkeley.edu username username@math.berkeley.edu pass password mda "procmail -f %F ORGMAIL=inbox DEFAULT=inbox"
Since this file contains your CalMail password, it should not be publicly readable. To make sure of this, use the following command:
chmod 600 ~/.fetchmailrc
In your .fetchmailrc file, the mda line is very important. Without it, your fetched mail will end up being sent back to CalMail, and will likely end up being lost, since CalMail will recognize it as already having been through their mail server once. Be sure it is exactly as given above (except for optionally changing your inbox).