Install and configure Exim 4 mail server in Debian 8

One of friends ask me to configure mail in VPS to send messages via web form. He using Wordpress, and can't write custom PHP code to send mail directly via SMTP. Only one way is acceptable here: to use PHP mail() function. Okay, in this case we need a mail server on VPS. I like Exim.

To install Exim, run:

apt-get install exim4-base

After this, run configuration tool:

dpkg-reconfigure exim4-config

Make selections with using arrow keys, select “Ok” with tab key (note again, server will setup only for send mail):
  1. Select: ‘internet site; mail is sent and received directly using SMTP’
  2. Enter FQDN: yourdomain.tld
  3. SMTP Listener: enter 127.0.0.1; ::1
  4. Mail destinations - yourdomain.tld, local hostname, localhost.localdomain, localhost
  5. Relay Options: Leave blank
  6. Follow up Screen to Relay Options: Leave blank
  7. DNS Queries: Keep DNS queries to a minimum? select “No”
  8. Delivery method: Select “Maildir format in home directory”
  9. Choose default unsplit config file by entering “No”
Finally (it is very important - otherwise all mail will marked as spam!) you should set default user email by editing /etc/email-address file. Simple add one line with "user: email" format, such as:

root: yourname@yourdomain.tld

Comments

Popular posts from this blog

Installing and using a free GeoIP database

Create custom Spinner on ActionBar