install exim4 on ubuntu server
Exim4 is a MTA or message transfer agent that runs on Linux systems. It’s freely available under GNU Linux. If you need to run mail from a server or send an email through an app, you’ll need to install Exim4. It can be installed in place of Sendmail or Postfix.
To install Exim4, open up your Terminal.
$ sudo apt install exim4
Configure Exim4.
$ sudo dpkg-reconfigure exim4-config
You’ll be asked several questions.
- Select “internet site” for type of mail configuration.
- Enter your domain name when asked about system mail name.
- Answer “127.0.0.1 ; ::1” when asked about incoming SMTP connections
- Answer the default answers for the next 3 questions.
- Answer “No” for Dial on demand.
- Answer “mbox” for delivery method for local mail.
- Answer “yes” to split configuration into small files.
If you need to reconfigure Exim4, just re-run the reconfigure command.
Don’t try to edit the /var/lib/exim4/config.autogenerated file.
Test if Exim4 is sending out emails.
$ mail -s "Your Subject" recepient@email.com
$ Hello there. This is the body of the message.
Type Ctrl-D to send the message.
Another way to test if Exim4 is working is to use WordPress. There’s a lost password link below the login page. Click on that. Supply a valid user email address. You should received an email directly from WordPress.