Check which MTA is being used
First, determine which mail transfer agent (MTA) you are using. Currently, Eclipse Linux servers are configured using the postfix MTA. If you are running an older system, you may be using the sendmail MTA. To determine which MTA you are running, use the following command:
ls -l /etc/alternatives/mta
If the command returns a link to “/usr/sbin/sendmail.postfix”, your system is configure to use postfix. If it returns a link to “/usr/sbin/sendmail.sendmail”, your system is configured to use sendmail.
Check the SMTP relay server
Next, verify that your system is pointing to the correct SMTP relay server.
For systems using postfix, the command is:
grep ^relayhost /etc/postfix/main.cf
For systems using sendmail, the command is:
grep ^DS /etc/mail/sendmail.cf
Check the mail logs
Once you have confirmed that the MTA is relaying to the correct SMTP server, the next step is to check the email service logs. To view the last 10 log messages and monitor the file, run:
tail -f /var/log/maillog
Send a test message from the command line
To send a test message from the Linux command line, use the following command (replace email@domain.com with your email address):
echo test | mail email@domain.com
If you don’t receive your email, check the logs (see above) for error messages.