Set the hostname
Before you begin installing and inserting the components described in this Guide, please make sure you 've followed our instructions for setting your hostname. issue the following commands to make sure it is set properly:
Hostname
Hostname-F
Run the following commands to update your package repositories, upgrade your system, and install Exim:
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:
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.
Enter your system's FQDN (Fully Qualified Domain Name) in the "Mail Name" configuration screen.
Enter "127.0.0.1" when asked which IP address to listen on for SMTP connections.
Make sure you list your FQDN, hostname, and localhost entries when you're asked which destinations mail shoshould be accepted.
Leave the relay domains and relay machines fields blank.
Select "no" when asked whether to keep DNS queries to a minimum.
You may select either "mbox" or "maildir" when asked about the delivery method used for incoming mail. while using utilities use mbox format, maildir format can make handling individual locally delivered mail messages easier, and is widely supporting by a range of applications.
Accept the default "non-split" option for your mail configuration file. enter at least one external email address (choose one that you check frequently) in addition to "root" when asked to specify Postmaster mail recipients.
Test your mail configuration
Issue the following command to send a test email, substituting an external email addressSomeone@somedomain.com.
Echo "this is a test." | mail-s testing someone@somedomain.com
Congratulations! You 've configured Exim to send email from your Linux VPs.