Browse Source

Added port check to make sure it is set otherwise this breaks

jangliss 22 years ago
parent
commit
d6079329f1
1 changed files with 3 additions and 2 deletions
  1. 3 2
      plugins/mail_fetch/class.POP3.php

+ 3 - 2
plugins/mail_fetch/class.POP3.php

@@ -71,7 +71,8 @@ class POP3 {
         //  port defaults to 110. Returns true on success, false on fail
         //  port defaults to 110. Returns true on success, false on fail
 
 
         // If MAILSERVER is set, override $server with it's value
         // If MAILSERVER is set, override $server with it's value
-
+	
+	if (!isset($port) || !$port) {$port = 110;}
         if(!empty($this->MAILSERVER))
         if(!empty($this->MAILSERVER))
             $server = $this->MAILSERVER;
             $server = $this->MAILSERVER;
 
 
@@ -82,7 +83,7 @@ class POP3 {
         }
         }
 
 
         $fp = fsockopen("$server", $port, $errno, $errstr);
         $fp = fsockopen("$server", $port, $errno, $errstr);
-
+        echo 'Server: ' . $server . '<br>Port: ' . $port;
         if(!$fp) {
         if(!$fp) {
             $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]";
             $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]";
             unset($this->FP);
             unset($this->FP);