Index: mailhandler.test
===================================================================
diff -u -r1.1.2.2 mailhandler.test
--- mailhandler.test	26 Jan 2011 11:55:13 -0000	1.1.2.2
+++ mailhandler.test	26 Jan 2011 12:46:02 -0000
@@ -278,6 +278,20 @@
    * Helper functions.
    */
 
+  function testImap() {
+    // Try to load php IMAP extension on runtime.
+    $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
+      // http://php.net/manual/en/function.dl.php
+      // On multithreaded servers, dl() returns an error. Although disencouraged
+    if (!@dl($prefix . 'imap.' . PHP_SHLIB_SUFFIX)) {
+      $this->pass(t('IMAP extension can not be loaded.'));
+    }
+    if (!function_exists('imap_open')) {
+      $this->pass(t('imap_open function available.'));
+    }
+    $this->pass('IMAP verification finished');
+  }
+
   /**
    * Create a mailbox in the database.
    *

