42 |
42 |
43 var $ALLOWAPOP = FALSE; // Allow or disallow apop() |
43 var $ALLOWAPOP = FALSE; // Allow or disallow apop() |
44 // This must be set to true |
44 // This must be set to true |
45 // manually |
45 // manually |
46 |
46 |
47 function POP3 ( $server = '', $timeout = '' ) { |
47 /** |
|
48 * PHP5 constructor. |
|
49 */ |
|
50 function __construct ( $server = '', $timeout = '' ) { |
48 settype($this->BUFFER,"integer"); |
51 settype($this->BUFFER,"integer"); |
49 if( !empty($server) ) { |
52 if( !empty($server) ) { |
50 // Do not allow programs to alter MAILSERVER |
53 // Do not allow programs to alter MAILSERVER |
51 // if it is already specified. They can get around |
54 // if it is already specified. They can get around |
52 // this if they -really- want to, so don't count on it. |
55 // this if they -really- want to, so don't count on it. |
60 set_time_limit($timeout); |
63 set_time_limit($timeout); |
61 } |
64 } |
62 return true; |
65 return true; |
63 } |
66 } |
64 |
67 |
|
68 /** |
|
69 * PHP4 constructor. |
|
70 */ |
|
71 public function POP3( $server = '', $timeout = '' ) { |
|
72 self::__construct( $server, $timeout ); |
|
73 } |
|
74 |
65 function update_timer () { |
75 function update_timer () { |
66 if (!ini_get('safe_mode')) |
76 if (!ini_get('safe_mode')) |
67 set_time_limit($this->TIMEOUT); |
77 set_time_limit($this->TIMEOUT); |
68 return true; |
78 return true; |
69 } |
79 } |
70 |
80 |
71 function connect ($server, $port = 110) { |
81 function connect ($server, $port = 110) { |
72 // Opens a socket to the specified server. Unless overridden, |
82 // Opens a socket to the specified server. Unless overridden, |
73 // port defaults to 110. Returns true on success, false on fail |
83 // port defaults to 110. Returns true on success, false on fail |
74 |
84 |
75 // If MAILSERVER is set, override $server with it's value |
85 // If MAILSERVER is set, override $server with its value. |
76 |
86 |
77 if (!isset($port) || !$port) {$port = 110;} |
87 if (!isset($port) || !$port) {$port = 110;} |
78 if(!empty($this->MAILSERVER)) |
88 if(!empty($this->MAILSERVER)) |
79 $server = $this->MAILSERVER; |
89 $server = $this->MAILSERVER; |
80 |
90 |
418 } |
428 } |
419 $reply = $this->send_cmd("RSET"); |
429 $reply = $this->send_cmd("RSET"); |
420 if(!$this->is_ok($reply)) |
430 if(!$this->is_ok($reply)) |
421 { |
431 { |
422 // The POP3 RSET command -never- gives a -ERR |
432 // The POP3 RSET command -never- gives a -ERR |
423 // response - if it ever does, something truely |
433 // response - if it ever does, something truly |
424 // wild is going on. |
434 // wild is going on. |
425 |
435 |
426 $this->ERROR = "POP3 reset: " . _("Error ") . "[$reply]"; |
436 $this->ERROR = "POP3 reset: " . _("Error ") . "[$reply]"; |
427 @error_log("POP3 reset: ERROR [$reply]",0); |
437 @error_log("POP3 reset: ERROR [$reply]",0); |
428 } |
438 } |