diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-16 11:29:53 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-16 11:29:53 +0000 |
| commit | df51e06ff325b7be7bfda704f9d662c103b626c9 (patch) | |
| tree | 21335a62b0476ee8748dd3fae1725303c66a721f /roundcubemail/program/steps/mail/get.inc | |
| parent | 464bad0f895d6f4080811f5e68267de418957501 (diff) | |
- Fix when IMAP connection fails in 'get' action session shouldn't be destroyed (#1486995)
- Performance: improve mail/get action and skip one IMAP connection
git-svn-id: https://svn.roundcube.net/trunk@3969 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/get.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/get.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/get.inc b/roundcubemail/program/steps/mail/get.inc index 67c62b284..50731e012 100644 --- a/roundcubemail/program/steps/mail/get.inc +++ b/roundcubemail/program/steps/mail/get.inc @@ -35,6 +35,30 @@ if (!empty($_GET['_preload'])) { ob_end_clean(); +// Now we need IMAP connection +if (!$RCMAIL->imap_connect()) { + // Get action is often executed simultanously. + // Some servers have MAXPERIP or other limits. + // To workaround this we'll wait for some time + // and try again (once). + // Note: When message contains more inline parts and the server limit is low + // this stil maybe the issue, while we're using the same sleep interval, but + // I didn't found better solution. + if (!isset($_GET['_redirected'])) { + sleep(2); + header('Location: ' . $_SERVER['REQUEST_URI'] . '&_redirected=1'); + } + else { + raise_error(array( + 'code' => 500, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => 'Unable to get/display message part. IMAP connection error'), + true, true); + } + // Don't kill session, just quit (#1486995) + exit; +} + // similar code as in program/steps/mail/show.inc if (!empty($_GET['_uid'])) { $RCMAIL->config->set('prefer_html', true); |
