LibreELEC sendmail

Published on Author Artem Butusov3 Comments

Why?

Some services have an option to send notifications by email, so we need to install a simple sendmail emulator which could forward messages to relay mail host.

For example, sendmail could be used to notify you about failed drive in RAID array via google mail.

Prerequisites

Installation

Login over SSH.

Install msmtp sendmail-like MTA:

opkg install msmtp
nano /opt/etc/msmtprc
account        gmail
host           smtp.gmail.com
port           587
from           {account}@gmail.com
user           {account}@gmail.com
auth           on
password       {secret}
domain         {host}
syslog         LOG_MAIL
tls            on
tls_trust_file /opt/etc/ssl/certs/ca-certificates.crt

account default : gmail

Test

You should have your regular email account, for example user@domain.com.

So you could test and send email to yourself from your LibreELEC:

echo test | sendmail user@domain.com

You should get an email after running code below.

Troubleshooting

If you did not get an email you could try to debug issue (add -v):

echo test | sendmail user@domain.com -v

For google mail here are some well known issues (make sure you are logged out from your personal account and logged in with your account designated to be used on LibreELEC):

Conclusion

Now you could use sendmail in various custom scripts to notify yourself over email.

3 Responses to LibreELEC sendmail

  1. Dear Artem, thank you for your great article! I use “LibreELEC (official) – Version: 8.0.2” but there is no sendmail installed by default. As well I cannot find sendmail, mail oder mailx in opkg package list. Maybe you can help me?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.