Install Exim and mailutils:
# apt-get -y install exim4-daemon-light mailutils
# dpkg-reconfigure exim4-config
Select the following options:
- General type of mail configuration: internet site; mail is sent and received directly using SMTP
- System mail name: playground
- IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 ; ::1
- Other destinations for which mail is accepted: playground; localhost
- The "Domains to relay mail for:" option is empty.
- The "Machines to relay mail for:" option is empty.
- Keep number of DNS-queries minimal (Dial-on-Demand)? <No>
- Delivery method for local mail: Maildir format in home directory
- Split configuration into small files? <No>
# echo "Testing Exim" | mail -s Test <type one of your emails here>
If Exim does not deliver your messages, check that your provider does not block outgoing connections to 25 (SMTP) port by executing "telnet somedomain 25". Install the telnet package if it is not installed by executing "apt-get -y install telnet".
On some computers Exim displays Cannot open main log file "/var/log/exim4/mainlog": Permission denied error message when testing email sending. It can be solved by creating /var/log/exim4 folder as follows:
# mkdir -p /var/log/exim4 # chmod 740 /var/log/exim4 # chown Debian-exim:adm /var/log/exim4 # touch /var/log/exim4/ # chown Debian-exim:adm /var/log/exim4/mainlog