Send-only Mail Server with Exim on Ubuntu 9.10 (Karmic)

Updated by Linode

Contribute on GitHub

View Project | View File | Edit File

This guide has been deprecated and is no longer being maintained.

Many Linux server applications need to send email; cron jobs use mail services to deliver reports on jobs that have run, web applications require mail support for user registration functions, and other applications may need to send alerts via SMTP. This guide will help you install and configure the lightweight Exim MTA (Mail Transfer Agent) on your Ubuntu 9.10 (Karmic) Linux VPS.

You’ll gain the ability to send mail from localhost through either a traditional “sendmail” style interface, or via port 25 locally. As this guide is not intended to provide a full send/receive mail solution, please refer to our other email guides for ways to implement such configurations.

We assume that you’ve already followed the steps outlined in our getting started guide. If you are new to Linux server administration, you may be interested in our introduction to Linux concepts guide, beginner’s guide and administration basics guide. Make sure you’re logged into your Linode as “root” via SSH before proceeding.

Install Required Packages

Make sure you have the “universe” repositories enabled. Your /etc/apt/sources.list file should resemble this:

/etc/apt/sources.list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
## main & restricted repositories
deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted

deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted

## universe repositories
deb http://us.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic universe
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe

deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe

Issue the following commands to update your package repositories, upgrade your system, and install Exim:

1
2
3
apt-get update
apt-get upgrade
apt-get install exim4-daemon-light mailutils

Configure Exim for Local Mail Service

Issue the following command to start Exim configuration:

1
dpkg-reconfigure exim4-config

You’ll be presented with a welcome screen, followed by a screen asking what type mail delivery you’d like to support. Choose the option for “internet site” and select “Ok” to continue.

Exim4 mail delivery type configuration on Ubuntu 9.10 (Karmic).

Enter your system’s FQDN (fully qualified domain name) in the “mail name” configuration screen.

Exim4 system mail name configuration on Ubuntu 9.10 (Karmic).

Enter “127.0.0.1” when asked which IP address to listen on for SMTP connections.

Exim4 listening IP address configuration on Ubuntu 9.10 (Karmic).

Make sure you list your FQDN, hostname, and localhost entries when you’re asked which destinations mail should be accepted for.

Exim4 mail destination configuration on Ubuntu 9.10 (Karmic).

Leave the relay domains and relay machines fields blank.

Exim4 relay domains configuration on Ubuntu 9.10 (Karmic).

Exim4 relay machines configuration on Ubuntu 9.10 (Karmic).

Select “No” when asked whether to keep DNS queries to a minimum.

Exim4 DNS queries configuration on Ubuntu 9.10 (Karmic).

You may select either “mbox” or “Maildir” when asked about the delivery method used for incoming mail. While many utilities use mbox format, Maildir format can make handling individual locally delivered mail messages easier, and is widely supporting by a range of applications.

Exim4 mail format configuration on Ubuntu 9.10 (Karmic).

Accept the default “non-split” option for your mail configuration file.

Exim4 mail configuration file specification on Ubuntu 9.10 (Karmic).

Enter at least one external email address (choose one that you check frequently) in addition to “root” when asked to specify postmaster mail recipients.

Exim4 postmaster recipient configuration on Ubuntu 9.10 (Karmic).

Test Your Mail Configuration

Issue the following command to send a test email, substituting an external email address for someone@somedomain.com.

1
echo "This is a test." | mail -s Testing someone@somedomain.com

Congratulations! You’ve configured Exim to send email from your Linux VPS.

More Information

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This guide is published under a CC BY-ND 4.0 license.