Table of Contents
Install send only exim4 mail server
Install Exim and its dependencies
apt-get -y install exim4
Configure Exim for your environment
dpkg-reconfigure exim4-config
Mail Server Configuration Type
1. The first configuration window you encounter will ask you to select the “mail server configuration type that best meets your needs.” If not already highlighted, use the arrow keys on your keyboard to select:
internet site;mail is sent and received directly using SMTP
2. The next configuration window will ask that you enter your system's fully qualified domain name (FQDN) in the mail name configuration screen. Type the command below, substituting hostname, yourdomain & tld with your own values:
hostname.yourdomain.tld
3. The ensuing configuration window will ask you to decide on which interfaces you would like Exim to “listen.” Enter:
127.0.0.1; ::1
for IVP4 and IPV6.
4. The configuration prompt that follows will ask that you enter all of the destinations for which Exim should accept mail. List your:
FQDN; local hostname; localhost.localdomain; localhost
5. In the next screen, leave the “relay mail” field blank.
6. The subsequent screen is a follow-up to the relay-mail-server option. Leave this window blank.
7. Select No when asked whether to keep DNS queries to a minimum.
8. In the window that follows, choose whichever mail delivery method you'd like for incoming mail; although the Maildir format can make handling individual, locally-delivered mail messages easier
9. In the ensuing prompt, choose the (default) unsplit configuration file by selecting “No”
10. In the last configuration window, you'll be asked to specify postmaster mail recipients. Enter the command below, substituting “you”, “yourdomain” & “tld” with your own values:
root you@yourdomain.tld
Note: Make sure that, in addition to root, you enter at least one external email address (choose one that you check frequently).
11. Check if the hostname is setup correctly. /etc/hosts should look like
... <public_ip> hostname.yourdomain.tld hostname # add this line 127.0.0.1 localhost ...
Test Your Mail Configuration
Send a test email to make sure everything is configured correctly by issuing the following command (substituting someone@somedomain.tld for a valid, external email address):
echo "This is a test." | mail -s Testing someone@somedomain.tld
Note: You may need check the recipient's SPAM folder, in the event that the SPF record is not configured correctly.
Tested on
- Debian 7 Wheezy