Hi, folks - first post here and I am seeking assistance - :o - I either need to know how to define the function correctly - or is it a cPanel issue
(my developer suggested this "Here is the issue, lately Cpanel was updated. now the host has to manually install the imap module for php.)Send your host the following information:
"/scripts/easyapache , option 6 , PHP Modules: ensure "IMAP" is ticked." )
The software checks for email tickets using email piping and I'm getting an error
Fatal error: Call to undefined function: imap_open() in /home/XXXXXX/public_html/help/receive.php on line 161
history - it did used to work -
My knowledge (not much)
Developer (fast asleep on the other side of the world)
Urgent? 'fraid so
CPanel upgraded - and hasn't worked since.
Code (it's not the whole file, but might be enough to give you a clue):
$query = "SELECT * FROM mail_accounts";
$mail_accounts = mysql_query($query);
while ($mails = mysql_fetch_array($mail_accounts))
{
$receive_server = $mail_servers[$mails["ms_id"]];
$r_login = $mails["login"];
$r_password = $mails["passwd"];
if ($mail_servers_type[$mails["ms_id"]] == "p") $receive_server .= "/pop3:110";
else $receive_server .= ":143";
if ($mbox = imap_open("\{$receive_server}", $r_login, $r_password))
{
$count = imap_num_msg($mbox);
for ($j = 1; $j <= $count; $j++)
{
$header = imap_headerinfo($mbox, $j);
$email = $header -> from[0] -> mailbox . "@" . $header -> from[0] -> host;
$subject = $header -> subject;
$date = $header -> date;
$date = trim(preg_replace("/[^,]*,/", "", $date));
$date = trim(preg_replace("/\s+(\+|\-)[\s\S]+\z/U", "", $date));
$date = preg_split("/\s+/", $date);
$date[1] = $months[$date[1]];
$time = preg_split("/:/", array_pop($date));
$add_date = mktime($time[0], $time[1], $time[2], $date[1], $date[0], $date[2]);
$add_date = date("YmdHis", $add_date);
$query = "SELECT value FROM preferences WHERE field = 'flood'";
$result = mysql_query($query);
list($flood) = mysql_fetch_row($result);
$query = "SELECT * FROM clients WHERE email = '$email'";
$result = mysql_query($query);
$client = mysql_fetch_array($result);
if ($client["id"])
{
$query = "SELECT date FROM receive_time WHERE client_id = '" . $client["id"] . "'";
$result = mysql_query($query);
list($old_date) = mysql_fetch_row($result);
if (!$old_date)
{
$query = "INSERT INTO receive_time (client_id, date) VALUES (" . $client["id"] . ", '$add_date')";
$result = mysql_query($query);
}
else
{
preg_match("/\d{8}(\d{2})(\d{2})(\d{2})/", $old_date, $old_time);
preg_match("/(\d{4})(\d{2})(\d{2})\d{6}/", $old_date, $old_date);
$time = mktime($time[0], $time[1], $time[2], $date[1], $date[0], $date[2]);
$old_time = mktime($old_time[1], $old_time[2], $old_time[3], $old_date[2], $old_date[3], $old_date[1]) + $flood;
if ($old_time > $time) unset($client);
}
}
else $client["id"] = 3;
$query = "SELECT email FROM ban_emails WHERE email LIKE '$email'";
$result = mysql_query($query);
list($temp) = mysql_fetch_row($result);
if ($temp) $client["id"] = 0;
if ($client["id"])
{
$client_id = $client["id"];
// echo "Add Client: $client_id<br>";
$data = imap_fetchstructure($mbox, $j);
/* $file = fopen("temp.txt", "w");
fwrite($file, $str);
fclose($file);
echo $data->type, "<br>";*/
/
$query = "SELECT id FROM departments WHERE emails = 1";
$result = mysql_query($query);
list($d_id) = mysql_fetch_row($result);
/
$d_id = $mails["d_id"];
if ($d_id != "") {
$letter = imap_body($mbox, $j);
unset($global_parts);
$global_parts = array();
$parts = 0;
MakeParts($letter, $data, 1);
$query = "SELECT id FROM priority_titles ORDER BY value LIMIT 1";
$result = mysql_query($query);
if (mysql_num_rows($result) == 0) die("<center><font class='small-font'>Please, configure \"Priority titles\" first!</font></center>");
list($priority) = mysql_fetch_row($result);
thanks in advance
Franklymydear