imap performance related issue, move the fetch to the area we need the
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Oct 2002 17:22:50 +0000 (17:22 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Oct 2002 17:22:50 +0000 (17:22 +0000)
result.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3770 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/spamcop/spamcop.php

index 90ad526adae07b8a090a502c6aa5a301eaaffa34..704b61ef57f02c5982ba1da24759aaec64d6b290 100644 (file)
@@ -89,13 +89,6 @@ function getMessage_RFC822_Attachment($message, $composeMessage, $passed_id,
     $imap_stream = sqimap_login($username, $key, $imapServerAddress, 
        $imapPort, 0);
     sqimap_mailbox_select($imap_stream, $mailbox);
     $imap_stream = sqimap_login($username, $key, $imapServerAddress, 
        $imapPort, 0);
     sqimap_mailbox_select($imap_stream, $mailbox);
-    
-
-    $sid = sqimap_session_id($uid_support);
-    fputs($imap_stream, $sid.' FETCH ' . $passed_id . ' RFC822' . "\r\n");
-    
-    $read = sqimap_read_data($imap_stream, $sid, true, $response, $message);
-    array_shift($read);
 
     if ($spamcop_method == 'quick_email' || 
         $spamcop_method == 'thorough_email') {
 
     if ($spamcop_method == 'quick_email' || 
         $spamcop_method == 'thorough_email') {
@@ -180,6 +173,12 @@ agree to follow SpamCop's rules/terms of service/etc.</p>
   <input type=hidden name="session" value="<?PHP echo $session?>">
   <input type=submit name="send" value="Send Spam Report">
 <?PHP } else {
   <input type=hidden name="session" value="<?PHP echo $session?>">
   <input type=submit name="send" value="Send Spam Report">
 <?PHP } else {
+   $sid = sqimap_session_id($uid_support);
+   fputs($imap_stream, $sid.' FETCH ' . $passed_id . ' RFC822' . "\r\n");
+    
+   $read = sqimap_read_data($imap_stream, $sid, true, $response, $message);
+   array_shift($read);
+
    $Message = implode('', $read);
    if (strlen($Message) > 50000) {
       $Warning = "\n[truncated by SpamCop]\n";
    $Message = implode('', $read);
    if (strlen($Message) > 50000) {
       $Warning = "\n[truncated by SpamCop]\n";