Ruan Bekker's Blog

From a Curious mind to Posts on Github

Sending Mail With SSMTP on Alpine Linux

Quick Post on how to use ssmtp on Alpine Linux to Send Mail:

Update and Install SSMTP

1
2
$ apk update
$ apk add ssmtp

Configure SSMTP

1
2
3
4
5
6
$ cat > /etc/ssmtp/ssmtp.conf << EOF
root=postmaster
mailhub=mail.domain.com:25
hostname=`hostname`
FromLineOverride=YES
EOF

Create the Mail Content

1
2
3
4
5
6
7
$ cat > mail.txt << EOF
To: recipient@domain.com
From: sender@domain.com
Subject: Mail with SSMTP

Hello, this is a test mail.
EOF

Testing Mail Delivery

1
$ ssmtp recipient@domain.com < file.txt

Related: