From 44ea3fd4782889ee97717ce925d87979390e4bb3 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 18 Dec 2008 05:15:39 -0500
Subject: [PATCH] - Fix STARTTLS before AUTH in SMTP connection (#1484883)

---
 program/include/rcmail.php |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 53b4765..c7f26d9 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -171,6 +171,10 @@
 
     // set localization
     setlocale(LC_ALL, $_SESSION['language'] . '.utf8', 'en_US.utf8');
+
+    // workaround for http://bugs.php.net/bug.php?id=18556 
+    if (in_array($_SESSION['language'], array('tr_TR', 'ku', 'az_AZ'))) 
+      setlocale(LC_CTYPE, 'en_US' . '.utf8'); 
   }
   
   
@@ -288,6 +292,14 @@
 
     foreach (array('flag_for_deletion','read_when_deleted') as $js_config_var) {
       $this->output->set_env($js_config_var, $this->config->get($js_config_var));
+    }
+    
+    // set keep-alive/check-recent interval
+    if ($keep_alive = $this->config->get('keep_alive')) {
+      // be sure that it's less than session lifetime
+      if ($session_lifetime = $this->config->get('session_lifetime'))
+        $keep_alive = min($keep_alive, $session_lifetime * 60 - 30);
+      $this->output->set_env('keep_alive', max(60, $keep_alive));
     }
 
     if ($framed) {
@@ -503,10 +515,6 @@
   {
     $this->imap->set_charset($this->config->get('default_charset', RCMAIL_CHARSET));
 
-    // set root dir from config
-    if ($imap_root = $this->config->get('imap_root')) {
-      $this->imap->set_rootdir($imap_root);
-    }
     if ($default_folders = $this->config->get('default_imap_folders')) {
       $this->imap->set_default_mailboxes($default_folders);
     }

--
Gitblit v1.9.1