Setting Up E-mail
In my time on IRC (Internet Relay Chat), I found that the number one problem newbies have, after setting up PPP, is e-mail setup. Many people get their e-mail half-working and leave it at that, for fear of breaking it and not knowing how to fix it.
Mail handling is split up between several types of programs, instead of having everything handled by a single program (such as Eudora). Trust me, it is conceptually easy, and once you understand it, very quick and easy to set up. It also gives you a lot of flexibility.
I've included three sidebars which you may wish to read first; in particular, the Glossary for definitions of terms I will be using. Although there are alternative programs, I'll discuss the ones that I use.
First, you need to get an e-mail account set up by your ISP with mail delivered to their machine. Then, you need to know your ISP's domain and your password on the mail server (usually the same as the password you use when you start up PPP). For the examples in this article, we will call the ISP domain foo.com, the user name barney and the password f00bar.
To begin, you need the following programs or their alternatives:
pine [or elm]
either smail or sendmail
fetchpop [or fetchmail]
procmail
To find out if these programs are installed on your system, use the command which. If you type which program at the prompt, the pathname of that program, if it exists in your path, will be returned to the screen. For example, which might return the path /usr/bin/program, letting you know that program is in the /usr/bin/ directory. All of the basic distributions (Slackware, Debian and Red Hat) usually include all of these programs except fetchpop, so you should have no problem finding and installing them.
fetchpop sources can be downloaded from http://snakepit.wasteland.org/fetchpop.tgz (special thanks to TheAsp for hosting this prepatched version on his server so downloading it from Sunsite is unnecessary).
For this example, Pine is your MUA (mail user agent). You use it to read and write mail. Start up pine by typing pine at the prompt. When you see the opening screen, type s to call up the setup menu, then type c to go to the configuration screen. Now do the following steps.
Press enter and type in the personal name you wish to be associated with your actual e-mail address. Mixed case and spaces are allowed (e.g., Barney Fallon). In this case, other people will see your address as Barney Fallon (barney@foo.com).
Set smtp-server to localhost to ensure that mail gets handed to your local MTA (mail transport agent), where you don't have to worry about it. The MTA then sends it off the next time you connect. (See Glossary and Generic Mail Flow sidebars.)
Leave the other options set to the defaults for now.
To send mail from the prompt or in a script, type:
pine person@address.com < message.file
Use smail or sendmail as the MTA (mail transport agent). You use it to transport mail between machines. People have written 600 page books on setting up these programs. The horror stories are numerous. For this simple application, in most cases, you don't have to do any set up. If you use Slackware, Debian or Red Hat, the default setups for smail and sendmail work fine right out of the box.
Some installation scripts may ask you whether to use a smarthost, which means it will hand mail to your ISP's mail server so it can do the delivery. That decision is up to you. There's not much difference. If you plan to receive mail on your machine, you might want to look at the /etc/aliases file some day.
If your user name at your ISP is barney@foo.com and you wish this name to show up in the From: header, use sendmail to handle it by taking the following steps:
Create a user named barney on your system.
Edit the /etc/sendmail.cf file line that begins with the characters #DM by changing it to masquerade the Domain (DM—Domain Masquerade), e.g., DMfoo.com. If your machine has a hostname, but not a domain name (i.e., it is not networked except via your ISP), you may also need to edit the line #Dj$w.Foo.COM to remove the # and change Foo.COM to your ISP's domain name. Finally, edit the DS line to name the Domain Smart mail host, if you wish your ISP to actually forward all your mail.
Once the changes are made and saved, just execute SIGHUP<\!s>sendmail, so sendmail will re-read the sendmail.cf file.
Sometimes smail or sendmail will die. You will then get a pine error message saying the SMTP connection is not available . If this occurs, log in as root and type smail -bd or sendmail -bd. If this type of failure happens consistently, the first thing to check is your /etc/rc* directories to be sure that your SMTP server is started at boot up.
Trending Topics
| Make TV Awesome with Bluecop | May 16, 2012 |
| Hack and / - Password Cracking with GPUs, Part I: the Setup | May 15, 2012 |
| An Introduction to Application Development with Catalyst and Perl | May 14, 2012 |
| Cryptocurrency: Your Total Cost Is 01001010010 | May 09, 2012 |
| HTML5 for Audio Applications | May 07, 2012 |
| May 2012 Issue of Linux Journal: Programming | May 02, 2012 |
- Hack and / - Password Cracking with GPUs, Part I: the Setup
- An Introduction to Application Development with Catalyst and Perl
- Validate an E-Mail Address with PHP, the Right Way
- Make TV Awesome with Bluecop
- Monitoring Hard Disks with SMART
- Which one is the Best Free and Paid PDF editor for Mac
- Readers' Choice Awards 2011
- Examining Load Average
- Bash Regular Expressions
- Building an Ultra-Low-Power File Server with the Trim-Slice
- It's true that maintaining
2 hours 40 min ago - as powerful as anything the
8 hours 17 min ago - Excellent!
11 hours 39 min ago - You can mount ext2 and ext3
19 hours 26 min ago - Awsome Post
1 day 8 hours ago - Math Worksheets
1 day 11 hours ago - Healthy eating effective weight loss of p57
1 day 17 hours ago - Good work, looking for more!
1 day 17 hours ago - I’ve been reading a number of
1 day 19 hours ago - With freeware SKim, You can
1 day 19 hours ago






Comments
smarthost with authentication
Hi,
Thanks for the info on smail with all the various configuration options.
In my case, my ISP doesn't provide SMTP functionality and I have to route mail through my mail hosting provider's SMTP server. But in order to do this, it needs to authenticate, since I'm not connecting from the same IP range and it would generally be regarded as an open relay if they were to allow it.
Is there any way I can set up the smarthost to authenticate on the destination SMTP relay?
I don't want to send the mail directly over the net, because then the reverse lookup fails for the domain and the mail is often classified as spam.
Hope someone can assist
Jacques
Re: Linux Apprentice: Setting Up E-mail
Problem in Running Sendmail server ??what all issue i need to address....?
regards,
anurag
reachanurag@hotmail.com
Re: Linux Apprentice: Setting Up E-mail
Hi
This is Eric, can you be a bit more specfic at your
problem.
Do you have problem with the S80 send mail program ?
Fun Lover,
Eric