Changeset 1845 in ExiteCMS


Ignore:
Timestamp:
10/10/08 09:04:02 (3 years ago)
Author:
hverton
Message:

disabled image verification of URL's of images (takes to long, slows the forum down)
added CheckRecipient(), allow SMTP returncode 451, and any reply containing the word "greylist"

Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/class.smtp.php

    r1794 r1845  
    769769 
    770770  /** 
     771   * Sends the command RCPT to the SMTP server with the TO: argument of $to. 
     772   * Returns true if the recipient was accepted false if it was rejected. 
     773   * 
     774   * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF> 
     775   * 
     776   * [WW] Copy of Recipient(), but allows 451 as a valid return code 
     777   *      and any reply that contains the word "greylist" 
     778   * 
     779   * SMTP CODE SUCCESS: 250,251,451 
     780   * SMTP CODE FAILURE: 550,551,552,553,450,452 
     781   * SMTP CODE ERROR  : 500,501,503,421 
     782   * @access public 
     783   * @return bool 
     784   */ 
     785  function CheckRecipient($to) { 
     786    $this->error = null; # so no confusion is caused 
     787 
     788    if(!$this->connected()) { 
     789      $this->error = array( 
     790              "error" => "Called Recipient() without being connected"); 
     791      return false; 
     792    } 
     793 
     794    fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); 
     795 
     796    $rply = $this->get_lines(); 
     797    $code = substr($rply,0,3); 
     798 
     799    if($this->do_debug >= 2) { 
     800      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; 
     801    } 
     802 
     803    if($code != 250 && $code != 251 && $code != 451 && strpos($reply,"greylist")===false) { 
     804      $this->error = 
     805        array("error" => "RCPT not accepted from server", 
     806              "smtp_code" => $code, 
     807              "smtp_msg" => substr($rply,4)); 
     808      if($this->do_debug >= 1) { 
     809        echo "SMTP -> ERROR: " . $this->error["error"] . 
     810                 ": " . $rply . $this->CRLF; 
     811      } 
     812      return false; 
     813    } 
     814    return true; 
     815  } 
     816 
     817  /** 
    771818   * Sends the RSET command to abort and transaction that is 
    772819   * currently in progress. Returns true if successful false 
  • trunk/includes/core_functions.php

    r1802 r1845  
    432432            return true; 
    433433        } 
     434        // checking takes to long, return true 
     435        return true; 
    434436        $uri['port'] = isset($uri['port']) ? $uri['port'] : 80; 
    435437        // use a timeout of 1 second, slow servers will slow us down too! 
Note: See TracChangeset for help on using the changeset viewer.