Install the lightweight packages msmtp and msmtp-mta (which will map to sendmail) to allow for sending email.

Configure the system-wide default configuration

sudo cp /usr/share/doc/msmtp/msmtprc-system.example /etc/msmtprc

Create a default configuration

/etc/msmtprc

# Example for a system wide configuration file

# Set default values for all following accounts.
defaults
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        /var/log/msmtp.log

# A system wide configuration file is optional.
# If it exists, it usually defines a default account.
# This allows msmtp to be used like /usr/sbin/sendmail.
account default

# The SMTP smarthost
host smtp.zoho.com

# Use TLS on port 465
port 465
tls on
tls_starttls off

# Construct envelope-from addresses of the form "user@oursite.example"
from <USER>@<DOMAIN>
user <LOGIN_EMAIL>
password <PASSWORD>

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL

Create the log file

sudo touch /var/log/msmtp.log
sudo chmod 600 /var/log/msmtp.log

Create a test email

/tmp/test.email

To: <YOUR_EMAIL>
From: <YOUR_EMAIL>
Subject: A test

Hello there.

Send a test email

sendmail -vt < /tmp/test.email

 

Tags