I made a little sketch that displays some information about my mailbox using IMAP. It also gives me some information when a call arrives at my asterisks PBX box. For this it works together with Superfecta (See here)

I've just some code from different auteur on the net (ntptime etc) and glued it together with the code I wrote myself.

I plpan on updating the IMAP code, so that the sender and the subject is displayed when a new mail arrives.

In the code be sure to put your own server adresses and username, password and mailboxname.

<?php//this file is designed to be used as an include that is part of a loop.//If a valid match is found, it should give $caller_id a value//available variables for use are: $thenumber//retreive website contents using get_url_contents($url);//this data source created by Zorka 01/18/2011

//configuration / display parameters//The description cannot contain "a" tags, but can contain limited HTML. Some HTML (like the a tags) will break the UI.$source_desc = "This source will send the number and the Caller ID to a webenabled Arduino.<br>Enter the URL of the Arduino in the format `url:port`.<br>This datasource should be one of the last data sources on your list, as it does not provide any data of its own, and can only send what information has been collected before it is run.<br>This data source requires Superfecta Module version 2.2.3 or higher.";$source_param = array();$source_param['URL_address']['desc'] = 'Specify the URL:Port to the Arduino installation. (Example: 192.168.1.222:8080)';$source_param['URL_address']['type'] = 'text';$source_param['URL_address']['default'] = '';

// if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println();