Mailhandler should explicitly check that php's IMAP extension is enabled using a simple function_exists() call upon installation, and then should provide a helpful error message. In fact, php.net's function_exists() page uses an imap_open check in its example as luck would have it. This feature request was based on a support ticket in the forums.

CommentFileSizeAuthor
#1 mailhandler_imapcheck.patch419 bytesChrisKennedy

Comments

ChrisKennedy’s picture

Status: Active » Needs review
StatusFileSize
new419 bytes

Here's my patch for this. I don't have access to a box where I could disable the IMAP extension unfortunately, so it's a theoretical fix right now.

--- mailhandler.install.1       2006-08-10 09:52:32.000000000 -0500
+++ mailhandler.install 2006-08-10 09:47:30.000000000 -0500
@@ -59,6 +59,11 @@
    ");
    break;
   }
+
+  // Check that php's imap extension is installed
+  if (!function_exists('imap_open')) {
+    drupal_set_message(t("PHP's IMAP extension was not detected, which may prevent Mailhandler from operating correctly."), 'error');
+  }
 }

Minor side note: mailhandler.install has a typo in CVS in the pgsql section: "case: 'pgsql':" rather than "case 'pgsql':" (line 34). I'm not sure if I should make a separate bug report since it's a one-character change.

moshe weitzman’s picture

Status: Needs review » Fixed

applied to head and 4.7

i think this should be done in the module itself so it is more prominent. but i'll take this for now.

Anonymous’s picture

Status: Fixed » Closed (fixed)