E-Mail and Linux

by Edward Cameron <ecame119@ecity.net> Copyright (c) 1996

Published in Issue #6 of the Linux Gazette

Rec'd a copy of Eudora Lite mail reader for Windoze that other day. (a promo; I get a lot junk mail and sometimes I get lucky) Being curious, I booted Windoze and installed the demo and played around with it for about an hour. Jotted down some notes. Composed and sent a few e-mail messages.

Fed up with the ugly Windoze screen, I rebooted Linux; with sanity restored I decided to see if I could get PINE to automatically retrieve mail from my ISP. Before I started working on this, I had to telnet to ecity.net and use Pine on their end in order to read and send email. (IDT uses Linux boxes as Internet servers!) This endeaver took two weeks of off and on again effort. Finally I found all the pieces of information and programs that would allow me to retrieve e-mail from a POP2/3 server and place it into a user directory on my machine. Along the way I've messed up my system to the point I can't use PERL now. (don't ask...!)

What you need: POPCLIENT and PINE. I'm gonna harp about the PINE program as I feel it's the finest mail reader I've seen for Linux. Nothing in the X window series of mail readers come close and what there is is not worth the effort to write about.

POPCLIENT can be found on any sunsite mirror in Mail/readers. (I have a quarterly CDROM and got the program from there) Pine is provided with nearly every Linux distribution.

There are a few 'popper' programs as well. Some I tried didn't compile and those that relied on Perl didn't work for me either. POPCLIENT works and is just what I was looking for.

Create a script file as follows:

#!/bin/sh

echo "
                         Checking for mail.....
"

popclient -3 -u your ISP username here your ISP here -o $HOME/mail/inbox

echo "
			done....
"

for example you might have:

popclient -3 -u jblow sunsite.unc.edu -o $HOME/mail/inbox

You will have to provide your password every time you run the above script, but that is safer than having a clear copy of it sitting around for some hacker to discover. If you have a permanent ppp connection, then you can create a cron job entry for the above and set a time to kick the script file off, say every day or hour or whatever to, automatically get your mail.

Setting up the services file for POP

I'm taking a step back here as I haven't mentioned two important steps. You must have an entry in the services file in order to connect to the SMTP server. The entry is detailed in the docs for popclient; I'm using a line like this:

 pop-3    110/tcp.
110 is the port number for a POP3 server. Use 109 if your STMP server is a POP 2.

Setting up Pine

Pine needs to be set up. Enter Pine and choose 'S' then 'C'. Move the cursor down to the in-box path entry. You need to tell Pine the complete path and file name for incomming mail messages. I use

/ecame119/mail/inbox.

Exit setup and Pine. CWD to the directory you entered above and touch the file inbox into being. "chmod 600 inbox" and you're all set.

That's it folks. Automatic retrieval of e-mail under Linux. And these programs are free. Edura is selling for around US$50.00.


Lingo Used:

I'd like to explain some of the terms I've sprinkled in the above.

SMTP: Simple Mail Transport Protocol.

POP: Post Office Protocol.

ISP: InterNet Service Provider.


There are a few more, but I'll save those for another time. To learn more, grab a book about electronic mail systems and be prepared to be confused with all the acronyms, like MTA or MDA and MHS!

Ciao for now.


Beam me back to the Linux Gazette, Scotty!