4 * functions for info plugin
5 * Copyright (c) 1999-2004 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 * Here are two functions for the info plugin
9 * The first gets the CAPABILITY response from your IMAP server.
10 * The second runs the passed IMAP test and returns the results
11 * The third prints the results of the IMAP command
13 * by: Jason Munro jason@stdbev.com
21 * Get the IMAP capabilities
24 function get_caps($imap_stream) {
25 return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);
29 * Run an IMAP test and return the results
30 * @return array Response from the IMAP server
32 function imap_test($imap_stream, $string) {
33 global $default_charset;
34 print "<TR><TD>".$string."</TD></TR>";
35 $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false);
36 array_push($response, $responses . ' ' .$message);
41 * Print the IMAP response to options.php
43 function print_response($response) {
44 foreach($response as $index=>$value) {
45 if (is_array($value)) {
46 print_response($value);
49 $value = preg_replace("/</", "<", $value);
50 $value = preg_replace("/>/", ">", $value);
51 print $value."<BR>\n";