While working on a clients computer yesterday I needed to send some of the logs from the computer to myself so I could analyze later on my computer. At first I had to install the Exim MTA which I will write an article on in the near future but once installed mail was still not being received. You won’t actually receive an error from the CLI when attempting to use the mail command from the CLI however after investigating the Exim logs located in /var/log/exim/ the below error was observed and resolving the issue was completed using the steps below.

As you can see above the error states that mailing to remote domains is not supported. This can be resolved easily using the below steps.

Configure Exim MTA To Send Mail To Remote Domains On Ubuntu Linux:

Launch Mail Server Configuration: First you need to launch the Exim Mail Server Configuration in a Ubuntu terminal window using the syntax below.

bash

root@user-desktop:/home/user# sudo dpkg-reconfigure exim4-config

This will launch the below configuration window.

Modify Mail Server Type: From the Mail Server Configuration Window shown above use the arrow keys on your keyboard to move the red bar from “local delivery only; not on a network” to “Internet site; mail is sent and received directly using SMTP” as shown in the below example image.

Save Mail Server Settings: After selecting the top selection above click the tab key on your keyboard followed by enter to move on to the next screen. If you are using this as a temporary method to send email then keep all of the other settings the same but if you are planning to use the server for incoming and outgoing mail you should research Exim so you can configure it securely.

Verify Server Restart: After the last graphical modification screen you will be directed back to the terminal window prompt after viewing Exim restart so the new changes will be operational as shown below.

bash

root@user-desktop:/home/user# sudo dpkg-reconfigure exim4-config

* Stopping MTA for restart [ OK ]

* Restarting MTA [ OK ]

root@user-desktop:/home/user#

Verify Sending Email: Now attempt to send email again using whatever command you initially used that caused the error. After attempting to send the email look into the exim logs again to see if the email was successfully sent as shown below.