diff -upr email_verify/email_verify.inc.php email_verify_new/email_verify.inc.php --- email_verify/email_verify.inc.php 2011-04-17 19:47:42.000000000 -0500 +++ email_verify_new/email_verify.inc.php 2011-04-17 19:53:41.000000000 -0500 @@ -20,6 +20,11 @@ function _email_verify_check($mail) { return t('Email host %host invalid, please retry.', array('%host' => "$host")); } + // If Install found port 25 closed, we can't test mailboxes + If (variable_get('email_verify_skip_mailbox',FALSE)) { + return; + } + // What SMTP servers should we contact? $mx_hosts = array(); if (!getmxrr($host, $mx_hosts)) { diff -upr email_verify/email_verify.install email_verify_new/email_verify.install --- email_verify/email_verify.install 2011-04-17 19:47:42.000000000 -0500 +++ email_verify_new/email_verify.install 2011-04-17 19:53:41.000000000 -0500 @@ -25,6 +25,20 @@ function email_verify_enable() { include_once dirname(__FILE__) .'/windows_compat.inc'; + // If a previous enable found port 25 closed, don't test it again. + // Testing can cause a long delay on module enable. Use uninstall/re-install to re-test. + If (variable_get('email_verify_skip_mailbox',FALSE)) { + return; + } + + // Check if fsockopen() is disabled. http://www.php.net/manual/en/function.function-exists.php#67947 + if (!function_exists('fsockopen')) { + $message = t('Email Verify will test email domains but not mailboxes because your host has disabled the function fsockopen() for security.'); + variable_set('email_verify_skip_mailbox',TRUE); + drupal_set_message($message, 'warning'); + return; + } + if (!getmxrr($host, $mx_hosts)) { // When there is no MX record, the host itself should be used $mx_hosts[] = $host; @@ -45,16 +59,16 @@ function email_verify_enable() { } if (!$connect) { - $message = t('Email verify has tried contacting the mail host but did not receive a reply.' - .' Check with your hosting provider that the function fsockopen() is properly configured on your server,' - .' and that port 25 is open. The module has been disabled.'); - - watchdog('email_verify', $message, WATCHDOG_ERROR); - drupal_set_message($message, 'error'); - module_disable(array('email_verify')); + $message = t('Email Verify will test email domains but not mailboxes because port 25 is closed on your host\'s firewall for security.'); + variable_set('email_verify_skip_mailbox',TRUE); + drupal_set_message($message, 'warning'); } } -// Local Variables: -// mode: php -// End: +/** + * Remove variables on uninstall. + */ +function email_verify_uninstall() { + db_query("DELETE FROM {variable} WHERE name LIKE 'email_verify_%'"); + cache_clear_all('variables', 'cache'); +} Only in email_verify_new: po