Linux Annoyances for Geeks: Getting the Most Flexible System in the World Just the Way You Want It
9.4. I Can't Send out Email Because the ISP's Server Is Down
Despite the reliability of Linux, everyone experiences downtime, even your ISP. Power failures can outlast available battery backups. Surges and kernel upgrades can force reboots. And many ISPs rely on Microsoft Windows. Your network may still be working, but your ISP's email servers might go down. If you work from an Internet café, you may not be able to send email through your ISP's mail server. Many of those servers aren't accessible from outside their networks. While you can use a web-based email interface, that interface can't download directly to an email manager such as Novell Evolution or KMail. In this situation, there are two basic options:
This annoyance explores each of those solutions. 9.4.1. Route Email Through a Different ISP
If you don't want to configure an email server on your network, the simplest option is to route your email through a different ISP, such as one associated with your personal web site. In fact, this is what I do because large-scale MTA programs such as sendmail and Postfix make little sense for my home network. If your alternate ISP supports outgoing email, they'll have an email server with a URL such as mail.otherisp.net, which you can use in the account information for your email manager. You may have a backup ISP for emails and not even realize it. If you run your own web site, the ISP with the web server usually provides free email addresses. They'll have incoming and outgoing mail servers for those accounts. While regulations vary by ISP, yours may allow you to use their outgoing email servers for any email account. If you have an email address on a different domain from your ISP, with POP3/IMAP4 support, you may have another option. POP3/IMAP4 support requires incoming and outgoing email servers. Once you find the third-party domain URL for the outgoing email server, you can substitute that account information in your email manager. As I've configured my primary emails through my personal domain name, I can send and receive emails even when my primary ISP goes down. All I need to do is connect at a nearby Internet cafe, or use my neighbor's wireless network (with permission). It doesn't matter what domain is associated with my email address. 9.4.2. Create Your Own Email Server
If your ISP's outgoing email server goes down, you have another option: you can set up your own email server. Because the default settings associated with the sendmail, Exim, and Postfix services are acceptable for small-scale uses, the process is simple. Despite their popularity, I do not cover any of these services in detail. One excellent book on sendmail is sendmail by Bryan Costales and Eric Allman (O'Reilly). (It's over 1,200 pages long.) For more information on Exim, see http://www.exim.org, and for more information on Postfix, see http://www.postfix.org.
For the purpose of this annoyance, I'll show you how to configure sendmail on Red Hat Enterprise Linux 4, Postfix on SUSE 9.3, and Exim on Debian Sarge. Naturally, the steps you take to configure one server on one distribution generally apply to the other distributions as well, with small changes such as directory locations.
Once you configure an outgoing email server, you'll want to make sure that the email clients on your network point to that server. That process varies by client and is an elementary part of the configuration process for a client such as Evolution, Thunderbird, or Kmail. 9.4.2.1. Configuring outgoing sendmail on Red Hat
When you configure sendmail from a Red Hat or Fedora package, you're configuring the open source version of sendmail, as opposed to the commercial version of Sendmail. When you install the sendmail RPM package, you'll find a series of configuration files in the /etc/mail directory. Some are macro files with an .mc extension, which are generally all you need to edit. Once editing is complete, you can then process the .mc macro files into the actual sendmail configuration files. When editing a sendmail macro file, you need to be aware of two conventions:
In the default versions of the sendmail configuration files from the Red Hat/Fedora package, you need to change one line in sendmail.mc. The following directive in the default version of the file limits access to the local computer: DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
Naturally, this won't help you if you're configuring sendmail for other computers on your network. The easiest solution is to disable this directive by adding a dnl in front. Now you can enable sendmail with the following commands, and then point the email clients such as Evolution, Thunderbird, pine, and KMail to the sendmail server host: chkconfig sendmail on service sendmail restart
9.4.2.2. Configuring outgoing Postfix on SUSE
The default mail server on SUSE Linux is Postfix, which you can configure either through YaST or directly through the /etc/postfix/main.cf configuration file. The key directives are:
You can also configure Postfix using YaST. If you do, inspect the results in the /etc/postfix/main.cf file. Despite the quality of YaST, no GUI tool is infallible. If it doesn't include the directives as shown here, you'll have problems and will want to try again. 9.4.2.3. Configuring outgoing Exim on Debian
When you install many Debian packages with the apt-get command, you'll get an opportunity to configure it right away. For example, to install the packages required for the Exim email server, you can run the following command: apt-get install exim4-config This installs the required packages, including exim4, exim4-config, exim4-base, exim4-daemon-light, mailx, and qpopper. When you run the command shown above, you're prompted to configure the mail server. Once the process starts, follow these steps:
|