| | |
| | | - Added BCC and REFERENCE to the list of headers to fetch in iil_C_FetchHeaders() |
| | | - Leave messageID unchanged in iil_C_FetchHeaders() |
| | | - Avoid stripslahes in iil_Connect() |
| | | - Added patch to iil_SortHeaders() by Richard Green |
| | | - Removed <br> from error messages (better for logging) |
| | | - Removed some debuggers (echo ...) |
| | | |
| | | ********************************************************/ |
| | |
| | | $conn->errorNum = 0; |
| | | return $conn->fp; |
| | | }else{ |
| | | $conn->error .= 'Authentication failed (AUTH): <br>"'.htmlspecialchars($line)."\""; |
| | | $conn->error .= 'Authentication for '.$user.' failed (AUTH): "'.htmlspecialchars($line)."\""; |
| | | $conn->errorNum = -2; |
| | | return false; |
| | | } |
| | |
| | | }else{ |
| | | $result=false; |
| | | fclose($conn->fp); |
| | | $conn->error .= 'Authentication failed (LOGIN):<br>"'.htmlspecialchars($line)."\""; |
| | | $conn->error .= 'Authentication for '.$user.' failed (LOGIN): "'.htmlspecialchars($line)."\""; |
| | | $conn->errorNum = -2; |
| | | } |
| | | return $result; |
| | |
| | | //echo '<!-- conn sort_field: '.$my_prefs['sort_field'].' //-->'; |
| | | |
| | | //check input |
| | | if (empty($host)) $iil_error .= "Invalid host<br>\n"; |
| | | if (empty($user)) $iil_error .= "Invalid user<br>\n"; |
| | | if (empty($password)) $iil_error .= "Invalid password<br>\n"; |
| | | if (empty($host)) $iil_error .= "Invalid host\n"; |
| | | if (empty($user)) $iil_error .= "Invalid user\n"; |
| | | if (empty($password)) $iil_error .= "Invalid password\n"; |
| | | if (!empty($iil_error)) return false; |
| | | if (!$ICL_PORT) $ICL_PORT = 143; |
| | | |
| | |
| | | if (empty($flag)) $flag="ASC"; |
| | | $flag=strtoupper($flag); |
| | | $stripArr = ($field=='subject') ? array('Re: ','Fwd: ','Fw: ',"\"") : array("\""); |
| | | |
| | | |
| | | $c=count($a); |
| | | if ($c>0){ |
| | | /* |
| | |
| | | and use that to sort the main array. |
| | | */ |
| | | |
| | | // create "index" array |
| | | // create "index" array |
| | | $index=array(); |
| | | reset($a); |
| | | while (list($key, $val)=each($a)){ |
| | | $data=$a[$key]->$field; |
| | | if (is_string($data)) $data=strtoupper(str_replace($stripArr, "", $data)); |
| | | |
| | | if ($field=="timestamp"){ |
| | | $data = @strtotime($val->date); |
| | | if ($data == false) |
| | | $data = $val->timestamp; |
| | | } |
| | | else { |
| | | $data = $val->$field; |
| | | if (is_string($data)) |
| | | $data=strtoupper(str_replace($stripArr, "", $data)); |
| | | } |
| | | |
| | | $index[$key]=$data; |
| | | } |
| | | |
| | |
| | | $result_code=iil_ParseResult($line); |
| | | if ($result_code==0) return $messages; |
| | | else{ |
| | | $conn->error = "iil_C_Search: ".$line."<br>\n"; |
| | | $conn->error = "iil_C_Search: ".$line."\n"; |
| | | return false; |
| | | } |
| | | |
| | | }else{ |
| | | $conn->error = "iil_C_Search: Couldn't select \"$folder\" <br>\n"; |
| | | $conn->error = "iil_C_Search: Couldn't select \"$folder\"\n"; |
| | | return false; |
| | | } |
| | | } |
| | |
| | | }while($line[0]!="A"); |
| | | |
| | | $result = (iil_ParseResult($line)==0); |
| | | if (!$result) $conn->error .= $line."<br>\n"; |
| | | if (!$result) $conn->error .= $line."\n"; |
| | | return $result; |
| | | |
| | | }else{ |
| | | $conn->error .= "Couldn't send command \"$request\"<br>\n"; |
| | | $conn->error .= "Couldn't send command \"$request\"\n"; |
| | | return false; |
| | | } |
| | | } |
| | |
| | | $in_fp = false; |
| | | if (file_exists(realpath($path))) $in_fp = fopen($path, "r"); |
| | | if (!$in_fp){ |
| | | $conn->error .= "Couldn't open $path for reading<br>\n"; |
| | | $conn->error .= "Couldn't open $path for reading\n"; |
| | | return false; |
| | | } |
| | | |
| | |
| | | }while($line[0]!="A"); |
| | | |
| | | $result = (iil_ParseResult($line)==0); |
| | | if (!$result) $conn->error .= $line."<br>\n"; |
| | | if (!$result) $conn->error .= $line."\n"; |
| | | return $result; |
| | | |
| | | }else{ |
| | | $conn->error .= "Couldn't send command \"$request\"<br>\n"; |
| | | $conn->error .= "Couldn't send command \"$request\"\n"; |
| | | return false; |
| | | } |
| | | } |