Send email from OpenWrt

Install

Before building Carambola image, install ssmtp package.

./scripts/feeds update packages mail
./scripts/feeds update mail
./scripts/feeds install -a -p mail
./scripts/feeds install -a -p ssmtp
./scripts/feeds install -a -p mailutils

or install these packages directly on Carambola

sudo apt-get install ssmtp mailutils

Configure

edit file sudo nano /etc/ssmtp/ssmtp.conf

root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YES

Test

ssmtp recipient@gmail.com < text.txt
mail -s "test" recipient@gmail.com < text.txt