-
- $body .= "\nMy browser information:\n";
- $body .= " $HTTP_USER_AGENT\n";
- $body .= " get_browser() information (List)\n";
- $browser = get_browser();
- $body .= Show_Array((array) $browser);
-
- $body .= "\nMy web server information:\n";
- $body .= " PHP Version " . phpversion() . "\n";
- $body .= " PHP Extensions (List)\n";
- $body .= Show_Array(get_loaded_extensions());
- // Apache version?
-
- $body .= "\nSquirrelMail-specific information:\n";
- $body .= " Version: $version\n";
- $body .= " Plugins (List)\n";
- $body .= Show_Array($plugins);
- if ($ldap_server[0] && ! extension_loaded('ldap'))
- {
- $warning = 1;
- $warnings['ldap'] = "LDAP server defined in SquirrelMail config, " .
- "but the module is not loaded in PHP";
- $corrections['ldap'][] = "Reconfigure PHP with the option '--with-ldap'";
- $corrections['ldap'][] = "Then recompile PHP and reinstall";
- $corrections['ldap'][] = "-- OR --";
- $corrections['ldap'][] = "Reconfigure SquirrelMail to not use LDAP";
- }
-
- $body .= "\nMy IMAP server information:\n";
- $body .= " Server type: $imap_server_type\n";
- $imap_stream = fsockopen ($imapServerAddress, $imapPort, &$error_number, &$error_string);
- $server_info = fgets ($imap_stream, 1024);
- if ($imap_stream)
- {
- // SUPRESS HOST NAME
- $list = explode(' ', $server_info);
- $list[2] = '[HIDDEN]';
- $server_info = implode(' ', $list);
- $body .= " Server info: $server_info";
- fputs ($imap_stream, "a001 CAPABILITY\r\n");
- $read = fgets($imap_stream, 1024);
- $list = explode(' ', $read);
- array_shift($list);
- array_shift($list);
- $read = implode(' ', $list);
- $body .= " Cabailities: $read";
- fputs ($imap_stream, "a002 LOGOUT\r\n");
- fclose($imap_stream);
- }
- else
- {
- $body .= " Unable to connect to IMAP server to get information.\n";
- $warning = 1;
- $warnings['imap'] = "Unable to connect to IMAP server";
- $corrections['imap'][] = "Make sure you specified the correct mail server";
- $corrections['imap'][] = "Make sure the mail server is running IMAP, not POP";
- $corrections['imap'][] = "Make sure the server responds to port $imapPort";
- }
-
- $warning_num = 0;
- if ($warning)
- {
- foreach ($warnings as $key => $value)
- {
- if ($warning_num == 0)
- {
- $body_top .= "WARNINGS WERE REPORTED WITH YOUR SETUP:\n";
- $body_top = "WARNINGS WERE REPORTED WITH YOUR SETUP -- SEE BELOW\n\n$body_top";
- $warning_html = "<h1>Warnings were reported with your setup:</h1>\n<dl>\n";
- }
- $warning_num ++;
- $warning_html .= "<dt><b>$value</b></dt>\n";
- $body_top .= "\n$value\n";
- foreach ($corrections[$key] as $corr_val)
- {
- $body_top .= " * $corr_val\n";
- $warning_html .= "<dd>* $corr_val</dd>\n";
- }
- }
- $warning_html .= "</dl>\n<p>$warning_num warning(s) reported.</p>\n<hr>\n";
- $body_top .= "\n$warning_num warning(s) reported.\n";
- $body_top .= "----------------------------------------------\n";
- }
-
- $body = htmlspecialchars($body_top . $body);