Livebox Mail indicator

Did it make sense? No. Was it useful? Yes.


In 2009, i got hold of an old Livebox Modem (used by Wannadoo, Orange and other FranceTelecom brands like Belgian Mobistar). Because I did not have a connection with them, i started hacking around with the device and found a way to get into a terminal of the very limited linux version it ran.

After a while of playing around with LED-lights i came across the idea to have the leds indicate something else then just the normal internet connection status.

No SSL

My account was a Gmail account which back then had an ATOM-feed available for incoming mail. Becasue the livebox had no proper SSL functionality, and my knowledge was way too limited to build it into the application I wanted to make, we made a seperate application which ran on my server. This application checked the unread emails and simply put it on a webserver in a text file, which the livebox then accessed.

So, basically the server does all the work?

Jep. Actually the part that ran on the livebox was just a simple shell script which had if's for 0, 1, 2, 3, 4, 5 and everything above. With 0 mails it was completely dark, with 1 to 5 mails the front LED and the amount of LED's corrosponding with the amount of new mails were lid, and with over 5 unread e-mails, the 5th led started to blink.

How did you do all this?

Actually I don't remember how i managed to get SSH access. It must've been some tutorial on the internet. Unfortunately I don't have most stuff related to it anymore, however, i still have a fancy photo (as seen in the header) and thie server side source code:

Ze code:

/* GMail Message Notifier: Controleert en weergeeft het aantal ongelezen e-mailberichten van een GMail Account
Gebruik: GMailMessageNotifier.exe emailadres wachtwoord
Gemaakt door: Alex van Herwijnen - http://www.alex-media.nl/
Bedacht door: Hemmo de Vries - http://www.hemmodevries.nl/
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Xml;
namespace GMailMessageNotifier
{
class Program
{
static void Main(string[] args)
{
string feedurl = "https://mail.google.com/mail/feed/atom";
string GMailUser;
string GMailPass;
try
{
if (args.Length == 2)
{
GMailUser = args[0];
GMailPass = args[1];
NetworkCredential creds = new NetworkCredential(GMailUser, GMailPass);
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = creds;
XmlTextReader reader = new XmlTextReader(feedurl);
reader.XmlResolver = resolver;
XmlDocument document = new XmlDocument();
document.Load(reader);
#region parsen
XmlNode fullcount = document.GetElementsByTagName("fullcount")[0];
int numMsg = Convert.ToInt32(fullcount.InnerText);
#endregion
#region output
Console.Write(numMsg);
#endregion
}
else
{
Console.Write("-1");
}
}
catch (WebException webex)
{
Console.Write("-1");
}
 
catch (XmlException xmlex)
{
Console.Write("-1");
}
catch (Exception ex)
{
// oopsie. something went wrong... let's output an errormessage
Console.Write("-1");
}
}
}
}