UNIX Programming, Certification, System Administration Reference Books
Fetch your entire Mail file via ftp and read it locally

I have a remote Unix account in another country and reading a lot of mail over telnet with 'mail', 'mailx' etc is excruciatingly slow. They do NOT have POP3 or IMAP. How can I speed things up?
Piece of cake! You can fetch your entire mail file via ftp and read it locally using the -f switch of many email readers or loading it as a folder in kmail or other menu-driven mail readers. This is a typical session:
local% telnet remote.computer.etc
...
remote% printenv MAIL
 /var/mail/user33                                         (to see mail file location)
remote% cd /var/mail

remote% ftp local.computer                                (open ftp to local computer)
...                                                       (give local username, pass)
ftp> bin     
200 Type set to I.                                        (mail may contain binary chars)
ftp> put user33
200 PORT command successful.
150 Opening BINARY mode data connection for ...
226 Transfer complete.
local: user33 remote: user33
1412735 bytes sent in 1.1e+02 seconds (12.80 Kbytes/s)
bye                                                       (back to remote computer)

remote% rm /var/mail/user33                               (remove your remote mail all at once)
remote% mail
No mail.                                                  (logical, isn't it?)
remote% logout
(Don't worry about completely removing your mail file; you will get further email;
if you don't believe that, send yourself an email at user33@remote. Of course, you can
also choose not to remove it and let it grow slowly...)


local% mail -f user33
And when you're done reading and sorting your email, you might consider using a .forward file, with your regular email address in it (don't forget the newline at the end, just in case, see one of the C-shell questions in this document).

Return to : Unix System Administration Hints and Tips