Smtp device

From ago control wiki
Revision as of 21:20, 9 January 2014 by JoakimL (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sending email

First, the SMTP device needs to be setup

Grab the python file from the GIT repository


Move it to the agocontrol bin directory.

sudo mv /opt/agocontrol/bin/

and set the permissions

sudo chmod 755 /opt/agocontrol/bin/

Create the configuration file.

sudo nano /etc/opt/agocontrol/config.d/smtp.conf

This is where we add all the info on the mail server. The below example is for a gmail or Google Apps address. If you use a different mail service you will need to look up the correct info for your service.


Change ownership for consistency sake.

sudo chown agocontrol:agocontrol /etc/opt/agocontrol/conf.d/smtp.conf

Test it out by running it from the commandline

sudo python /opt/agocontrol/bin/

The device should now be in the agocontrol admin under Configuration>Devices with a DeviceType of smtpgateway. Press the Action button next to the device to pull up the window that allows you to send an email. Add the message body, subject, and email address to send a test message. If the messsage does not go through, check the terminal to see if there are any error messages.

Assuming the test message goes through, you will want the device to run at startup, so you need to make it a service

Create a systemd service file

sudo nano /lib/systemd/system/agosmtp.service

Description=ago control SMTP Device



Make the file executable

sudo chmod +x /lib/systemd/system/agosmtp.service

Next, the service needs to be enabled and started

sudo systemctl enable agosmtp.service
sudo systemctl start agosmtp.service

Check back in the admin to see that the device is there. Add a name to the device like "Email" and it will now show up under "Actions" when you create Events.

Personal tools