Index: /lib/session.php
===================================================================
--- /lib/session.php	(revision 139)
+++ /lib/session.php	(revision 152)
@@ -18,4 +18,5 @@
 public	$username='';		// Username
 public	$fullname;		// Fullname
+public  $email=0;		// Email waiting?
 public  $groups  =array();	// users groups
 public	$data='';		// Var/array for session persistant data
@@ -166,6 +167,14 @@
 		ldap_close($ldap);
 
+		// Check the user's email status
+		$mailstat = stat("/var/spool/mail/".$user);
+		if ($mailstat[size]>0) {
+			if ($mailstat[mtime]>$mailstat[atime]) $this->email = 2;
+			else $this->email = 1;
+		}
+
 		$this->fullname = $info['cn'][0];
 		$this->groups = $info['grouplist'];
+
 	}
 
Index: /templates/login.tpl
===================================================================
--- /templates/login.tpl	(revision 139)
+++ /templates/login.tpl	(revision 152)
@@ -4,4 +4,11 @@
 {if $session->loggedin}
 Logged in as {$session->username}<br/>
+{if $session->email=="0"}
+No email<br />
+{elseif $session->email=="1"}
+Email waiting<br />
+{elseif $session->email=="2"}
+New email<br />
+{/if}
 					<input type="submit" class="button" name="Logout" id="Logout" value="Logout" />
 {else}
