alecpl
2009-07-07 d559cba5f7b92f152dd0330e2870d5512cd34e51
- Added 'imap_debug' option, described 'sql_debug' option in config file


5 files modified
30 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
config/main.inc.php.dist 7 ●●●● patch | view | raw | blame | history
program/include/rcmail.php 1 ●●●● patch | view | raw | blame | history
program/include/rcube_mdb2.php 4 ●●● patch | view | raw | blame | history
program/lib/imap.inc 17 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
- Added 'imap_debug' option
- Support strftime's format modifiers in date_* options (#1484806)
- Support %h variable in 'smtp_server' option (#1485766)
- Show SMTP errors in browser (#1485927)
config/main.inc.php.dist
@@ -14,7 +14,6 @@
$rcmail_config = array();
// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
$rcmail_config['debug_level'] = 1;
@@ -125,6 +124,12 @@
// Log sent messages
$rcmail_config['smtp_log'] = TRUE;
// Log SQL queries to <log_dir>/sql or to syslog
$rcmail_config['sql_debug'] = false;
// Log IMAP conversation to <log_dir>/imap or to syslog
$rcmail_config['imap_debug'] = false;
// How many seconds must pass between emails sent by a user
$rcmail_config['sendmail_delay'] = 0;
program/include/rcmail.php
@@ -366,6 +366,7 @@
      'imap' => $this->config->get('imap_auth_type', 'check'),
      'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'),
      'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'),
      'debug_mode' => (bool) $this->config->get('imap_debug', 0),
    );
    $this->imap->set_options($options);
program/include/rcube_mdb2.php
@@ -701,8 +701,6 @@
  {
    $debug_output = $scope . '('.$db->db_index.'): ';
    $debug_output .= $message . $db->getOption('log_line_break');
    write_log('sqllog', $debug_output);
    write_log('sql', $debug_output);
  }
}
program/lib/imap.inc
@@ -197,7 +197,11 @@
}
function iil_PutLine($fp, $string, $endln=true) {
//      console('C: '. rtrim($string));
    global $my_prefs;
    if(!empty($my_prefs['debug_mode']))
            write_log('imap', 'C: '. rtrim($string));
        return fputs($fp, $string . ($endln ? "\r\n" : ''));
}
@@ -225,6 +229,8 @@
}
function iil_ReadLine($fp, $size=1024) {
    global $my_prefs;
    $line = '';
    if (!$fp) {
@@ -240,7 +246,8 @@
            if ($buffer === false) {
                break;
            }
//        console('S: '. chop($buffer));
        if(!empty($my_prefs['debug_mode']))
            write_log('imap', 'S: '. chop($buffer));
            $line .= $buffer;
    } while ($buffer[strlen($buffer)-1] != "\n");
    
@@ -265,6 +272,7 @@
}
function iil_ReadBytes($fp, $bytes) {
    global $my_prefs;
    $data = '';
    $len  = 0;
    do {
@@ -273,7 +281,8 @@
        if ($len == strlen($data)) {
                    break; //nothing was read -> exit to avoid apache lockups
            }
//        console('[...] '. $d);
        if(!empty($my_prefs['debug_mode']))
            write_log('imap', 'S: '. $d);
            $len = strlen($data);
    } while ($len < $bytes);
    
@@ -553,6 +562,8 @@
                    $my_prefs['rootdir'] = $optval;
            } else if ($optkey == 'delimiter') {
                    $my_prefs['delimiter'] = $optval;
            } else if ($optkey == 'debug_mode') {
                    $my_prefs['debug_mode'] = $optval;
            }
        }
    }