What it is for
Your server can send you emails from your rules: warning you that an alarm went off, that a door was left open, that a temperature is abnormal, or sending a picture taken by a camera.
For that, you must tell it which sending service to use: this is called an SMTP server. In practice, the one from your Internet provider or your mail service.
These settings are not available from the touchscreen: connect over SSH (see SSH access).
What you need
Before you start, gather the information provided by your mail service:
- the address of the sending server, such as
smtp.example.com; - the port to use, often 587 or 465;
- your user name and password, if the service requires authentication;
- whether the connection must be encrypted (TLS), which is the case almost everywhere today.
This information is in your provider’s help pages, often under a heading such as “configure a mail client”.
Configuring
The settings are defined with the calaos_config tool:
Here is what each setting does:
| Setting | Purpose |
|---|---|
smtp_server | Address of the sending server, prefixed with smtp:// |
smtp_port | Port of the sending server |
smtp_auth | true if the server requires a user name and a password |
smtp_tls | true for an encrypted connection |
smtp_username | Your user name |
smtp_password | Your password |
To check what has been saved:
Many mail services now refuse your usual password for this kind of use and require an application password, to be generated from your account. If sending fails while your credentials are correct, this is very likely the cause.
Testing
The calaos_mail tool sends a test message. First prepare a file containing the message text, then send it:
If the message arrives, the configuration is correct.
If it fails, run the command again adding --verbose: the details of the exchange with the sending server are displayed, which usually shows which setting is at fault.
Remember to check your junk mail folder: messages sent by a home server often land there the first time.
Attaching files
The --attach option attaches a file, and can be repeated to attach several:
This is the mechanism that lets you receive a camera picture by email.
Using email in your rules
Once sending is configured, you can trigger emails from your automation rules. Creating rules is described in Rules, in the Calaos Installer chapter.
Being warned automatically
Independently of your rules, the server can alert you on its own about two events concerning your wireless devices:
The _mail_ settings send an email — and therefore assume the configuration above — while the _push_ settings send a notification to your phone. You can enable either, or both.
The low-battery alert is the most useful one: it warns you before a sensor stops working, rather than letting you find out on the day you need it.
See Zigbee for the devices concerned.