Email notifications plugin

Want to share your OpenWrt / Gargoyle knowledge? Implemented a new feature? Let us know here.

Moderator: Moderators

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Email notifications plugin

Post by n0pin »

Today I finally finished e-mail notificaton plugin for Gargoyle, which was also requested by a quite a few people on forums. Plugin uses SMTP protocol to send mail, but it currently doesn't support encryption, so you have to use servers with no authentication or plain authentication.

Screenshot of settings in Gargoyle web interface:
Image

Most ISP allows their customers to send email through their servers without encryption. If your ISP doesn't offer SMTP server without authentication, you can use one Google offers (aspmx.l.google.com:25, more info: https://support.google.com/a/answer/176600?hl=en). Most routers come with only 4MB flash, which is the main reason encryption currently isn't supported. Since I managed to get Gargoyle working in VirtualBox, you can expect encryption support in future (or if maybe someone else implements it).

Plugin also features time settings, where you can set in which intervals you want to receive notifications. I used cron configuration code from BashfulBladder, which made plugin much nicer and user friendly.

There is also test email button, which allows you to test settings before saving them. Pressing this button sends test email using current settings, that you can see on web interface. If email arrives, settings are okay. Test mail button also logs to system log, so you can look there for any errors.

What notifications plugin emails:

- Recently visited sites (if enabled)
- Recent web searches (if enabled)
- System logs (logread)
- Current DHCP Leases
- ARP Records

Here is a small example of how email looks like:
Image

Plugin uses msmtp-nossl to send emails, since full msmtp package is too big for routers with 4MB flash.

HOW TO INSTALL:

Remember, plugin is still new, so it probably has probably some bugs (maybe a lot).

To install plugin run this code:

Code: Select all

wget -q -O - "http://fpaste.org/135288/41132367/raw/" | tr -d '\r' > /tmp/setup.sh && chmod +x /tmp/setup.sh && sh /tmp/setup.sh
Currently this is the only way to install plugin, since I want some people to test it first. Report any bugs.

Hope you will find this plugin useful.
Last edited by n0pin on Sun Sep 21, 2014 2:21 pm, edited 5 times in total.

ispyisail
Moderator
Posts: 5185
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Email notifications plugin

Post by ispyisail »

Thanks

dieselz
Posts: 41
Joined: Fri Jun 07, 2013 3:39 am
Location: Dubai, UAE
Contact:

Re: Email notifications plugin

Post by dieselz »

THANK YOU!!!
Linksys WRT1900ACS V2 1.12.x gargoyle-iSpy

ceezar
Posts: 2
Joined: Thu Nov 14, 2013 6:31 am

Re: Email notifications plugin

Post by ceezar »

Great work! I haven't found any bugs so far (TL-WDR3600).

Out of interest is there a developer guide for writing plugins? Looks like fun...

richi001
Posts: 3
Joined: Sat Aug 23, 2014 2:24 am

Re: Email notifications plugin

Post by richi001 »

Hi All,

I have a small issue with this plug in, I currently run 1.6.1, and each time I try to save the settings, it resets and empties the fields each time I click out.

When I send a test email, it works fine.


I assume its because of the version of firmware I am running?

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: Email notifications plugin

Post by n0pin »

Which version are you running? Try to run the install script again, I updated it last week :D .

richi001
Posts: 3
Joined: Sat Aug 23, 2014 2:24 am

Re: Email notifications plugin

Post by richi001 »

n0pin wrote:Which version are you running? Try to run the install script again, I updated it last week :D .


Hey,

Thanks for the reply.
I am using Netgear WNDR3700 v1.
Gargoyle version 1.6.2 (updated last week)

Will it make any difference that I am using Webshell plugin?

Sorry I am a newbie with Gargoyle.

SARS
Posts: 4
Joined: Wed Oct 16, 2013 12:08 pm

Re: Email notifications plugin

Post by SARS »

richi001 wrote:Hi All,

I have a small issue with this plug in, I currently run 1.6.1, and each time I try to save the settings, it resets and empties the fields each time I click out.

When I send a test email, it works fine.


I assume its because of the version of firmware I am running?
I'm using the newest Gargoyle (ver 1.6.2) and have the same issue like above description :?

User avatar
chigo58
Posts: 42
Joined: Wed Dec 22, 2010 5:09 am

Re: Email notifications plugin

Post by chigo58 »

n0pin: Thank you for this useful plugin :mrgreen:
x2 Archer C5,C7 - Stock | x1 TL-WA730RE v1 - Openwrt 14.07 | x2 TL-WR1043ND v1.7 - Gargoyle v1.6.X http://goo.gl/VMbxcH | x2 WRT54GL v1.1 Tomato v1.28.7821 MIPSR1-Toastman-ND, 14929_vpn | x1 WHR-HP-G54 - Gargoyle 1.4.7

ispyisail
Moderator
Posts: 5185
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Email notifications plugin

Post by ispyisail »

I haven't used this plug in yet but it has just dawned on me how cool this can be

Any chance of encryption for more powerful routers?

We now live in an Edward Snowden world :(

Post Reply