4 * functions for info plugin
6 * Here are two functions for the info plugin
7 * The first gets the CAPABILITY response from your IMAP server.
8 * The second runs the passed IMAP test and returns the results
9 * The third prints the results of the IMAP command
12 * @author Jason Munro <jason at stdbev.com>
13 * @copyright © 1999-2007 The SquirrelMail Project Team
14 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
21 * Get the IMAP capabilities
23 * @param mixed $imap_stream
27 function get_caps($imap_stream) {
28 return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);
32 * Run an IMAP test and return the results
34 * @param mixed $imap_stream
35 * @param string $string imap command
36 * @return array Response from the IMAP server
39 function imap_test($imap_stream, $string) {
40 print "<tr><td>".htmlspecialchars($string)."</td></tr>";
41 $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false);
42 array_push($response, $responses . ' ' .$message);
47 * Print the IMAP response to options.php
49 * @param array $response results of imap command
52 function print_response($response) {
53 foreach($response as $value) {
54 if (is_array($value)) {
55 print_response($value);
58 print htmlspecialchars($value)."<br />\n";